···432 # Always add -march based on cpu in triple. Sometimes there is a
433 # discrepency (x86_64 vs. x86-64), so we provide an "arch" arg in
434 # that case.
435- + optionalString ((targetPlatform ? gcc.arch) &&
0436 isGccArchSupported targetPlatform.gcc.arch) ''
437 echo "-march=${targetPlatform.gcc.arch}" >> $out/nix-support/cc-cflags-before
438 ''
439440 # -mcpu is not very useful. You should use mtune and march
441 # instead. It’s provided here for backwards compatibility.
442- + optionalString (targetPlatform ? gcc.cpu) ''
0443 echo "-mcpu=${targetPlatform.gcc.cpu}" >> $out/nix-support/cc-cflags-before
444 ''
445
···432 # Always add -march based on cpu in triple. Sometimes there is a
433 # discrepency (x86_64 vs. x86-64), so we provide an "arch" arg in
434 # that case.
435+ # TODO: aarch64-darwin has mcpu incompatible with gcc
436+ + optionalString ((targetPlatform ? gcc.arch) && (isClang || !(stdenv.isDarwin && stdenv.isAarch64)) &&
437 isGccArchSupported targetPlatform.gcc.arch) ''
438 echo "-march=${targetPlatform.gcc.arch}" >> $out/nix-support/cc-cflags-before
439 ''
440441 # -mcpu is not very useful. You should use mtune and march
442 # instead. It’s provided here for backwards compatibility.
443+ # TODO: aarch64-darwin has mcpu incompatible with gcc
444+ + optionalString ((targetPlatform ? gcc.cpu) && (isClang || !(stdenv.isDarwin && stdenv.isAarch64))) ''
445 echo "-mcpu=${targetPlatform.gcc.cpu}" >> $out/nix-support/cc-cflags-before
446 ''
447