libredirect: fix build for aarch64-darwin (PR #156460)
This commit is contained in:
parent
fde0b2e2f2
commit
4bde5a3a68
1 changed files with 7 additions and 1 deletions
|
@ -44,7 +44,7 @@ else stdenv.mkDerivation rec {
|
||||||
-isystem ${llvmPackages_13.clang.libc}/include \
|
-isystem ${llvmPackages_13.clang.libc}/include \
|
||||||
-isystem ${llvmPackages_13.libclang.lib}/lib/clang/*/include \
|
-isystem ${llvmPackages_13.libclang.lib}/lib/clang/*/include \
|
||||||
-L${llvmPackages_13.clang.libc}/lib \
|
-L${llvmPackages_13.clang.libc}/lib \
|
||||||
-Wl,-install_name,$out/lib/$libName \
|
-Wl,-install_name,$libName \
|
||||||
-Wall -std=c99 -O3 -fPIC libredirect.c \
|
-Wall -std=c99 -O3 -fPIC libredirect.c \
|
||||||
-ldl -shared -o "$libName"
|
-ldl -shared -o "$libName"
|
||||||
'' else if stdenv.isDarwin then ''
|
'' else if stdenv.isDarwin then ''
|
||||||
|
@ -73,6 +73,12 @@ else stdenv.mkDerivation rec {
|
||||||
|
|
||||||
install -vD "$libName" "$out/lib/$libName"
|
install -vD "$libName" "$out/lib/$libName"
|
||||||
|
|
||||||
|
'' + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
|
||||||
|
# dylib will be rejected unless dylib rpath gets explictly set
|
||||||
|
install_name_tool \
|
||||||
|
-change $libName $out/lib/$libName \
|
||||||
|
$out/lib/$libName
|
||||||
|
'' + ''
|
||||||
# Provide a setup hook that injects our library into every process.
|
# Provide a setup hook that injects our library into every process.
|
||||||
mkdir -p "$hook/nix-support"
|
mkdir -p "$hook/nix-support"
|
||||||
cat <<SETUP_HOOK > "$hook/nix-support/setup-hook"
|
cat <<SETUP_HOOK > "$hook/nix-support/setup-hook"
|
||||||
|
|
Loading…
Reference in a new issue