Quellcode durchsuchen

Dpkg::Shlibs: Do not add cross-root directories to default search list

There's no reason to include these in the default search library list
anymore, as multiarch has superseded this usage for a long time, and no
package in Debian should be shipping libraries in those paths neither
other packages linking against those. Not including the paths avoids
polluting the search list.

If a user outside Debian wants to use a cross-root layout, the
«dpkg-shlibdeps -l» option can be used to specify those.
Guillem Jover vor 11 Jahren
Ursprung
Commit
93da43460d
2 geänderte Dateien mit 3 neuen und 10 gelöschten Zeilen
  1. 2 0
      debian/changelog
  2. 1 10
      scripts/Dpkg/Shlibs.pm

+ 2 - 0
debian/changelog

@@ -73,6 +73,8 @@ dpkg (1.18.0) UNRELEASED; urgency=low
   * Remove outdated local copy of the Debian README.mirrors.txt file from
     dselect ftp access method, and print a message pointing to the current
     URL instead. Closes: #784966
+  * Cleanup default dpkg-shlibdeps shared library directory search list:
+    - Do not add cross-root directories (/<triplet>/ and /usr/<triplet>/).
 
   * Perl modules:
     - Rename and deprecate Dpkg::Gettext _g function with new g_.

+ 1 - 10
scripts/Dpkg/Shlibs.pm

@@ -91,31 +91,22 @@ sub setup_library_paths {
 
     # Adjust set of directories to consider when we're in a situation of a
     # cross-build or a build of a cross-compiler.
-    my ($crossprefix, $multiarch);
+    my $multiarch;
 
     # Detect cross compiler builds.
     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 ($multiarch) {
         push @librarypaths, "/lib/$multiarch", "/usr/lib/$multiarch";
     }
-    # XXX: Add deprecated sysroot and toolchain cross-compilation paths.
-    if ($crossprefix) {
-        push @librarypaths,
-             "/$crossprefix/lib", "/usr/$crossprefix/lib",
-             "/$crossprefix/lib32", "/usr/$crossprefix/lib32",
-             "/$crossprefix/lib64", "/usr/$crossprefix/lib64";
-    }
 
     # XXX: Deprecated. Update library paths with LD_LIBRARY_PATH.
     if ($ENV{LD_LIBRARY_PATH}) {