diff options
author | Ivan Babrou <github@ivan.computer> | 2021-03-05 23:23:35 -0800 |
---|---|---|
committer | Ivan Babrou <github@ivan.computer> | 2021-05-10 19:07:30 -0700 |
commit | 4aa95e33121c316c5b34031bb08106d2dc113e38 (patch) | |
tree | 90b4ed15d5774243e3c1afa50cc54039a30ab802 /pkgs/build-support/cc-wrapper | |
parent | d67b19f2237477a59503f58b69c5c704f55a0837 (diff) | |
download | nixpkgs-4aa95e33121c316c5b34031bb08106d2dc113e38.tar nixpkgs-4aa95e33121c316c5b34031bb08106d2dc113e38.tar.gz nixpkgs-4aa95e33121c316c5b34031bb08106d2dc113e38.tar.bz2 nixpkgs-4aa95e33121c316c5b34031bb08106d2dc113e38.tar.lz nixpkgs-4aa95e33121c316c5b34031bb08106d2dc113e38.tar.xz nixpkgs-4aa95e33121c316c5b34031bb08106d2dc113e38.tar.zst nixpkgs-4aa95e33121c316c5b34031bb08106d2dc113e38.zip |
gcc: native aarch64-darwin support
Diffstat (limited to 'pkgs/build-support/cc-wrapper')
-rw-r--r-- | pkgs/build-support/cc-wrapper/default.nix | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 14317cbe4cc..12c4a3ee0d4 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -432,14 +432,16 @@ stdenv.mkDerivation { # Always add -march based on cpu in triple. Sometimes there is a # discrepency (x86_64 vs. x86-64), so we provide an "arch" arg in # that case. - + optionalString ((targetPlatform ? gcc.arch) && + # TODO: aarch64-darwin has mcpu incompatible with gcc + + optionalString ((targetPlatform ? gcc.arch) && (isClang || !(stdenv.isDarwin && stdenv.isAarch64)) && isGccArchSupported targetPlatform.gcc.arch) '' echo "-march=${targetPlatform.gcc.arch}" >> $out/nix-support/cc-cflags-before '' # -mcpu is not very useful. You should use mtune and march # instead. It’s provided here for backwards compatibility. - + optionalString (targetPlatform ? gcc.cpu) '' + # TODO: aarch64-darwin has mcpu incompatible with gcc + + optionalString ((targetPlatform ? gcc.cpu) && (isClang || !(stdenv.isDarwin && stdenv.isAarch64))) '' echo "-mcpu=${targetPlatform.gcc.cpu}" >> $out/nix-support/cc-cflags-before '' |