Merge pull request #209054 from trofi/stdcxx-out-of-bootstrap-lib

linux/bootstrap-tools: move libstdc++ out of default library search path

authored by Sergei Trofimovich and committed by GitHub 44330938 d4544382

+11 -2
+11 -2
pkgs/stdenv/linux/bootstrap-tools/scripts/unpack-bootstrap-tools.sh
··· 17 17 LD_BINARY=$out/lib/ld-*so.? 18 18 fi 19 19 20 + # path to version-specific libraries, like libstdc++.so 21 + LIBSTDCXX_SO_DIR=$(echo $out/lib/gcc/*/*) 22 + 23 + # Move version-specific libraries out to avoid library mix when we 24 + # upgrade gcc. 25 + # TODO(trofi): update bootstrap tarball script and tarballs to put them 26 + # into expected location directly. 27 + LD_LIBRARY_PATH=$out/lib $LD_BINARY $out/bin/mv $out/lib/libstdc++.* $LIBSTDCXX_SO_DIR/ 28 + 20 29 # On x86_64, ld-linux-x86-64.so.2 barfs on patchelf'ed programs. So 21 30 # use a copy of patchelf. 22 31 LD_LIBRARY_PATH=$out/lib $LD_BINARY $out/bin/cp $out/bin/patchelf . ··· 25 34 if [ -L "$i" ]; then continue; fi 26 35 if [ -z "${i##*/liblto*}" ]; then continue; fi 27 36 echo patching "$i" 28 - LD_LIBRARY_PATH=$out/lib $LD_BINARY \ 29 - ./patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath "$i" 37 + LD_LIBRARY_PATH=$out/lib:$LIBSTDCXX_SO_DIR $LD_BINARY \ 38 + ./patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib:$LIBSTDCXX_SO_DIR --force-rpath "$i" 30 39 done 31 40 32 41 for i in $out/lib/librt-*.so $out/lib/libpcre*; do