mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-11 04:02:55 +03:00
* 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:
parent
f51b3b5550
commit
89b8ab2d78
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user