From 67f11a2185dba0851c520e617526b65d82fb8c5b Mon Sep 17 00:00:00 2001 From: Josh Channings Date: Mon, 14 Nov 2022 01:31:26 +0000 Subject: [PATCH 1/3] libcxx: Link libc++.dylib to matching libc++abi.dylib Same adjustment as made for libc++abi in #185766, for the same reason: the unamended dylib links to the libc++abi in the build stdenv, which is the wrong version. Tested on Darwin with LLVM 14 stdenv, but the phase is added to all versions, including 11 - so this will cause a mass rebuild. See: https://github.com/NixOS/nixpkgs/pull/185766 --- .../compilers/llvm/10/libcxx/default.nix | 14 ++++++++++++++ .../compilers/llvm/11/libcxx/default.nix | 14 ++++++++++++++ .../compilers/llvm/12/libcxx/default.nix | 14 ++++++++++++++ .../compilers/llvm/13/libcxx/default.nix | 14 ++++++++++++++ .../compilers/llvm/14/libcxx/default.nix | 14 ++++++++++++++ .../compilers/llvm/5/libcxx/default.nix | 14 ++++++++++++++ .../compilers/llvm/6/libcxx/default.nix | 14 ++++++++++++++ .../compilers/llvm/7/libcxx/default.nix | 14 ++++++++++++++ .../compilers/llvm/8/libcxx/default.nix | 14 ++++++++++++++ .../compilers/llvm/9/libcxx/default.nix | 14 ++++++++++++++ .../compilers/llvm/git/libcxx/default.nix | 14 ++++++++++++++ 11 files changed, 154 insertions(+) diff --git a/pkgs/development/compilers/llvm/10/libcxx/default.nix b/pkgs/development/compilers/llvm/10/libcxx/default.nix index 6a4e645bb300..bf3ddeb58c30 100644 --- a/pkgs/development/compilers/llvm/10/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/10/libcxx/default.nix @@ -51,6 +51,20 @@ stdenv.mkDerivation { "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" ] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF"; + preInstall = lib.optionalString (stdenv.isDarwin) '' + for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + + baseName=$(basename $(otool -D $file | tail -n 1)) + installName="$out/lib/$baseName" + abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') + + for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file + done + done + ''; + passthru = { isLLVM = true; }; diff --git a/pkgs/development/compilers/llvm/11/libcxx/default.nix b/pkgs/development/compilers/llvm/11/libcxx/default.nix index 2a83b36fc425..135fed03beef 100644 --- a/pkgs/development/compilers/llvm/11/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/11/libcxx/default.nix @@ -67,6 +67,20 @@ stdenv.mkDerivation { stdenv.hostPlatform != stdenv.buildPlatform ) "-DCMAKE_SYSTEM_VERSION=20.1.0"; + preInstall = lib.optionalString (stdenv.isDarwin) '' + for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + + baseName=$(basename $(otool -D $file | tail -n 1)) + installName="$out/lib/$baseName" + abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') + + for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file + done + done + ''; + passthru = { isLLVM = true; }; diff --git a/pkgs/development/compilers/llvm/12/libcxx/default.nix b/pkgs/development/compilers/llvm/12/libcxx/default.nix index 1386d3680f91..fdd1690310c5 100644 --- a/pkgs/development/compilers/llvm/12/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/12/libcxx/default.nix @@ -42,6 +42,20 @@ stdenv.mkDerivation { "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" ] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF"; + preInstall = lib.optionalString (stdenv.isDarwin) '' + for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + + baseName=$(basename $(otool -D $file | tail -n 1)) + installName="$out/lib/$baseName" + abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') + + for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file + done + done + ''; + passthru = { isLLVM = true; }; diff --git a/pkgs/development/compilers/llvm/13/libcxx/default.nix b/pkgs/development/compilers/llvm/13/libcxx/default.nix index 0ce73ed97af6..664e593d3de7 100644 --- a/pkgs/development/compilers/llvm/13/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/13/libcxx/default.nix @@ -46,6 +46,20 @@ stdenv.mkDerivation rec { buildFlags = lib.optional headersOnly "generate-cxx-headers"; installTargets = lib.optional headersOnly "install-cxx-headers"; + preInstall = lib.optionalString (stdenv.isDarwin && !headersOnly) '' + for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + + baseName=$(basename $(otool -D $file | tail -n 1)) + installName="$out/lib/$baseName" + abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') + + for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file + done + done + ''; + # At this point, cxxabi headers would be installed in the dev output, which # prevents moveToOutput from doing its job later in the build process. postInstall = lib.optionalString (!headersOnly) '' diff --git a/pkgs/development/compilers/llvm/14/libcxx/default.nix b/pkgs/development/compilers/llvm/14/libcxx/default.nix index 0a684782d490..a637cdbab770 100644 --- a/pkgs/development/compilers/llvm/14/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/14/libcxx/default.nix @@ -62,6 +62,20 @@ stdenv.mkDerivation rec { buildFlags = lib.optional headersOnly "generate-cxx-headers"; installTargets = lib.optional headersOnly "install-cxx-headers"; + preInstall = lib.optionalString (stdenv.isDarwin && !headersOnly) '' + for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + + baseName=$(basename $(otool -D $file | tail -n 1)) + installName="$out/lib/$baseName" + abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') + + for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file + done + done + ''; + passthru = { isLLVM = true; }; diff --git a/pkgs/development/compilers/llvm/5/libcxx/default.nix b/pkgs/development/compilers/llvm/5/libcxx/default.nix index 44026fba187b..f0ed61a153f7 100644 --- a/pkgs/development/compilers/llvm/5/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/5/libcxx/default.nix @@ -41,6 +41,20 @@ stdenv.mkDerivation { "-DLIBCXX_CXX_ABI=libcxxabi" ] ++ lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1"; + preInstall = lib.optionalString (stdenv.isDarwin) '' + for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + + baseName=$(basename $(otool -D $file | tail -n 1)) + installName="$out/lib/$baseName" + abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') + + for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file + done + done + ''; + passthru = { isLLVM = true; }; diff --git a/pkgs/development/compilers/llvm/6/libcxx/default.nix b/pkgs/development/compilers/llvm/6/libcxx/default.nix index 7077081c5917..1eb3b121d500 100644 --- a/pkgs/development/compilers/llvm/6/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/6/libcxx/default.nix @@ -47,6 +47,20 @@ stdenv.mkDerivation { "-DLIBCXX_CXX_ABI=libcxxabi" ] ++ lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1"; + preInstall = lib.optionalString (stdenv.isDarwin) '' + for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + + baseName=$(basename $(otool -D $file | tail -n 1)) + installName="$out/lib/$baseName" + abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') + + for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file + done + done + ''; + passthru = { isLLVM = true; }; diff --git a/pkgs/development/compilers/llvm/7/libcxx/default.nix b/pkgs/development/compilers/llvm/7/libcxx/default.nix index 07d84432d422..b163ceb09f9e 100644 --- a/pkgs/development/compilers/llvm/7/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/7/libcxx/default.nix @@ -52,6 +52,20 @@ stdenv.mkDerivation { ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON" ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF" ; + preInstall = lib.optionalString (stdenv.isDarwin) '' + for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + + baseName=$(basename $(otool -D $file | tail -n 1)) + installName="$out/lib/$baseName" + abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') + + for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file + done + done + ''; + passthru = { isLLVM = true; }; diff --git a/pkgs/development/compilers/llvm/8/libcxx/default.nix b/pkgs/development/compilers/llvm/8/libcxx/default.nix index 536801129218..db6059e2ea27 100644 --- a/pkgs/development/compilers/llvm/8/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/8/libcxx/default.nix @@ -55,6 +55,20 @@ stdenv.mkDerivation { "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" ] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF"; + preInstall = lib.optionalString (stdenv.isDarwin) '' + for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + + baseName=$(basename $(otool -D $file | tail -n 1)) + installName="$out/lib/$baseName" + abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') + + for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file + done + done + ''; + passthru = { isLLVM = true; }; diff --git a/pkgs/development/compilers/llvm/9/libcxx/default.nix b/pkgs/development/compilers/llvm/9/libcxx/default.nix index 31a00ba54859..6682ec6799b2 100644 --- a/pkgs/development/compilers/llvm/9/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/9/libcxx/default.nix @@ -51,6 +51,20 @@ stdenv.mkDerivation { "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" ] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF"; + preInstall = lib.optionalString (stdenv.isDarwin) '' + for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + + baseName=$(basename $(otool -D $file | tail -n 1)) + installName="$out/lib/$baseName" + abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') + + for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file + done + done + ''; + passthru = { isLLVM = true; }; diff --git a/pkgs/development/compilers/llvm/git/libcxx/default.nix b/pkgs/development/compilers/llvm/git/libcxx/default.nix index 5e1f875bf338..f06459258def 100644 --- a/pkgs/development/compilers/llvm/git/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/git/libcxx/default.nix @@ -76,6 +76,20 @@ stdenv.mkDerivation rec { buildFlags = lib.optional headersOnly "generate-cxx-headers"; installTargets = lib.optional headersOnly "install-cxx-headers"; + preInstall = lib.optionalString (stdenv.isDarwin && !headersOnly) '' + for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + + baseName=$(basename $(otool -D $file | tail -n 1)) + installName="$out/lib/$baseName" + abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') + + for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file + done + done + ''; + passthru = { isLLVM = true; }; From 252ea6511df5327518b65043d6813684813c067a Mon Sep 17 00:00:00 2001 From: Josh Channings Date: Tue, 15 Nov 2022 01:54:14 +0000 Subject: [PATCH 2/3] libcxxabi: Skip dylib fixups for version symlinks Apart from being a no-op, this seems to cause the install to make a copy, rather than keeping the symlinks intact. --- pkgs/development/compilers/llvm/10/libcxxabi/default.nix | 2 ++ pkgs/development/compilers/llvm/11/libcxxabi/default.nix | 2 ++ pkgs/development/compilers/llvm/12/libcxxabi/default.nix | 2 ++ pkgs/development/compilers/llvm/13/libcxxabi/default.nix | 2 ++ pkgs/development/compilers/llvm/14/libcxxabi/default.nix | 2 ++ pkgs/development/compilers/llvm/5/libcxxabi/default.nix | 2 ++ pkgs/development/compilers/llvm/6/libcxxabi/default.nix | 2 ++ pkgs/development/compilers/llvm/7/libcxxabi/default.nix | 2 ++ pkgs/development/compilers/llvm/8/libcxxabi/default.nix | 2 ++ pkgs/development/compilers/llvm/9/libcxxabi/default.nix | 2 ++ pkgs/development/compilers/llvm/git/libcxxabi/default.nix | 2 ++ 11 files changed, 22 insertions(+) diff --git a/pkgs/development/compilers/llvm/10/libcxxabi/default.nix b/pkgs/development/compilers/llvm/10/libcxxabi/default.nix index b046e627d831..0af20699a1dd 100644 --- a/pkgs/development/compilers/llvm/10/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/10/libcxxabi/default.nix @@ -42,6 +42,8 @@ stdenv.mkDerivation { preInstall = lib.optionalString stdenv.isDarwin '' for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + # Fix up the install name. Preserve the basename, just replace the path. installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" diff --git a/pkgs/development/compilers/llvm/11/libcxxabi/default.nix b/pkgs/development/compilers/llvm/11/libcxxabi/default.nix index 6b5cf85d1ec3..ee410440d500 100644 --- a/pkgs/development/compilers/llvm/11/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/11/libcxxabi/default.nix @@ -46,6 +46,8 @@ stdenv.mkDerivation { preInstall = lib.optionalString stdenv.isDarwin '' for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + # Fix up the install name. Preserve the basename, just replace the path. installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" diff --git a/pkgs/development/compilers/llvm/12/libcxxabi/default.nix b/pkgs/development/compilers/llvm/12/libcxxabi/default.nix index 3d9a92d9305d..8d3558a71fe4 100644 --- a/pkgs/development/compilers/llvm/12/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/12/libcxxabi/default.nix @@ -44,6 +44,8 @@ stdenv.mkDerivation { preInstall = lib.optionalString stdenv.isDarwin '' for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + # Fix up the install name. Preserve the basename, just replace the path. installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" diff --git a/pkgs/development/compilers/llvm/13/libcxxabi/default.nix b/pkgs/development/compilers/llvm/13/libcxxabi/default.nix index 9043c6bff25b..a744bb514800 100644 --- a/pkgs/development/compilers/llvm/13/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/13/libcxxabi/default.nix @@ -41,6 +41,8 @@ stdenv.mkDerivation rec { preInstall = lib.optionalString stdenv.isDarwin '' for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + # Fix up the install name. Preserve the basename, just replace the path. installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" diff --git a/pkgs/development/compilers/llvm/14/libcxxabi/default.nix b/pkgs/development/compilers/llvm/14/libcxxabi/default.nix index 26f4c4dba8e4..731038e86710 100644 --- a/pkgs/development/compilers/llvm/14/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/14/libcxxabi/default.nix @@ -52,6 +52,8 @@ stdenv.mkDerivation rec { installPhase = if stdenv.isDarwin then '' for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + # Fix up the install name. Preserve the basename, just replace the path. installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" diff --git a/pkgs/development/compilers/llvm/5/libcxxabi/default.nix b/pkgs/development/compilers/llvm/5/libcxxabi/default.nix index 925c8947ccf5..ef47fb62e7bc 100644 --- a/pkgs/development/compilers/llvm/5/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/5/libcxxabi/default.nix @@ -27,6 +27,8 @@ stdenv.mkDerivation { preInstall = lib.optionalString stdenv.isDarwin '' for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + # Fix up the install name. Preserve the basename, just replace the path. installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" diff --git a/pkgs/development/compilers/llvm/6/libcxxabi/default.nix b/pkgs/development/compilers/llvm/6/libcxxabi/default.nix index 3371a8ba1a15..38e47f8c25fe 100644 --- a/pkgs/development/compilers/llvm/6/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/6/libcxxabi/default.nix @@ -27,6 +27,8 @@ stdenv.mkDerivation { preInstall = lib.optionalString stdenv.isDarwin '' for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + # Fix up the install name. Preserve the basename, just replace the path. installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" diff --git a/pkgs/development/compilers/llvm/7/libcxxabi/default.nix b/pkgs/development/compilers/llvm/7/libcxxabi/default.nix index 8be9690f5f40..693ceda0e32c 100644 --- a/pkgs/development/compilers/llvm/7/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/7/libcxxabi/default.nix @@ -46,6 +46,8 @@ stdenv.mkDerivation { preInstall = lib.optionalString stdenv.isDarwin '' for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + # Fix up the install name. Preserve the basename, just replace the path. installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" diff --git a/pkgs/development/compilers/llvm/8/libcxxabi/default.nix b/pkgs/development/compilers/llvm/8/libcxxabi/default.nix index 6b4de0786b98..040b32d0d04f 100644 --- a/pkgs/development/compilers/llvm/8/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/8/libcxxabi/default.nix @@ -42,6 +42,8 @@ stdenv.mkDerivation { preInstall = lib.optionalString stdenv.isDarwin '' for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + # Fix up the install name. Preserve the basename, just replace the path. installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" diff --git a/pkgs/development/compilers/llvm/9/libcxxabi/default.nix b/pkgs/development/compilers/llvm/9/libcxxabi/default.nix index b7c0c2b0475a..adb2f859da7e 100644 --- a/pkgs/development/compilers/llvm/9/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/9/libcxxabi/default.nix @@ -42,6 +42,8 @@ stdenv.mkDerivation { preInstall = lib.optionalString stdenv.isDarwin '' for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + # Fix up the install name. Preserve the basename, just replace the path. installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" diff --git a/pkgs/development/compilers/llvm/git/libcxxabi/default.nix b/pkgs/development/compilers/llvm/git/libcxxabi/default.nix index 42a811e131b8..24335c697cd1 100644 --- a/pkgs/development/compilers/llvm/git/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/git/libcxxabi/default.nix @@ -70,6 +70,8 @@ stdenv.mkDerivation rec { preInstall = lib.optionalString stdenv.isDarwin '' for file in lib/*.dylib; do + if [ -L "$file" ]; then continue; fi + # Fix up the install name. Preserve the basename, just replace the path. installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" From 2252245f9228f460542166450631d2bc6c534d0f Mon Sep 17 00:00:00 2001 From: Josh Channings Date: Tue, 22 Nov 2022 21:37:47 +0000 Subject: [PATCH 3/3] llvm: Find otool bin from targetPrefix This is to fix the stdenvBootstrapTools issue where otool & others are not available in PATH, but only under the targetPrefix. --- pkgs/development/compilers/llvm/10/libcxx/default.nix | 4 ++-- pkgs/development/compilers/llvm/10/libcxxabi/default.nix | 4 ++-- pkgs/development/compilers/llvm/11/libcxx/default.nix | 4 ++-- pkgs/development/compilers/llvm/11/libcxxabi/default.nix | 4 ++-- pkgs/development/compilers/llvm/12/libcxx/default.nix | 4 ++-- pkgs/development/compilers/llvm/12/libcxxabi/default.nix | 4 ++-- pkgs/development/compilers/llvm/13/libcxx/default.nix | 4 ++-- pkgs/development/compilers/llvm/13/libcxxabi/default.nix | 4 ++-- pkgs/development/compilers/llvm/14/libcxx/default.nix | 4 ++-- pkgs/development/compilers/llvm/14/libcxxabi/default.nix | 4 ++-- pkgs/development/compilers/llvm/5/libcxx/default.nix | 4 ++-- pkgs/development/compilers/llvm/5/libcxxabi/default.nix | 4 ++-- pkgs/development/compilers/llvm/6/libcxx/default.nix | 4 ++-- pkgs/development/compilers/llvm/6/libcxxabi/default.nix | 4 ++-- pkgs/development/compilers/llvm/7/libcxx/default.nix | 4 ++-- pkgs/development/compilers/llvm/7/libcxxabi/default.nix | 4 ++-- pkgs/development/compilers/llvm/8/libcxx/default.nix | 4 ++-- pkgs/development/compilers/llvm/8/libcxxabi/default.nix | 4 ++-- pkgs/development/compilers/llvm/9/libcxx/default.nix | 4 ++-- pkgs/development/compilers/llvm/9/libcxxabi/default.nix | 4 ++-- pkgs/development/compilers/llvm/git/libcxx/default.nix | 4 ++-- pkgs/development/compilers/llvm/git/libcxxabi/default.nix | 4 ++-- 22 files changed, 44 insertions(+), 44 deletions(-) diff --git a/pkgs/development/compilers/llvm/10/libcxx/default.nix b/pkgs/development/compilers/llvm/10/libcxx/default.nix index bf3ddeb58c30..0c0f535f7433 100644 --- a/pkgs/development/compilers/llvm/10/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/10/libcxx/default.nix @@ -55,11 +55,11 @@ stdenv.mkDerivation { for file in lib/*.dylib; do if [ -L "$file" ]; then continue; fi - baseName=$(basename $(otool -D $file | tail -n 1)) + baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1)) installName="$out/lib/$baseName" abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file done done diff --git a/pkgs/development/compilers/llvm/10/libcxxabi/default.nix b/pkgs/development/compilers/llvm/10/libcxxabi/default.nix index 0af20699a1dd..d62422fc9a12 100644 --- a/pkgs/development/compilers/llvm/10/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/10/libcxxabi/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation { if [ -L "$file" ]; then continue; fi # Fix up the install name. Preserve the basename, just replace the path. - installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" + installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))" # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables @@ -56,7 +56,7 @@ stdenv.mkDerivation { # cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes # libcxxabi to sometimes link against a different version of itself. # Here we simply make that second reference point to ourselves. - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file done done diff --git a/pkgs/development/compilers/llvm/11/libcxx/default.nix b/pkgs/development/compilers/llvm/11/libcxx/default.nix index 135fed03beef..237bbd4e0610 100644 --- a/pkgs/development/compilers/llvm/11/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/11/libcxx/default.nix @@ -71,11 +71,11 @@ stdenv.mkDerivation { for file in lib/*.dylib; do if [ -L "$file" ]; then continue; fi - baseName=$(basename $(otool -D $file | tail -n 1)) + baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1)) installName="$out/lib/$baseName" abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file done done diff --git a/pkgs/development/compilers/llvm/11/libcxxabi/default.nix b/pkgs/development/compilers/llvm/11/libcxxabi/default.nix index ee410440d500..ed0efe28a170 100644 --- a/pkgs/development/compilers/llvm/11/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/11/libcxxabi/default.nix @@ -49,7 +49,7 @@ stdenv.mkDerivation { if [ -L "$file" ]; then continue; fi # Fix up the install name. Preserve the basename, just replace the path. - installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" + installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))" # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables @@ -60,7 +60,7 @@ stdenv.mkDerivation { # cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes # libcxxabi to sometimes link against a different version of itself. # Here we simply make that second reference point to ourselves. - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file done done diff --git a/pkgs/development/compilers/llvm/12/libcxx/default.nix b/pkgs/development/compilers/llvm/12/libcxx/default.nix index fdd1690310c5..ef90eedb38c9 100644 --- a/pkgs/development/compilers/llvm/12/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/12/libcxx/default.nix @@ -46,11 +46,11 @@ stdenv.mkDerivation { for file in lib/*.dylib; do if [ -L "$file" ]; then continue; fi - baseName=$(basename $(otool -D $file | tail -n 1)) + baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1)) installName="$out/lib/$baseName" abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file done done diff --git a/pkgs/development/compilers/llvm/12/libcxxabi/default.nix b/pkgs/development/compilers/llvm/12/libcxxabi/default.nix index 8d3558a71fe4..41c559a52ee8 100644 --- a/pkgs/development/compilers/llvm/12/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/12/libcxxabi/default.nix @@ -47,7 +47,7 @@ stdenv.mkDerivation { if [ -L "$file" ]; then continue; fi # Fix up the install name. Preserve the basename, just replace the path. - installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" + installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))" # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables @@ -58,7 +58,7 @@ stdenv.mkDerivation { # cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes # libcxxabi to sometimes link against a different version of itself. # Here we simply make that second reference point to ourselves. - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file done done diff --git a/pkgs/development/compilers/llvm/13/libcxx/default.nix b/pkgs/development/compilers/llvm/13/libcxx/default.nix index 664e593d3de7..f6b76901de3f 100644 --- a/pkgs/development/compilers/llvm/13/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/13/libcxx/default.nix @@ -50,11 +50,11 @@ stdenv.mkDerivation rec { for file in lib/*.dylib; do if [ -L "$file" ]; then continue; fi - baseName=$(basename $(otool -D $file | tail -n 1)) + baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1)) installName="$out/lib/$baseName" abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file done done diff --git a/pkgs/development/compilers/llvm/13/libcxxabi/default.nix b/pkgs/development/compilers/llvm/13/libcxxabi/default.nix index a744bb514800..bced2ccb789f 100644 --- a/pkgs/development/compilers/llvm/13/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/13/libcxxabi/default.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { if [ -L "$file" ]; then continue; fi # Fix up the install name. Preserve the basename, just replace the path. - installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" + installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))" # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables @@ -55,7 +55,7 @@ stdenv.mkDerivation rec { # cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes # libcxxabi to sometimes link against a different version of itself. # Here we simply make that second reference point to ourselves. - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file done done diff --git a/pkgs/development/compilers/llvm/14/libcxx/default.nix b/pkgs/development/compilers/llvm/14/libcxx/default.nix index a637cdbab770..c623d41f92f6 100644 --- a/pkgs/development/compilers/llvm/14/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/14/libcxx/default.nix @@ -66,11 +66,11 @@ stdenv.mkDerivation rec { for file in lib/*.dylib; do if [ -L "$file" ]; then continue; fi - baseName=$(basename $(otool -D $file | tail -n 1)) + baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1)) installName="$out/lib/$baseName" abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file done done diff --git a/pkgs/development/compilers/llvm/14/libcxxabi/default.nix b/pkgs/development/compilers/llvm/14/libcxxabi/default.nix index 731038e86710..3be2f964abcd 100644 --- a/pkgs/development/compilers/llvm/14/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/14/libcxxabi/default.nix @@ -55,7 +55,7 @@ stdenv.mkDerivation rec { if [ -L "$file" ]; then continue; fi # Fix up the install name. Preserve the basename, just replace the path. - installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" + installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))" # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables @@ -66,7 +66,7 @@ stdenv.mkDerivation rec { # cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes # libcxxabi to sometimes link against a different version of itself. # Here we simply make that second reference point to ourselves. - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file done done diff --git a/pkgs/development/compilers/llvm/5/libcxx/default.nix b/pkgs/development/compilers/llvm/5/libcxx/default.nix index f0ed61a153f7..a5a86fcab4d0 100644 --- a/pkgs/development/compilers/llvm/5/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/5/libcxx/default.nix @@ -45,11 +45,11 @@ stdenv.mkDerivation { for file in lib/*.dylib; do if [ -L "$file" ]; then continue; fi - baseName=$(basename $(otool -D $file | tail -n 1)) + baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1)) installName="$out/lib/$baseName" abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file done done diff --git a/pkgs/development/compilers/llvm/5/libcxxabi/default.nix b/pkgs/development/compilers/llvm/5/libcxxabi/default.nix index ef47fb62e7bc..97077ac77112 100644 --- a/pkgs/development/compilers/llvm/5/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/5/libcxxabi/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation { if [ -L "$file" ]; then continue; fi # Fix up the install name. Preserve the basename, just replace the path. - installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" + installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))" # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables @@ -41,7 +41,7 @@ stdenv.mkDerivation { # cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes # libcxxabi to sometimes link against a different version of itself. # Here we simply make that second reference point to ourselves. - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file done done diff --git a/pkgs/development/compilers/llvm/6/libcxx/default.nix b/pkgs/development/compilers/llvm/6/libcxx/default.nix index 1eb3b121d500..a6e723753ef8 100644 --- a/pkgs/development/compilers/llvm/6/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/6/libcxx/default.nix @@ -51,11 +51,11 @@ stdenv.mkDerivation { for file in lib/*.dylib; do if [ -L "$file" ]; then continue; fi - baseName=$(basename $(otool -D $file | tail -n 1)) + baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1)) installName="$out/lib/$baseName" abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file done done diff --git a/pkgs/development/compilers/llvm/6/libcxxabi/default.nix b/pkgs/development/compilers/llvm/6/libcxxabi/default.nix index 38e47f8c25fe..aea126b31d9f 100644 --- a/pkgs/development/compilers/llvm/6/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/6/libcxxabi/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation { if [ -L "$file" ]; then continue; fi # Fix up the install name. Preserve the basename, just replace the path. - installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" + installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))" # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables @@ -41,7 +41,7 @@ stdenv.mkDerivation { # cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes # libcxxabi to sometimes link against a different version of itself. # Here we simply make that second reference point to ourselves. - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file done done diff --git a/pkgs/development/compilers/llvm/7/libcxx/default.nix b/pkgs/development/compilers/llvm/7/libcxx/default.nix index b163ceb09f9e..145f0df8837c 100644 --- a/pkgs/development/compilers/llvm/7/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/7/libcxx/default.nix @@ -56,11 +56,11 @@ stdenv.mkDerivation { for file in lib/*.dylib; do if [ -L "$file" ]; then continue; fi - baseName=$(basename $(otool -D $file | tail -n 1)) + baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1)) installName="$out/lib/$baseName" abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file done done diff --git a/pkgs/development/compilers/llvm/7/libcxxabi/default.nix b/pkgs/development/compilers/llvm/7/libcxxabi/default.nix index 693ceda0e32c..d6f90634cd0b 100644 --- a/pkgs/development/compilers/llvm/7/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/7/libcxxabi/default.nix @@ -49,7 +49,7 @@ stdenv.mkDerivation { if [ -L "$file" ]; then continue; fi # Fix up the install name. Preserve the basename, just replace the path. - installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" + installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))" # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables @@ -60,7 +60,7 @@ stdenv.mkDerivation { # cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes # libcxxabi to sometimes link against a different version of itself. # Here we simply make that second reference point to ourselves. - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file done done diff --git a/pkgs/development/compilers/llvm/8/libcxx/default.nix b/pkgs/development/compilers/llvm/8/libcxx/default.nix index db6059e2ea27..4a078ac9cda3 100644 --- a/pkgs/development/compilers/llvm/8/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/8/libcxx/default.nix @@ -59,11 +59,11 @@ stdenv.mkDerivation { for file in lib/*.dylib; do if [ -L "$file" ]; then continue; fi - baseName=$(basename $(otool -D $file | tail -n 1)) + baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1)) installName="$out/lib/$baseName" abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file done done diff --git a/pkgs/development/compilers/llvm/8/libcxxabi/default.nix b/pkgs/development/compilers/llvm/8/libcxxabi/default.nix index 040b32d0d04f..ab2d46f40a47 100644 --- a/pkgs/development/compilers/llvm/8/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/8/libcxxabi/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation { if [ -L "$file" ]; then continue; fi # Fix up the install name. Preserve the basename, just replace the path. - installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" + installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))" # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables @@ -56,7 +56,7 @@ stdenv.mkDerivation { # cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes # libcxxabi to sometimes link against a different version of itself. # Here we simply make that second reference point to ourselves. - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file done done diff --git a/pkgs/development/compilers/llvm/9/libcxx/default.nix b/pkgs/development/compilers/llvm/9/libcxx/default.nix index 6682ec6799b2..65441c359d60 100644 --- a/pkgs/development/compilers/llvm/9/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/9/libcxx/default.nix @@ -55,11 +55,11 @@ stdenv.mkDerivation { for file in lib/*.dylib; do if [ -L "$file" ]; then continue; fi - baseName=$(basename $(otool -D $file | tail -n 1)) + baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1)) installName="$out/lib/$baseName" abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file done done diff --git a/pkgs/development/compilers/llvm/9/libcxxabi/default.nix b/pkgs/development/compilers/llvm/9/libcxxabi/default.nix index adb2f859da7e..cfd1c32abd00 100644 --- a/pkgs/development/compilers/llvm/9/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/9/libcxxabi/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation { if [ -L "$file" ]; then continue; fi # Fix up the install name. Preserve the basename, just replace the path. - installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" + installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))" # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables @@ -56,7 +56,7 @@ stdenv.mkDerivation { # cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes # libcxxabi to sometimes link against a different version of itself. # Here we simply make that second reference point to ourselves. - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file done done diff --git a/pkgs/development/compilers/llvm/git/libcxx/default.nix b/pkgs/development/compilers/llvm/git/libcxx/default.nix index f06459258def..95e32041037a 100644 --- a/pkgs/development/compilers/llvm/git/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/git/libcxx/default.nix @@ -80,11 +80,11 @@ stdenv.mkDerivation rec { for file in lib/*.dylib; do if [ -L "$file" ]; then continue; fi - baseName=$(basename $(otool -D $file | tail -n 1)) + baseName=$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1)) installName="$out/lib/$baseName" abiName=$(echo "$baseName" | sed -e 's/libc++/libc++abi/') - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other ${libcxxabi}/lib/$abiName $file done done diff --git a/pkgs/development/compilers/llvm/git/libcxxabi/default.nix b/pkgs/development/compilers/llvm/git/libcxxabi/default.nix index 24335c697cd1..804acd6c7451 100644 --- a/pkgs/development/compilers/llvm/git/libcxxabi/default.nix +++ b/pkgs/development/compilers/llvm/git/libcxxabi/default.nix @@ -73,7 +73,7 @@ stdenv.mkDerivation rec { if [ -L "$file" ]; then continue; fi # Fix up the install name. Preserve the basename, just replace the path. - installName="$out/lib/$(basename $(otool -D $file | tail -n 1))" + installName="$out/lib/$(basename $(${stdenv.cc.targetPrefix}otool -D $file | tail -n 1))" # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables @@ -84,7 +84,7 @@ stdenv.mkDerivation rec { # cc-wrapper passes '-lc++abi' to all c++ link steps, but that causes # libcxxabi to sometimes link against a different version of itself. # Here we simply make that second reference point to ourselves. - for other in $(otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do + for other in $(${stdenv.cc.targetPrefix}otool -L $file | awk '$1 ~ "/libc\\+\\+abi" { print $1 }'); do ${stdenv.cc.targetPrefix}install_name_tool -change $other $installName $file done done