diff options
author | Alyssa Ross <hi@alyssa.is> | 2024-06-04 19:17:21 +0100 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-06-15 08:03:18 +0200 |
commit | 0a71bbb64a89b311d9b5a715de2f1713368e799f (patch) | |
tree | fa011dc9c22755277210d199819863ebb41f8136 /pkgs/development/compilers | |
parent | 228653194554cd413703449e149ace4b285e9f31 (diff) |
gcc: fix building with gcc.cpu on some platforms
This fixes, for example, cross compiling to { system = "riscv64-linux"; gcc.cpu = "sifive-u74"; }.
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r-- | pkgs/development/compilers/gcc/common/platform-flags.nix | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkgs/development/compilers/gcc/common/platform-flags.nix b/pkgs/development/compilers/gcc/common/platform-flags.nix index cc6a67d640578..9bcdb3070d6b9 100644 --- a/pkgs/development/compilers/gcc/common/platform-flags.nix +++ b/pkgs/development/compilers/gcc/common/platform-flags.nix @@ -8,8 +8,9 @@ let in lib.concatLists [ # --with-arch= is unknown flag on x86_64 and aarch64-darwin. (lib.optional (!targetPlatform.isx86_64 && !isAarch64Darwin && p ? arch) "--with-arch=${p.arch}") + # See supported_defaults in gcc/config.gcc for architecture support. # --with-cpu on aarch64-darwin fails with "Unknown cpu used in --with-cpu=apple-a13". - (lib.optional (!isAarch64Darwin && p ? cpu) "--with-cpu=${p.cpu}") + (lib.optional (with targetPlatform; !isLoongArch64 && !isMips && !isRiscV && !isS390 && !isAarch64Darwin && p ? cpu) "--with-cpu=${p.cpu}") (lib.optional (p ? abi) "--with-abi=${p.abi}") (lib.optional (p ? fpu) "--with-fpu=${p.fpu}") (lib.optional (p ? float) "--with-float=${p.float}") |