mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-26 06:44:06 +00:00
darwin/make-bootstrap-tools: move "lib" from install name to rpath
The rpath structure for the bootstrap tools was reworked to minimize
the amount of rewriting required on unpack, but the test was not
updated to match the different structure.
Additionally [1] builds that use the bootstrap version of libc++
cannot find libc++abi if the reference includes the "lib"
component (ie, libc++ refers to libc++abi with
@rpath/lib/libc++abi.dylib).
[1] https://logs.nix.samueldr.com/nix-darwin/2021-05-18#4993282
Test failure observed on Hydra: https://hydra.nixos.org/build/143130126
(cherry picked from commit 38207735f4
)
This commit is contained in:
parent
677fab12a9
commit
d2920be368
@ -136,9 +136,7 @@ in rec {
|
||||
local libs=$(${stdenv.cc.targetPrefix}otool -L "$1" | tail -n +2 | grep -o "$NIX_STORE.*-\S*") || true
|
||||
local newlib
|
||||
for lib in $libs; do
|
||||
newlib=''${lib:${toString (storePrefixLen + 1)}}
|
||||
newlib=''${newlib#*/}
|
||||
${stdenv.cc.targetPrefix}install_name_tool -change $lib "@rpath/$newlib" "$1"
|
||||
${stdenv.cc.targetPrefix}install_name_tool -change $lib "@rpath/$(basename "$lib")" "$1"
|
||||
done
|
||||
}
|
||||
|
||||
@ -160,7 +158,7 @@ in rec {
|
||||
for i in $out/bin/*; do
|
||||
if test -x "$i" -a ! -L "$i" -a "$(basename $i)" != codesign; then
|
||||
echo "Adding @executable_path to rpath in $i"
|
||||
${stdenv.cc.targetPrefix}install_name_tool -add_rpath '@executable_path/..' $i
|
||||
${stdenv.cc.targetPrefix}install_name_tool -add_rpath '@executable_path/../lib' $i
|
||||
fi
|
||||
done
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user