File tree Expand file tree Collapse file tree
pkgs/build-support/libredirect Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ else stdenv.mkDerivation rec {
4444 -isystem ${ llvmPackages_13 . clang . libc } /include \
4545 -isystem ${ llvmPackages_13 . libclang . lib } /lib/clang/*/include \
4646 -L${ llvmPackages_13 . clang . libc } /lib \
47- -Wl,-install_name,$out/lib/$ libName \
47+ -Wl,-install_name,$libName \
4848 -Wall -std=c99 -O3 -fPIC libredirect.c \
4949 -ldl -shared -o "$libName"
5050 '' else if stdenv . isDarwin then ''
@@ -73,6 +73,12 @@ else stdenv.mkDerivation rec {
7373
7474 install -vD "$libName" "$out/lib/$libName"
7575
76+ '' + lib . optionalString ( stdenv . isDarwin && stdenv . isAarch64 ) ''
77+ # dylib will be rejected unless dylib rpath gets explictly set
78+ install_name_tool \
79+ -change $libName $out/lib/$libName \
80+ $out/lib/$libName
81+ '' + ''
7682 # Provide a setup hook that injects our library into every process.
7783 mkdir -p "$hook/nix-support"
7884 cat <<SETUP_HOOK > "$hook/nix-support/setup-hook"
You can’t perform that action at this time.
0 commit comments