about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorRick van Schijndel <Mindavi@users.noreply.github.com>2022-06-02 22:27:14 +0200
committerGitHub <noreply@github.com>2022-06-02 22:27:14 +0200
commit17e891b141ca8e599ebf6443d0870a67dd98f94f (patch)
tree5eaa96c8ab010177f2db5d6c1890e3505719a14f /pkgs/build-support
parent994a8a9588ff2d3269093b5a755d1030e9586a54 (diff)
parenteef2c762ce19c8cf7172b319a7f4cd5555b5f289 (diff)
Merge pull request #175317 from ncfavier/makeBinaryWrapper-cross
makeBinaryWrapper: fix cross-compilation and add test
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/setup-hooks/make-binary-wrapper/default.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkgs/build-support/setup-hooks/make-binary-wrapper/default.nix b/pkgs/build-support/setup-hooks/make-binary-wrapper/default.nix
index 34bed3bb297da..9f52a05f61cac 100644
--- a/pkgs/build-support/setup-hooks/make-binary-wrapper/default.nix
+++ b/pkgs/build-support/setup-hooks/make-binary-wrapper/default.nix
@@ -1,10 +1,11 @@
 { stdenv
+, targetPackages
 , lib
 , makeSetupHook
 , dieHook
 , writeShellScript
 , tests
-, cc ? stdenv.cc
+, cc ? targetPackages.stdenv.cc
 , sanitizers ? []
 }:
 
@@ -14,7 +15,7 @@ makeSetupHook {
     ++ lib.optional (stdenv.isDarwin && stdenv.isAarch64) cc;
 
   substitutions = {
-    cc = "${cc}/bin/cc ${lib.escapeShellArgs (map (s: "-fsanitize=${s}") sanitizers)}";
+    cc = "${cc}/bin/${cc.targetPrefix}cc ${lib.escapeShellArgs (map (s: "-fsanitize=${s}") sanitizers)}";
 
     # Extract the function call used to create a binary wrapper from its embedded docstring
     passthru.extractCmd = writeShellScript "extract-binary-wrapper-cmd" ''