Debian Bug report logs - #619400
dpkg-cross does not do sensible things with multi-arch: same packages

version graph

Package: dpkg-cross; Maintainer for dpkg-cross is Debian Embedded Group <debian-embedded@lists.debian.org>; Source for dpkg-cross is src:dpkg-cross.

Reported by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>

Date: Wed, 23 Mar 2011 15:27:04 UTC

Severity: important

Tags: patch

Found in version dpkg-cross/2.6.2

Fixed in version dpkg-cross/2.6.3

Done: Neil Williams <codehelp@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, marcin.juszkiewicz@linaro.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#619400; Package dpkg-cross. (Wed, 23 Mar 2011 15:27:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>:
New Bug report received and forwarded. Copy sent to marcin.juszkiewicz@linaro.org, Debian Embedded Group <debian-embedded@lists.debian.org>. (Wed, 23 Mar 2011 15:27:07 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: dpkg-cross does not do sensible things with multi-arch: same packages
Date: Wed, 23 Mar 2011 16:26:53 +0100
[Message part 1 (text/plain, inline)]
Package: dpkg-cross
Version: 2.6.3ubuntu1
Severity: important
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


This is a copy of Ubuntu bug #739151
https://bugs.launchpad.net/ubuntu/+source/dpkg-cross/+bug/739151

Running dpkg-cross against the Multi-Arch: same version of libc6
currently in natty does not produce sensible output. Instead it
generates a .deb that contains only a large number of iconv .so modules
under /usr/x86_64-linux-gnu/include, e.g.:

 ./usr/x86_64-linux-gnu/include/gconv/libCNS.so

I have no idea why it's installing to include. The source location was
../usr/lib/x86_64-linux-gnu/gconv/.

It might seem that it's not a big deal for dpkg-cross to not handle
multiarch packages since multiarch packages can just be installed
directly; but since we can't use foreign-architecture build dependencies
on the buildds yet, cross-toolchain packages in the archive (such as
armel-cross-toolchain-base) need to build using gcc-4.5-source,
eglibc-source, etc. and run dpkg-cross afterwards to output their binary
packages. So the armel cross-compiler in the archive isn't buildable
until this is resolved.

I've checked with dpkg-cross 2.6.2 from Debian unstable; the same
problem is present there.

- -- Package-specific info:

- -- /etc/dpkg-cross/cross-compile --

#
# /etc/dpkg-cross/cross-compile: configuration for dpkg-cross
#

# default architecture for dpkg-cross (to avoid always typing the -a option
# if you do cross installations only for one architecture)
# Note: default_arch is managed by debconf - it can be overridden
# if ~/.dpkg-cross/cross-compile exists or by specifying an
# architecture on the command line.
# Use '[sudo] dpkg-reconfigure dpkg-cross' to change this value.
#default_arch = 

# All subsequent variables may be removed (and/or become
# unsupported) at any time.

#
# general section: paths of cross compiling environment
#
# you can set the following variables here:
#  crossprefix: prefix for cross compiling binaries; default: $(DEB_HOST_GNU_SYSTEM)-
#  crossbase  : base prefix for the following; default: /usr
#  crossdir   : base directory for architecture; default:
#               $(CROSSBASE)/$(DEB_HOST_GNU_TYPE)
#  crossbin   : dir for binaries; default: $(CROSSDIR)/bin
#  crosslib   : dir for libraries; default: $(CROSSDIR)/lib
#  crossinc   : dir for headers; default: $(CROSSDIR)/include
#  maintainer : maintainer name to pass to original dpkg-buildpackage
#               in -m option. If not set at all, don't pass a -m, thus
#               dpkg-buildpackage will use the name from the changelog
#               file. If set to the special string CURRENTUSER,
#               dpkg-buildpackage will use the name from the
#               changelog, too, but signing the .changes will be done
#               as the current user (default key).
#  removedeps : comma-separated list of package names that should be removed
#               from depends/conflicts/etc fields
#  keepdeps   : comma-separated list of package names that should be kept
#               in depends/conflicts/etc fields as is, without adding
#               -arch-cross.
#
# In preparation for merging dpkg-cross into dpkg, the previous
# defaults have been removed.

- -- System Information:
Debian Release: squeeze/sid
  APT prefers natty
  APT policy: (999, 'natty')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38-7-generic (SMP w/4 CPU cores)
Locale: LANG=pl_PL.utf8, LC_CTYPE=pl_PL.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages dpkg-cross depends on:
ii  debconf [debconf-2.0]   1.5.36ubuntu4    Debian configuration management sy
ii  dpkg-dev                1.16.0~ubuntu6   Debian package development tools
ii  libconfig-auto-perl     0.20-2           Magical config file parser
ii  libdebian-dpkgcross-per 2.6.3ubuntu1     functions to aid cross-compiling D
ii  perl                    5.10.1-17ubuntu3 Larry Wall's Practical Extraction 

Versions of packages dpkg-cross recommends:
ii  fakeroot                 1.14.4-1ubuntu1 Gives a fake root environment

Versions of packages dpkg-cross suggests:
ii  binutils-multia 2.21.0.20110322-1ubuntu1 Binary utilities that support mult

- -- debconf information:
  dpkg-cross/default-arch: None

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk2KEToACgkQeQ6MlGH/2quYngCfYp1ZT44SjXmj3X2Kwp+IYGB9
AwQAn2iZHPk+DuRby91TFEzMVeGdSf8A
=kVUV
-----END PGP SIGNATURE-----
[dpkg-cross.diff (text/x-diff, attachment)]

Bug Marked as found in versions dpkg-cross/2.6.2. Request was from Neil Williams <codehelp@debian.org> to control@bugs.debian.org. (Wed, 23 Mar 2011 15:33:05 GMT) Full text and rfc822 format available.

Bug No longer marked as found in versions 2.6.3ubuntu1. Request was from Neil Williams <codehelp@debian.org> to control@bugs.debian.org. (Wed, 23 Mar 2011 15:36:04 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#619400; Package dpkg-cross. (Wed, 23 Mar 2011 17:27:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Wed, 23 Mar 2011 17:27:03 GMT) Full text and rfc822 format available.

Message #14 received at 619400@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: Steve Langasek <steve.langasek@linaro.org>
Cc: 739151@bugs.launchpad.net, debian-embedded@lists.debian.org, 619400@bugs.debian.org
Subject: Re: [Bug 739151] Re: [PATCH] dpkg-cross: handle multi-arch packages too
Date: Wed, 23 Mar 2011 17:23:09 +0000
[Message part 1 (text/plain, inline)]
On Wed, 23 Mar 2011 09:39:04 -0700
Steve Langasek <steve.langasek@linaro.org> wrote:

> Hi Neil,
> 
> On Wed, Mar 23, 2011 at 02:55:07PM -0000, Neil Williams wrote:
> > On Wed, 23 Mar 2011 15:37:34 +0100
> > Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> wrote:
> 
> > > Ubuntu 'natty' switched to multiarch recently and my cross toolchain
> > > packages started to fail to build. Most of problems were fixed but then
> > > dpkg-cross hit us.
> 
> > > Today I looked at dpkg-cross and made attached patch to handle problem.
> > > What patch does is converting multiarch packages into old style ones.
> 
> > Are you sure you want to convert Multi-Arch paths to the old paths?
> 
> In a word: yes.  As long as we need dpkg-cross to do anything with
> Multi-Arch: same packages, the thing we need them to do is to convert them
> over to the old paths.

It wasn't initially clear that this was a temporary hack to get through
the transition. I'd hate to see this kind of support being used once
Multi-Arch-Cross is working and the toolchain is all done etc. As well
as removing dpkg-cross from the archive, there may need to be a package
which Conflicts: with it or certain cross-builds could Build-Conflict
with it. Yet it's the -cross packages that are the problem, if such a
problem actually exists.

There never was a good way of removing all -cross packages in one go -
I wrote emprunecross but it's reliant on detailed knowledge of the
toolchain.

We do have the dpkg-cross compatibility variable:

Provides: libgtk2.0-dev-armel-dcv1

Can't see that this would really help in this case, until we decide
that the transition is over but that would then need another upload of
the Multi-Arch package to conflict with the -dcv1 version but that
means adding one conflict for each arch.

Looks like this is just something else for each cross-building
developer to have to handle themselves. Current tools (like synaptic
and aptitude) do list all these cross packages in the "local or
obsolete" but there's other stuff in that list too.

> So since a developer might want to have both libc6-armel-cross and
> libc6:armel installed at the same time during the transition, the files
> still need to be moved around.
> 
> > The expected role for dpkg-cross once Multi-Arch started to be deployed
> > was only in putting non-Multi-Arch packages into old paths, letting the
> > toolchain find the other packages in their normal Multi-Arch paths.
> 
> This was also what I expected when viewing the matter from 10,000 feet.  Now
> that we're closer to the ground, I see that more involvement is still needed
> from dpkg-cross during the transition.

:-) Glad to know I hadn't misunderstood the final objective....
 
> It's not that the toolchain can't find the packages, it's that for
> bootstrapping toolchains into the archive we need to generate an installable
> libc6-armel-cross and libc6-dev-armel-cross package - and these packages
> should not use the multiarch paths, because the *real multiarch packages*
> want to use those. :)

