From a58ad4550c0fae84bfbea96d5abdcbc23e2948da Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sun, 30 Jun 2024 11:13:51 -0400 Subject: [PATCH] cc-wrapper: fix guessing mainProgram ccName points to the pname of the unwrapped cc minus the targetPrefix, thus is always incorrect for cross compilers whose wrappers are prefixed with the target platform name. --- pkgs/build-support/cc-wrapper/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 4adc1dcb1f8d..e0588d395c88 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -759,6 +759,6 @@ stdenvNoCC.mkDerivation { (optionalAttrs (cc_ ? meta) (removeAttrs cc.meta ["priority"])) // { description = attrByPath ["meta" "description"] "System C compiler" cc_ + " (wrapper script)"; priority = 10; - mainProgram = if name != "" then name else ccName; + mainProgram = if name != "" then name else "${targetPrefix}${ccName}"; }; }