* Work around /bin/sh being broken by an LD_LIBRARY_PATH that contains

another Glibc.

svn path=/nixpkgs/branches/stdenv-updates/; revision=15470
This commit is contained in:
Eelco Dolstra 2009-05-06 13:49:12 +00:00
parent f51b3b5550
commit 89b8ab2d78
2 changed files with 15 additions and 1 deletions

View File

@ -77,7 +77,8 @@ rec {
param1 = bootstrapTools;
preHook = builtins.toFile "prehook.sh"
''
export LD_LIBRARY_PATH=$param1/lib
# Put libpthread.so in LD_LIBRARY_PATH; some libraries need it.
export LD_LIBRARY_PATH=$param1/lib2
# Don't patch #!/interpreter because it leads to retained
# dependencies on the bootstrapTools in the final stdenv.
dontPatchShebangs=1

View File

@ -33,3 +33,16 @@ ln -s bzip2 $out/bin/bunzip2
# fetchurl needs curl.
bzip2 -d < $curl > $out/bin/curl
chmod +x $out/bin/curl
# Some libraries have libpthread in their DT_RUNPATH. PatchELF
# doesn't work on libraries, so we need to set LD_LIBRARY_PATH.
# However, setting LD_LIBRARY_PATH to $out/lib will confuse /bin/sh,
# since it might end up loading libraries from a different Glibc. So
# put *only* libpthread in LD_LIBRARY_PATH (via $out/lib2). !!! This
# is a temporary fix (since /bin/sh could have a dependency on
# libpthread as well). A better fix would be to make patchelf work on
# libraries, or to set the RPATH rather than the RUNPATH in the
# binaries in $out/bin (patchelf --force-rpath doesn't quite work,
# since it doesn't discard the existing RUNPATH).
mkdir $out/lib2
ln -s $out/lib/libpthread* $out/lib2