Bug#649094: fix 64bit biarch linker scripts

Matthias Klose <[email protected]>
Newsgroups gmane.linux.debian.devel.embedded
Message-ID <50CF567C.8010305__27773.563800338$1355765625$gmane$org@ubuntu.com>
tags 649094 + patch
thanks

at least for 64bit biarch

dpkg-cross (2.6.9ubuntu2) raring; urgency=low

  * Handle biarch linker scripts - LP: #1090800

 -- Marcin Juszkiewicz <[email protected]>   Mon, 17 Dec 2012
15:01:29 +0100
plain.txt (text/plain, 1 KB)
--- dpkg-cross	2012-08-21 11:01:32.000000000 +0200
+++ /usr/bin/dpkg-cross	2012-12-17 14:07:54.848879084 +0100
@@ -628,6 +628,8 @@
 		}
 		while (<FROM>) {
 			s:(^|[^-\w/])(/usr)?/lib/$multiarch:$1$crosslib/:g;
+			s:(^|[^-\w/])(/usr)?/lib64/$multiarch:$1$crosslib64/:g;
+			s:(^|[^-\w/])(/usr)?/lib64/:$1$crosslib64/:g;
 			print TO;
 		}
 		close(FROM);
@@ -798,6 +800,13 @@
 		} elsif ((m:^/emul/ia32-linux/usr/lib/([^/]+\.[ao])$:)) {
 			# regular .a or .o file under /emul/ia32-linux/ for #463588
 			link_file("$src$_", "$dst$crosslib32/$1") or goto fail;
+		} elsif (m:^(/usr)?/lib64/($multiarch)?([^/]+\.so[^/]*)$:) {
+			# regular .so* file under /lib64, /usr/lib64, /lib64/<triplet>, /usr/lib64/<triplet>
+			if (is_ldscript("$src$_")) {
+				fix_ldscript("$src$_", "$dst$crosslib64/$3") or goto fail;
+			} else {
+				link_file("$src$_", "$dst$crosslib64/$3") or goto fail;
+			}
 		} elsif (m:^(/usr)?/lib/($multiarch)?([^/]+\.so[^/]*)$:) {
 			# regular .so* file under /lib, /usr/lib, /lib/<triplet>, /usr/lib/<triplet>
 			if (is_ldscript("$src$_")) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.