I'll sort this out in dpkg-cross 2.6.3 this weekend.

-- 


Neil Williams
=============
http://www.linux.codehelp.co.uk/

[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#619400; Package dpkg-cross. (Fri, 25 Mar 2011 15:45:10 GMT) Full text and rfc822 format available.

Acknowledgement sent to Wookey <wookey@wookware.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Fri, 25 Mar 2011 15:45:10 GMT) Full text and rfc822 format available.

Message #19 received at 619400@bugs.debian.org (full text, mbox):

From: Wookey <wookey@wookware.org>
To: 619400@bugs.debian.org
Subject: patch providing support for dpkg-crossing multiarch packages
Date: Fri, 25 Mar 2011 15:40:33 +0000
It has become clear that dpkg-cross need to be able to cross multiarch
packages as well as conventional ones. This is because we cannot yet
have cross-arch dependencies to let us simply depend on necessary
cross-libraries, and an arch all package (such as dpkg-cross makes)
cannot install files in the multiarch /usr/lib/<triplet> location
according to multiarch policy (because they could clash with the files
from the real architecture).

This was not really on the roadmap, where we simple expected to be
able to use multiarch packages for crossing-aginst as-is, but we're
not quite there yet.

Here is a patch to provide that functionality without being too hacky.

It also removes all the X11R6 directory special-casing as that is long-gone. 

