about summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-07-24 21:56:01 +0000
committerAlyssa Ross <hi@alyssa.is>2021-07-27 20:42:31 +0000
commit0901dfb214d23c485f85a58f450d5d83409ffc61 (patch)
tree4b1415fc6c9d95b5c979767d08fe24b571c8da58 /pkgs/stdenv
parent5e3d1de7276091034a1e047889ee381f05bb630c (diff)
downloadnixlib-0901dfb214d23c485f85a58f450d5d83409ffc61.tar
nixlib-0901dfb214d23c485f85a58f450d5d83409ffc61.tar.gz
nixlib-0901dfb214d23c485f85a58f450d5d83409ffc61.tar.bz2
nixlib-0901dfb214d23c485f85a58f450d5d83409ffc61.tar.lz
nixlib-0901dfb214d23c485f85a58f450d5d83409ffc61.tar.xz
nixlib-0901dfb214d23c485f85a58f450d5d83409ffc61.tar.zst
nixlib-0901dfb214d23c485f85a58f450d5d83409ffc61.zip
stdenv/setup: force libtool to skip dep checks
When we "fix" libtool, we empty out its system library path to avoid
it discovering libraries in e.g. /usr when the sandbox is disabled.
But this also means that the checks libtool does to make sure it can
find the libraries its supposed to be linking to won't work.  On Linux
and Darwin, this isn't a problem, because libtool doesn't actually
perform any checks, but it is on at least NetBSD and Cygwin[1].

So, we force libtool not to do these checks on any platform, bringing
the more exotic platforms into line with the existing behaviour on
Linux and Darwin.

Without this change, lots of library packages produce warnings like
this in their build output on the platforms with checks by default:

    *** Warning: linker path does not have real file for library -lz.
    *** I have the capability to make that library automatically link in when
    *** you link to this library.  But I can only do this if you have a
    *** shared version of the library, which you do not appear to have
    *** because I did check the linker path looking for a file starting
    *** with libz but no candidates were found. (...for regex pattern test)
    *** The inter-library dependencies that have been dropped here will be
    *** automatically added whenever a program is linked with this library
    *** or is declared to -dlopen it.

And dependent packages break because libtool doesn't link their
transitive dependencies.  So making this change fixes _lots_ of
packages on those platforms.

[1]: https://git.savannah.gnu.org/cgit/libtool.git/tree/m4/libtool.m4?id=544fc0e2c2a03129a540aebef41ad32bfb5c06b8#n3445
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/generic/setup.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index 2a1e0cfc6de3..ec5a5e6dcb9d 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -975,6 +975,7 @@ configurePhase() {
     fi
 
     if [ -z "${dontFixLibtool:-}" ]; then
+        export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"
         local i
         find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do
             echo "fixing libtool script $i"