The following commit has been merged in the master branch:
commit 9c523dd9ec83b600b96ed1ab4f346b56929d2cfa
Author: Raphaël Hertzog <[email protected]>
Date:   Wed Oct 12 10:20:00 2011 +0200

    Dpkg::Shlibs: look into multi-arch paths when cross-building
    
    The need for this was discovered when trying to bootstrap a
    cross-toolchain against a multiarchified eglibc-source.
    
    We should explicitly add the appropriate multiarch paths to our
    library search path. These would be picked up later on anyway in the case
    of a native build, but for, e.g., bootstrapping a cross-toolchain the
    needed multiarch paths aren't going to be found in ld.so.conf.
    
    Reported-by: Steve Langasek <[email protected]>

diff --git a/debian/changelog b/debian/changelog
index ae70c27..5f7a92c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,10 @@ dpkg (1.16.2) UNRELEASED; urgency=low
     debian/control does not have any package stanza. Closes: #642473
     Based on a patch by Kyle Willmon <[email protected]>.
 
+  [ Raphaël Hertzog ]
+  * Update Dpkg::Shlibs to look into multiarch paths when cross-building
+    too. Closes: #595144
+
   [ Updated dpkg translations ]
   * Italian (Milo Casagrande). Closes: #627832
 
diff --git a/scripts/Dpkg/Shlibs.pm b/scripts/Dpkg/Shlibs.pm
index 95ef4fe..722504d 100644
--- a/scripts/Dpkg/Shlibs.pm
+++ b/scripts/Dpkg/Shlibs.pm
@@ -29,7 +29,8 @@ use Dpkg::Gettext;
 use Dpkg::ErrorHandling;
 use Dpkg::Shlibs::Objdump;
 use Dpkg::Path qw(resolve_symlink canonpath);
-use Dpkg::Arch qw(debarch_to_gnutriplet get_build_arch get_host_arch);
+use Dpkg::Arch qw(debarch_to_gnutriplet get_build_arch get_host_arch
+                  gnutriplet_to_multiarch debarch_to_multiarch);
 
 use constant DEFAULT_LIBRARY_PATH =>
     qw(/lib /usr/lib /lib32 /usr/lib32 /lib64 /usr/lib64
@@ -38,23 +39,27 @@ use constant DEFAULT_LIBRARY_PATH =>
 # Adjust set of directories to consider when we're in a situation of a
 # cross-build or a build of a cross-compiler
 my @crosslibrarypaths;
-my $crossprefix;
+my ($crossprefix, $multiarch);
 # Detect cross compiler builds
 if ($ENV{GCC_TARGET}) {
     $crossprefix = debarch_to_gnutriplet($ENV{GCC_TARGET});
+    $multiarch = debarch_to_multiarch($ENV{GCC_TARGET});
 }
 if ($ENV{DEB_TARGET_GNU_TYPE} and
     ($ENV{DEB_TARGET_GNU_TYPE} ne $ENV{DEB_BUILD_GNU_TYPE}))
 {
     $crossprefix = $ENV{DEB_TARGET_GNU_TYPE};
+    $multiarch = gnutriplet_to_multiarch($ENV{DEB_TARGET_GNU_TYPE});
 }
 # host for normal cross builds.
 if (get_build_arch() ne get_host_arch()) {
     $crossprefix = debarch_to_gnutriplet(get_host_arch());
+    $multiarch = debarch_to_multiarch(get_host_arch());
 }
 # Define list of directories containing crossbuilt libraries
 if ($crossprefix) {
-    push @crosslibrarypaths, "/$crossprefix/lib", "/usr/$crossprefix/lib",
+    push @crosslibrarypaths, "/lib/$multiarch", "/usr/lib/$multiarch",
+            "/$crossprefix/lib", "/usr/$crossprefix/lib",
             "/$crossprefix/lib32", "/usr/$crossprefix/lib32",
             "/$crossprefix/lib64", "/usr/$crossprefix/lib64";
 }

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to