dpkg-cross will not convert a multiarch package unless
--convert-multiarch is passed to force it to do so. 

It is possible there are still missing fixups needed in pkgconfig and
.la fixup functions, but I've not found any in the tests I've done so
far. 

This has been tested against these ubuntu natty packages:
Multi-Arch:
libc6_2.13-0ubuntu8_amd64.deb 
libc6-dev_2.13-0ubuntu8_amd64.deb
libfreetype6_2.4.4-1ubuntu2_amd64.deb
libfreetype6-dev-2.4.4-1ubuntu2_all.deb (note: this package is not right
because it is not marked Multi-Arch but has its files in multiarch locations 
- this breaks dpkg-cross's behaviour and some files are missed out. I
think that's OK.)

pre-multiarch:
libc6_2.13-0ubuntu1_amd64.deb
libc6-dev_2.13-0ubuntu1_amd64.deb 
libfreetype6_2.4.4-1_amd64.deb 
libfreetype6-dev_2.4.4-1_amd64.deb 


Index: dpkg-cross
===================================================================
RCS file: /cvsroot/dpkg-cross/dpkg-cross/dpkg-cross,v
retrieving revision 1.83
diff -u -r1.83 dpkg-cross
--- dpkg-cross	23 Feb 2011 14:46:33 -0000	1.83
+++ dpkg-cross	25 Mar 2011 15:37:06 -0000
@@ -14,7 +14,7 @@
 @keepdeps $dpkg_statfile $progname $debname $anyway $cross2cross
 $crossdir $crosslib $crosslib64 $crosslib32 $crossinc $data $len
 $retval $dpkg_cmd $mode $pkg @exlist $conffile $removedeps $keepdeps
-$DPKGCROSSVERSION $keep_temp $msg );
+$DPKGCROSSVERSION $keep_temp $msg $multiarchpackage $multiarch $multiarchconv);
 
 setlocale(LC_MESSAGES, "");
 textdomain("dpkg-cross");
@@ -262,14 +262,15 @@
  -?|-h|--help|--version: print this message.
 
 Options:
- -a|--arch ARCH:       set architecture (default: defined in configuration file)
- -v|--verbose:         be verbose
- -q|--quiet:           be quiet
- -A|--convert-anyway:  convert package even if it does not provide any
-                       development files
- -X|--exclude PACKAGE: Exclude this package from the dependency list of the
-                       built package.
- -k|--keep-temp:       Keep the temporary archives when installing.
+ -a|--arch ARCH:         set architecture (default: defined in configuration file)
+ -v|--verbose:           be verbose
+ -q|--quiet:             be quiet
+ -A|--convert-anyway:    convert package even if it does not provide any
+                         development files
+ -M|--convert-multiarch: convert package even if it is a multiarch package
+ -X|--exclude PACKAGE:   Exclude this package from the dependency list of the
+                         built package.
+ -k|--keep-temp:         Keep the temporary archives when installing.
 
 dpkg-cross installs or removes libraries and include files for
 cross-compiling Debian packages. It reads /etc/dpkg-cross/cross-compile
@@ -334,6 +335,8 @@
 		push @removedeps, $pkg;
 	} elsif (/^(-A|--convert-anyway)$/) {
 		$anyway = 1;
+	} elsif (/^(-A|--convert-multiarch)$/) {
+		$multiarchconv = 1;
 	} else {
 		die sprintf (_g("%s: Unknown option %s.\n"), $progname, $_);
 	}
@@ -507,18 +510,24 @@
 	}
 	close(CONTROL);
 
