[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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



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-----
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	23 Mar 2011 14:32:35 -0000
@@ -507,7 +507,7 @@
 	}
 	close(CONTROL);
 
-	if (defined ($control{'multi-arch'})) {
+	if (defined ($control{'multi-arch'}) and !$anyway) {
 		my $output = basename ($package);
 		warn sprintf(_g("%s: Skipping the '%s' Multi-Arch package.\n"), $progname, $output);
 		if (not -f $output) {
@@ -775,6 +775,16 @@
 		} 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)?/lib/$crosstype/([^/]+\.[ao])$:) {
+			# regular .a or .o file under /lib or /usr/lib/TRIPLET/
+			link_file("$src$_", "$dst$crosslib/$crosstype/$2") or goto fail;
+		} elsif (m:^(/usr)?/lib/$crosstype/([^/]+\.so[^/]*)$:) {
+			# regular .so* file under /lib/TRIPLET or /usr/lib/TRIPLET 
+			if (is_ldscript("$src$_")) {
+				fix_ldscript("$src$_", "$dst$crosslib/$crosstype/$2") or goto fail;
+			} else {
+				link_file("$src$_", "$dst$crosslib/$crosstype/$2") or goto fail;
+			}
 		} elsif (m:^(/usr(/X11R6)?)?/lib/([^/]+\.so[^/]*)$:) {
 			# regular .so* file under /lib, /usr/lib or /usr/X11R6/lib
 			if (is_ldscript("$src$_")) {
@@ -914,7 +924,18 @@
 		# useful or packaged in the -cross package, basically anything
 		# in a directory beneath /usr/lib/. See #499292
 		# except pkgconfig symlinks, see #506956
-		next if (($lv =~ m:$crosslib/.*/:) and ($lv !~ m:$crosslib/pkgconfig/:));
+		# also handle multiarch packages with /usr/lib/TRIPLET/ directory
+		next if (
+		    (
+			($lv =~ m:$crosslib/$crosstype/.*/:) and 
+			($lv !~ m:$crosslib/$crosstype/pkgconfig/:)
+		    ) or
+		    (
+			($lv =~ m:$crosslib/.*/:) and 
+			($lv !~ m:$crosslib/pkgconfig/:) and
+			($lv !~ m:$crosslib/$crosstype/:) 
+		    )
+		);
 		$lv =~ m:$crosslib/(.*)$:;
 		# Translators, retain the -> to indicate the direction of the link.
 		printf (_g("Creating symlink %s -> %s\n"), $_, $1) if ($verbose >= 2);

Reply to: