summaryrefslogtreecommitdiffstats
path: root/pkgs/top-level/stage.nix
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2024-01-24 11:08:33 +0100
committerRodrigo Arias Mallo <rodarima@gmail.com>2024-05-16 14:08:34 +0200
commite4ee77feb0b3e43f528f9e1724bd4d7a4ef1bfc0 (patch)
tree47b6c59dbee0f4990cd9c5deaf60748baf08b88b /pkgs/top-level/stage.nix
parentc3e128f3c0ecc1fb04aef9f72b3dcc2f6cecf370 (diff)
pkgsStatic: Pass hostPlatform.gcc attribute
To build the security wrappers[1] the pkgsStatic stdenv is used, so the binaries are static. However, the hostPlatform may have gcc attributes that are *required* to build binaries so they can run on the host platform. In particular, this is the case when using gcc.arch, which ends up injecting -march=... in the gcc wrapper. Those attributes are not contained in hostPlatform.parsed. This change sets the same gcc attributes found in the hostPlatform for the pkgsStatic cross system, so it can build binaries with the same gcc flags. [1]: nixos/modules/security/wrappers/default.nix
Diffstat (limited to 'pkgs/top-level/stage.nix')
-rw-r--r--pkgs/top-level/stage.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix
index 1cc05167cee8..af43da0ca26d 100644
--- a/pkgs/top-level/stage.nix
+++ b/pkgs/top-level/stage.nix
@@ -272,8 +272,8 @@ let
if stdenv.isLinux
then makeMuslParsedPlatform stdenv.hostPlatform.parsed
else stdenv.hostPlatform.parsed;
- } // lib.optionalAttrs (stdenv.hostPlatform.system == "powerpc64-linux") {
- gcc.abi = "elfv2";
+ gcc = lib.optionalAttrs (stdenv.hostPlatform.system == "powerpc64-linux") { abi = "elfv2"; } //
+ stdenv.hostPlatform.gcc or {};
};
});
};