-	if (defined ($control{'multi-arch'})) {
-		my $output = basename ($package);
-		warn sprintf(_g("%s: Skipping the '%s' Multi-Arch package.\n"), $progname, $output);
-		if (not -f $output) {
-			open(CP, "$package");
-			my @cp=<CP>;
-			close (CP);
-			open (CP, ">$output");
-			print CP @cp;
-			close (CP);
+        if (defined ($control{'multi-arch'})) {
+		if ($multiarchconv) {
+			# Carry on and process file anyway if --convert-multiarch given
+			warn sprintf(_g("%s: Multi-Arch package detected; processing anyway as --convert-mulitarch specified.\n"), $progname);
+			$multiarchpackage=1;
+		} else {
+			my $output = basename ($package);
+			warn sprintf(_g("%s: Skipping the '%s' Multi-Arch package.\n"), $progname, $output);
+			if (not -f $output) {
+				open(CP, "$package");
+				my @cp=<CP>;
+				close (CP);
+				open (CP, ">$output");
+				print CP @cp;
+				close (CP);
+			}
+			exit 0;
 		}
-		exit 0;
 	}
 	# check for existence of required fields
 	for $field (qw(package version architecture)) {
@@ -548,7 +557,7 @@
 	# prepare destination filename
 	my $evers = $control{"version"};
 	$evers =~ s/^\d+://;		 # strip epoch for filename
-    $debname = $control{"package"} . "-" . $arch . "-cross_" . $evers . "_all.deb";
+	$debname = $control{"package"} . "-" . $arch . "-cross_" . $evers . "_all.deb";
 
 	# now ready to start preparing destination package
 
@@ -602,6 +611,7 @@
 
 	# Helper: fix ldscript.
 	# Change any occurance of /lib, /usr/lib and /usr/X11R6/lib to $crosslib
+	# Uses global $multiarch regexp modifier
 	sub fix_ldscript {
 		my ($from, $to) = @_;
 		ensure_dir($to) or return 0;
@@ -617,7 +627,7 @@
 			return 0;
 		}
 		while (<FROM>) {
-			s:(^|[^-\w/])(/usr(/X11R6)?)?/lib:$1$crosslib:g;
+			s:(^|[^-\w/])(/usr)?/lib/$multiarch:$1$crosslib/:g;
 			print TO;
 		}
 		close(FROM);
@@ -713,6 +723,8 @@
 	$crosslib = $$config{'crosslib'};
 	$crosslib64 = $$config{'crosslib64'};
 	$crosslib32 = $$config{'crosslib32'};
+	# add extra regexp component for multiarch packages
+	if ($multiarchpackage) { $multiarch="\Q$crosstype/\E" } else {$multiarch=""};
 
 	# Now process regular files ...
 	open(PIPE, "find $src/ -type f -print |") or goto fail;
@@ -757,26 +769,26 @@
 			}
 			close(FROM);
 			close(TO);
-		} elsif (m:^/usr(/X11R6)?/include/:) {
-			# regular file under /usr/include or /usr/X11R6/include
+		} elsif (m:^/usr/include/($multiarch)?:) {
+			# regular file under /usr/include/ or /usr/include/<triplet>
 			link_file("$src$_", "$dst$crossinc/$'") or goto fail;
-		} elsif (m:^/usr/(lib/.*\.([hH]|[hH][hH]|[hH][pP][pP]))$:) {
+		} elsif (m:^/usr/(lib/$multiarch.*\.([hH]|[hH][hH]|[hH][pP][pP]))$:) {
 			# regular .h, .hh, or .hpp file under /usr/lib
 			link_file("$src$_", "$dst$crossdir/$1") or goto fail;
-		} elsif (m:^/usr(/X11R6)?/lib/([^/]+\.[ao])$:) {
-			# regular .a or .o file under /usr/lib or /usr/X11R6/lib
-			link_file("$src$_", "$dst$crosslib/$2") or goto fail;
-		} elsif (m:^/usr(/X11R6)?/lib64/([^/]+\.[ao])$:) {
-			# regular .a or .o file under /usr/lib64 or /usr/X11R6/lib64
-			link_file("$src$_", "$dst$crosslib64/$2") or goto fail;
-		} elsif (m:^/usr(/X11R6)?/lib32/([^/]+\.[ao])$:) {
-			# regular .a or .o file under /usr/lib32 or /usr/X11R6/lib32
-			link_file("$src$_", "$dst$crosslib32/$2") or goto fail;
+		} elsif (m:^/usr/lib/$multiarch([^/]+\.[ao])$:) {
+			# regular .a or .o file under /usr/lib
+			link_file("$src$_", "$dst$crosslib/$1") or goto fail;
+		} elsif (m:^/usr/lib64/([^/]+\.[ao])$:) {
+			# regular .a or .o file under /usr/lib64
+			link_file("$src$_", "$dst$crosslib64/$1") or goto fail;
+		} elsif (m:^/usr/lib32/([^/]+\.[ao])$:) {
+			# regular .a or .o file under /usr/lib32
+			link_file("$src$_", "$dst$crosslib32/$1") or goto fail;
 		} 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(/X11R6)?)?/lib/([^/]+\.so[^/]*)$:) {
-			# regular .so* file under /lib, /usr/lib or /usr/X11R6/lib
+		} elsif (m:^(/usr)?/lib/($multiarch)?([^/]+\.so[^/]*)$:) {
+			# regular .so* file under /lib, /usr/lib, /lib/<triplet>, /usr/lib/<triplet>
 			if (is_ldscript("$src$_")) {
 				fix_ldscript("$src$_", "$dst$crosslib/$3") or goto fail;
 			} else {
@@ -789,19 +801,19 @@
 			} else {
 				next;
 			}
-		} elsif (m:^(/usr(/X11R6)?)?/lib64/([^/]+\.so[^/]*)$:) {
-			# regular .so* file under /lib64, /usr/lib64 or /usr/X11R6/lib64
+		} elsif (m:^(/usr)?/lib64/([^/]+\.so[^/]*)$:) {
+			# regular .so* file under /lib64, /usr/lib64
 			if (is_ldscript("$src$_")) {
-				fix_ldscript("$src$_", "$dst$crosslib64/$3") or goto fail;
+				fix_ldscript("$src$_", "$dst$crosslib64/$2") or goto fail;
 			} else {
-				link_file("$src$_", "$dst$crosslib64/$3") or goto fail;
+				link_file("$src$_", "$dst$crosslib64/$2") or goto fail;
 			}
-		} elsif (m:^(/usr(/X11R6)?)?/lib32/([^/]+\.so[^/]*)$:) {
-			# regular .so* file under /lib32, /usr/lib32 or /usr/X11R6/lib32
+		} elsif (m:^(/usr)?/lib32/([^/]+\.so[^/]*)$:) {
+			# regular .so* file under /lib32, /usr/lib32
 			if (is_ldscript("$src$_")) {
-				fix_ldscript("$src$_", "$dst$crosslib32/$3") or goto fail;
+				fix_ldscript("$src$_", "$dst$crosslib32/$2") or goto fail;
 			} else {
-				link_file("$src$_", "$dst$crosslib32/$3") or goto fail;
+				link_file("$src$_", "$dst$crosslib32/$2") or goto fail;
 			}
 		} elsif ((m:^/emul/ia32-linux/usr/lib/([^/]+\.so[^/]*)$:)) {
 			# regular .so* file under /emul/ia32-linux/usr/lib
@@ -810,19 +822,19 @@
 			} else {
 				link_file("$src$_", "$dst$crosslib32/$1") or goto fail;
 			}
