From 4ebdf0442f00a12b12f989fe86ef25b02c4ae1a3 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Mon, 2 Sep 2024 01:36:56 -0400 Subject: [PATCH 1/2] libredirect: fix install name on aarch64-darwin The install name should be the full path. This matches x86_64-darwin. --- pkgs/build-support/libredirect/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/build-support/libredirect/default.nix b/pkgs/build-support/libredirect/default.nix index 1b8ebcaeacdd..0fe1e04d6aea 100644 --- a/pkgs/build-support/libredirect/default.nix +++ b/pkgs/build-support/libredirect/default.nix @@ -45,6 +45,7 @@ else stdenv.mkDerivation rec { -isystem ${llvmPackages.libclang.lib}/lib/clang/*/include \ -L${llvmPackages.clang.libc}/lib \ -Wl,-install_name,$libName \ + -Wl,-install_name,$out/lib/$libName \ -Wall -std=c99 -O3 -fPIC libredirect.c \ -shared -o "$libName" '' else if stdenv.hostPlatform.isDarwin then '' From 9167e4fbcddedf5738a5441ed7bbd310f01cdbe1 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Mon, 2 Sep 2024 01:36:56 -0400 Subject: [PATCH 2/2] libredirect: update for new Darwin SDK on aarch64-darwin The location of `libSystem.tbd` depends on the SDK, making it effectively dynamic. It must be located relative to the `SDKROOT` instead of to `clang.libc`. --- pkgs/build-support/libredirect/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/libredirect/default.nix b/pkgs/build-support/libredirect/default.nix index 0fe1e04d6aea..c30f4c90e2e6 100644 --- a/pkgs/build-support/libredirect/default.nix +++ b/pkgs/build-support/libredirect/default.nix @@ -41,10 +41,9 @@ else stdenv.mkDerivation rec { # like arm64(e). PATH=${bintools-unwrapped}/bin:${llvmPackages.clang-unwrapped}/bin:$PATH \ clang -arch x86_64 -arch arm64 -arch arm64e \ - -isystem ${llvmPackages.clang.libc}/include \ + -isystem "$SDKROOT/usr/include" \ -isystem ${llvmPackages.libclang.lib}/lib/clang/*/include \ - -L${llvmPackages.clang.libc}/lib \ - -Wl,-install_name,$libName \ + "-L$SDKROOT/usr/lib" \ -Wl,-install_name,$out/lib/$libName \ -Wall -std=c99 -O3 -fPIC libredirect.c \ -shared -o "$libName"