-		} elsif (m:^/usr(/X11R6)?/lib/([^/]+\.la)$:) {
-			# regular .la file under /usr/lib or /usr/X11R6/lib
-			fix_la_file("$src$_", "$dst$crosslib/$2", $crosslib) or goto fail;
-		} elsif (m:^/usr(/X11R6)?/lib64/([^/]+\.la)$:) {
-			# regular .la file under /usr/lib64 or /usr/X11R6/lib64
-			fix_la_file("$src$_", "$dst$crosslib64/$2", $crosslib64) or goto fail;
-		} elsif (m:^/usr(/X11R6)?/lib32/([^/]+\.la)$:) {
-			# regular .la file under /usr/lib32 or /usr/X11R6/lib32
-			fix_la_file("$src$_", "$dst$crosslib32/$2", $crosslib32) or goto fail;
+		} elsif (m:^/usr/lib/$multiarch([^/]+\.la)$:) {
+			# regular .la file under /usr/lib
+			fix_la_file("$src$_", "$dst$crosslib/$1", $crosslib) or goto fail;
+		} elsif (m:^/usr/lib64/([^/]+\.la)$:) {
+			# regular .la file under /usr/lib64
+			fix_la_file("$src$_", "$dst$crosslib64/$1", $crosslib64) or goto fail;
+		} elsif (m:^/usr/lib32/([^/]+\.la)$:) {
+			# regular .la file under /usr/lib32
+			fix_la_file("$src$_", "$dst$crosslib32/$1", $crosslib32) or goto fail;
 		} elsif ((m:^/emul/ia32-linux/usr/lib/([^/]+\.la)$:)) {
 			# regular .la file under /emul-ia32-linux/usr/lib/
 			fix_la_file("$src$_", "$dst$crosslib32/$1", $crosslib32) or goto fail;
-		} elsif (m:/usr/lib/(pkgconfig/[^/]+.pc)$:) {
+		} elsif (m:/usr/lib/$multiarch(pkgconfig/[^/]+.pc)$:) {
 			# regular .pc file in /usr/lib/pkgconfig
 			fix_pc_file("$src$_", "$dst$crosslib/$1") or goto fail;
 			# not for lib64: I don't know if there is any rationale
@@ -876,7 +888,7 @@
 	while(<PIPE>) {
 		chomp;
 		s/^$src//;
-		# Ignore any symlinks not under /usr or /lib or /lib64
+		# Ignore any symlinks not under /usr or /lib or /lib64 (or /emul/ia32-linux)
 		m:^/(usr|lib|lib64|emul/ia32-linux): or next;
 		next if (m:^/usr/\w+-\w+(-\w+(-\w+)?)?/: && !$cross2cross);
 		# Find out (absolute) symlink destination
@@ -885,11 +897,12 @@
 			m:^(.*)/[^/]*$:;
 			$lv = "$1/$lv";
 		}
-		# Ignore any symlinks pointing outside /usr and /lib and /lib64
+		# Ignore any symlinks pointing outside /usr and /lib and /lib64 (or /emul/ia32-linux)
 		$lv =~ m:^/(usr|lib|lib64|emul/ia32-linux): or next;
 
+	        
 		# Calculate corresponding DESTINATION path
-		$lv = convert_path($lv);
+		$lv = convert_path($multiarch,$lv);
 
 		# Check if destination object exists.
 		# FIXME: this code is not correct for the case of symlink chains.
@@ -903,7 +916,7 @@
 		}
 
 		# Calculate corresponding SOURCE path
-		$_ = convert_path($_);
+		$_ = convert_path($multiarch,$_);
 
 		# Skip links that are going to point to themselves
 		# Example is /usr/include/X11 -> ../X11R6/include/X11:
@@ -1267,9 +1280,14 @@
 
 =head1 Multiarch behaviour
 
-C<dpkg-cross> now does nothing with packages from Debian which already
+By default <dpkg-cross> does nothing with packages from Debian which already
 support Multi-Arch - the package is simply copied to the current work
-directory, if it does not already exist.
+directory, if it does not already exist. Any package containing a Multi-Arch: 
+field in DEBIAN/control is skipped in this manner.
+
+--convert-multiarch can be specified to instead force the generation of a 
+-<arch>-cross package with the files moved into the conventional 
+dpkg-cross locations.
 
 The Multiarch spec ensures that multiarch packages will only be
 available from Debian mirrors once dpkg itself is capable of installing
@@ -1280,7 +1298,5 @@
 multiarch package itself handles the header files and pkg-config
 files.)
 
-Any package containing a Multi-Arch: field in DEBIAN/control is skipped
-in this manner.
 
 =cut
Index: Debian/DpkgCross.pm
===================================================================
RCS file: /cvsroot/dpkg-cross/dpkg-cross/Debian/DpkgCross.pm,v
retrieving revision 1.51
diff -u -r1.51 DpkgCross.pm
--- Debian/DpkgCross.pm	23 Feb 2011 14:46:35 -0000	1.51
+++ Debian/DpkgCross.pm	25 Mar 2011 15:37:06 -0000
@@ -437,29 +437,31 @@
 	return $dir;
 }
 
-=head1 convert_path($path)
+=head1 convert_path($multiarch, $path)
 
 Convert path, substituting '$crossinc', '$crosslib', '$crosslib64',
-'$crosslib32', '$crossdir'. This function will be used while building foreign
-binary packages or converting GCC options.
+'$crosslib32', '$crossdir', allowing for multiarch paths. This function will 
+be used while building foreign binary packages or converting GCC options.
 
- $1: Directory (and file) to convert.
+ $1: Multiarch sub-directory to strip
+ $2: Directory (and file) to convert.
 
 return: Converted path.
 
 =cut
 
 sub convert_path {
-	my $path = &simplify_path ($_[0]);
-	if ($path =~ /^\/usr(\/X11R6)?\/include\//) {
+	my $multiarch = $_[0];
+        my $path = &simplify_path ($_[1]);
+	if ($path =~ /^\/usr\/include\/($multiarch)?/) {
 		$path = "$crossinc/$'";
-	} elsif ($path =~ /^(\/usr(\/X11R6)?)?\/lib\//) {
+	} elsif ($path =~ /^(\/usr)?\/lib\/($multiarch)?/) {
 		$path = "$crosslib/$'";
-	} elsif ($path =~ /^(\/usr(\/X11R6)?)?\/lib64\//) {
+	} elsif ($path =~ /^(\/usr)?\/lib64\/($multiarch)?/) {
 		$path = "$crosslib64/$'";
-	} elsif ($path =~ /^(\/usr(\/X11R6)?)?\/lib32\//) {
+	} elsif ($path =~ /^(\/usr)?\/lib32\/($multiarch)?/) {
 		$path = "$crosslib32/$'";
-	} elsif ($path =~ m:^(/emul/ia32-linux/(usr/)?lib/):) {
+	} elsif ($path =~ m:^(/emul/ia32-linux/(usr/)?lib/($multiarch)?):) {
 		$path = "$crosslib32/$'";
 	} elsif ($path =~ /^\/usr\/\w+-\w+(-\w+(-\w+)?)?\//) {
 		# leave alone
Index: debian/changelog
===================================================================
RCS file: /cvsroot/dpkg-cross/dpkg-cross/debian/changelog,v
retrieving revision 1.213
diff -u -r1.213 changelog
--- debian/changelog	23 Feb 2011 14:46:36 -0000	1.213
+++ debian/changelog	25 Mar 2011 15:37:06 -0000
@@ -1,8 +1,14 @@
 dpkg-cross (2.6.3) unstable; urgency=low
 
+  [ Neil Williams ]
   * Drop old apt-cross multiarch behaviour - outdated.
 
- -- Neil Williams <codehelp@debian.org>  Wed, 23 Feb 2011 13:54:27 +0000
+  [ Wookey ]
+  * Add (interim) --convert-multiarch behaviour to cross even
+    multiarch packages (Closes: #619400)
+  * Drop X11R6 lib/include dirs as they are no longer present
+
+ -- Wookey <wookey@debian.org>  Fri, 25 Mar 2011 03:53:24 +0000
 
 dpkg-cross (2.6.2) unstable; urgency=low
 

Wookey
-- 
Principal hats:  Linaro, Emdebian, Wookware, Balloonboard, ARM
http://wookware.org/




Added tag(s) pending. Request was from Neil Williams <codehelp@debian.org> to control@bugs.debian.org. (Sat, 26 Mar 2011 13:51:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#619400; Package dpkg-cross. (Wed, 30 Mar 2011 13:27:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Wookey <wookey@wookware.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Wed, 30 Mar 2011 13:27:07 GMT) Full text and rfc822 format available.

Message #26 received at 619400@bugs.debian.org (full text, mbox):

From: Wookey <wookey@wookware.org>
To: 619400@bugs.debian.org
Subject: patch providing support for
Date: Wed, 30 Mar 2011 13:43:43 +0100
This patch allows dpkg-cross to handle packages which use multiarch
paths for libraries but are not yet marked co-installable with
Multi-Arch: field.

Index: dpkg-cross
===================================================================
RCS file: /cvsroot/dpkg-cross/dpkg-cross/dpkg-cross,v
retrieving revision 1.86
diff -u -r1.86 dpkg-cross
--- dpkg-cross	26 Mar 2011 13:43:41 -0000	1.86
+++ dpkg-cross	30 Mar 2011 12:32:41 -0000
@@ -55,12 +55,19 @@
 
 =head1 SYNOPSIS
 
- dpkg-cross [ -v | --verbose ] [ -q | --quiet ] [ -A | --convert-anyway ]
- [ -X | --exclude PACKAGE ] [ -k | --keep-temp ] { -i | --install 
- | -b | --build | -r | --remove | --purge | -s | --status | -l | --list 
- | -L | --list-files | -u | --update | -Q | --query } 
- { -a | --arch architecture} package [package ... ]
-
+ dpkg-cross [OPTIONS] [--install|-i] <files...>
+ dpkg-cross [OPTIONS] [--build|-b] <files...>
+ dpkg-cross [OPTIONS] [--remove|--purge|-r] <packages...>
+ dpkg-cross [OPTIONS] [--status|-s] <packages...>
+ dpkg-cross [OPTIONS] [--list|-l] <packages...>
+ dpkg-cross [OPTIONS] [--list-files|-L] <packages...>
+ dpkg-cross [OPTIONS] [--query|-Q] <pkgpath>
+ dpkg-cross [OPTIONS] [--update|-u] <pkgpath>
+ 
+ OPTIONS: [ -v | --verbose ] [ -q | --quiet ] 
+ { [ -a | --arch ] architecture } { [ -X | --exclude ] PACKAGE } 
+ [ -A | --convert-anyway ] [ -M | --convert-multiarch ]  [ -k | --keep-temp ] 
+ 
 =cut
 
 =head1 DESCRIPTION
@@ -522,7 +529,7 @@
 			$multiarchpackage=1;
 		} else {
 			my $output = basename ($package);
-			warn sprintf(_g("%s: Skipping the '%s' Multi-Arch package.\n"), $progname, $output);
+			warn sprintf(_g("%s: Skipping Multi-Arch package '%s'.\n"), $progname, $output);
 			if (not -f $output) {
 				open(CP, "$package");
 				my @cp=<CP>;
@@ -737,6 +744,10 @@
 		chomp;
 		s/^$src//;
 		/^DEBIAN/ && next;
+		# if we have library files on multiarch paths, treat deb like a multiarch package
+		if (m:^(/usr)?/lib/\Q$crosstype/\E:) { 
+			$multiarch="\Q$crosstype/\E"
+			}
 		# special support for generated cache data
 		if (m:(/etc/dpkg-cross/cross-config.d/($arch)?/.*):) {
 			&ensure_dir("$dst$1");
@@ -778,10 +789,10 @@
 			# regular file under /usr/include/ or /usr/include/<triplet>
 			link_file("$src$_", "$dst$crossinc/$'") or goto fail;
 		} elsif (m:^/usr/(lib/$multiarch.*\.([hH]|[hH][hH]|[hH][pP][pP]))$:) {
-			# regular .h, .hh, or .hpp file under /usr/lib
+			# regular .h, .hh, or .hpp file under /usr/lib or /usr/lib/<triplet>
 			link_file("$src$_", "$dst$crossdir/$1") or goto fail;
 		} elsif (m:^/usr/lib/$multiarch([^/]+\.[ao])$:) {
-			# regular .a or .o file under /usr/lib
+			# regular .a or .o file under /usr/lib or /usr/lib/<triplet>
 			link_file("$src$_", "$dst$crosslib/$1") or goto fail;
 		} elsif (m:^/usr/lib64/([^/]+\.[ao])$:) {
 			# regular .a or .o file under /usr/lib64

	
Wookey
-- 
Principal hats:  Linaro, Emdebian, Wookware, Balloonboard, ARM
http://wookware.org/




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#619400; Package dpkg-cross. (Fri, 01 Apr 2011 10:00:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. (Fri, 01 Apr 2011 10:00:03 GMT) Full text and rfc822 format available.

Message #31 received at 619400@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 619400@bugs.debian.org
Cc: 619400-submitter@bugs.debian.org
Subject: patch needs more work
Date: Fri, 1 Apr 2011 10:56:55 +0100
[Message part 1 (text/plain, inline)]
The updated patch still isn't right. I can't upload 2.6.3 as-is. The
patched script misses files like:

/usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h

in libglib2.0-dev for natty. It ends up as 

/usr/arm-linux-gnueabi/lib/arm-linux-gnueabi/glib-2.0/include/glibconfig.h

If I force the file into the right place my test package cross-builds
in natty (libhandoff) as long as I also work around the lack of updated
pkg-config by using the PKG_CONFIG_LIBDIR hack. I'll have a look at
dpkg-cross this weekend hopefully, but it'll also need changes in xapt 

-- 


Neil Williams
=============
http://www.linux.codehelp.co.uk/

[Message part 2 (application/pgp-signature, inline)]

Message sent on to Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>:
Bug#619400. (Fri, 01 Apr 2011 10:00:05 GMT) Full text and rfc822 format available.

Reply sent to Neil Williams <codehelp@debian.org>:
You have taken responsibility. (Sat, 02 Apr 2011 13:36:14 GMT) Full text and rfc822 format available.

Notification sent to Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>:
Bug acknowledged by developer. (Sat, 02 Apr 2011 13:36:14 GMT) Full text and rfc822 format available.

Message #39 received at 619400-close@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 619400-close@bugs.debian.org
Subject: Bug#619400: fixed in dpkg-cross 2.6.3
Date: Sat, 02 Apr 2011 13:32:19 +0000
Source: dpkg-cross
Source-Version: 2.6.3

We believe that the bug you reported is fixed in the latest version of
dpkg-cross, which is due to be installed in the Debian FTP archive:

dpkg-cross_2.6.3.dsc
  to main/d/dpkg-cross/dpkg-cross_2.6.3.dsc
dpkg-cross_2.6.3.tar.gz
  to main/d/dpkg-cross/dpkg-cross_2.6.3.tar.gz
dpkg-cross_2.6.3_all.deb
  to main/d/dpkg-cross/dpkg-cross_2.6.3_all.deb
libdebian-dpkgcross-perl_2.6.3_all.deb
  to main/d/dpkg-cross/libdebian-dpkgcross-perl_2.6.3_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 619400@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Neil Williams <codehelp@debian.org> (supplier of updated dpkg-cross package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Fri, 01 Apr 2011 19:54:09 +0100
Source: dpkg-cross
Binary: dpkg-cross libdebian-dpkgcross-perl
Architecture: source all
Version: 2.6.3
Distribution: unstable
Urgency: low
Maintainer: Debian Embedded Group <debian-embedded@lists.debian.org>
Changed-By: Neil Williams <codehelp@debian.org>
Description: 
 dpkg-cross - tools for cross compiling Debian packages
 libdebian-dpkgcross-perl - functions to aid cross-compiling Debian packages
Closes: 618488 618490 619400
Changes: 
 dpkg-cross (2.6.3) unstable; urgency=low
 .
   [ Neil Williams ]
   * Drop old apt-cross multiarch behaviour - outdated.
 .
   [ Wookey ]
   * Add (interim) --convert-multiarch behaviour to cross even
     multiarch packages (Closes: #619400)
   * Drop X11R6 lib/include dirs as they are no longer present
 .
   [ Neil Williams ]
   * Drop unsupported variables from config file
   * Correct the value for libIDL_cv_long_long_format in /etc/dpkg-
     cross/cross-config.cache. (Closes: #618488)
   * Add tclconfig.sh to the list of interesting files for
     cross-building. (Closes: #618490)
   * Fix some unitialised variables in rarely used -Q option dpkg-cross
   * Fix handling of arch-dependent include headers under multi-arch only
     support.
Checksums-Sha1: 
 71f3be23798c7adda09762cab5dbfcc27eb9ee4b 1209 dpkg-cross_2.6.3.dsc
 ebb38972a7804d2a835840ce1afba1689b56be98 75766 dpkg-cross_2.6.3.tar.gz
 c5c8a1e8bd28cec8aa0e36f22b938595d3b50e4a 53116 dpkg-cross_2.6.3_all.deb
 954dd8f37d8c5e86abe2cd820ab1f4ca63502079 28976 libdebian-dpkgcross-perl_2.6.3_all.deb
Checksums-Sha256: 
 d512982fe4109d8f2d1625f185ad434f679cd6d62543c70c2bae5fc66ad84dad 1209 dpkg-cross_2.6.3.dsc
 72694dbd761ac0cce64c00a2cfe3a720f34060450b86303739dcea253f3f21f6 75766 dpkg-cross_2.6.3.tar.gz
 6f8a62ffeba1569abfa797fde759bac9472c3be48766e375af61c085795bc25f 53116 dpkg-cross_2.6.3_all.deb
 5cdc2e627cfc0f94287237ce21ca89573899cf80260e61193d06be1d7d393e57 28976 libdebian-dpkgcross-perl_2.6.3_all.deb
Files: 
 47e9efeeaa780d70892d71e99758a645 1209 utils extra dpkg-cross_2.6.3.dsc
 97f6c922f09f10086a38ba8ff6967af0 75766 utils extra dpkg-cross_2.6.3.tar.gz
 4a0aed4bfaa9f969ae9c7ca5a5fe0197 53116 utils extra dpkg-cross_2.6.3_all.deb
 5cc039f8e0c2aa5e4dce61cc10cfbd76 28976 perl extra libdebian-dpkgcross-perl_2.6.3_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk2XIcwACgkQiAEJSii8s+O4DQCeOVq1d8mtyU95bWtaiRK7Ar+9
AtYAn2YCxwqPAYZqrz0VWXwtyVwGHXpW
=Vip2
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Wed, 11 May 2011 07:31:07 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 02:44:30 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.