···53, gccForLibs ? if useCcForLibs then cc else null
54, fortify-headers ? null
55, includeFortifyHeaders ? null
56-57-# https://github.com/NixOS/nixpkgs/issues/295322
58-# should -march flag be used
59-, disableMarch ? false
60}:
6162assert nativeTools -> !propagateDoc && nativePrefix != "";
···633634 # TODO: aarch64-darwin has mcpu incompatible with gcc
635 + optionalString ((targetPlatform ? gcc.arch) && !isClang && !(stdenv.isDarwin && stdenv.isAarch64) &&
636- isGccArchSupported targetPlatform.gcc.arch && !disableMarch) ''
637 echo "-march=${targetPlatform.gcc.arch}" >> $out/nix-support/cc-cflags-before
638 ''
639···729 + optionalString isClang ''
730 # Escape twice: once for this script, once for the one it gets substituted into.
731 export march=${escapeShellArg
732- (optionalString (targetPlatform ? gcc.arch && !disableMarch)
733 (escapeShellArg "-march=${targetPlatform.gcc.arch}"))}
734 export defaultTarget=${targetPlatform.config}
735 substituteAll ${./add-clang-cc-cflags-before.sh} $out/nix-support/add-local-cc-cflags-before.sh
···53, gccForLibs ? if useCcForLibs then cc else null
54, fortify-headers ? null
55, includeFortifyHeaders ? null
000056}:
5758assert nativeTools -> !propagateDoc && nativePrefix != "";
···629630 # TODO: aarch64-darwin has mcpu incompatible with gcc
631 + optionalString ((targetPlatform ? gcc.arch) && !isClang && !(stdenv.isDarwin && stdenv.isAarch64) &&
632+ isGccArchSupported targetPlatform.gcc.arch) ''
633 echo "-march=${targetPlatform.gcc.arch}" >> $out/nix-support/cc-cflags-before
634 ''
635···725 + optionalString isClang ''
726 # Escape twice: once for this script, once for the one it gets substituted into.
727 export march=${escapeShellArg
728+ (optionalString (targetPlatform ? gcc.arch)
729 (escapeShellArg "-march=${targetPlatform.gcc.arch}"))}
730 export defaultTarget=${targetPlatform.config}
731 substituteAll ${./add-clang-cc-cflags-before.sh} $out/nix-support/add-local-cc-cflags-before.sh
+3-7
pkgs/development/compilers/swift/default.nix
···25 #
26 # The following selects the correct Clang version, matching the version
27 # used in Swift, and applies the same libc overrides as `apple_sdk.stdenv`.
28- clang = let
29- # https://github.com/NixOS/nixpkgs/issues/295322
30- clangNoMarch = swiftLlvmPackages.clang.override { disableMarch = true; };
31- in
32- if pkgs.stdenv.isDarwin
33 then
34- clangNoMarch.override rec {
35 libc = apple_sdk.Libsystem;
36 bintools = pkgs.bintools.override { inherit libc; };
37 # Ensure that Swift’s internal clang uses the same libc++ and libc++abi as the
···41 inherit (llvmPackages) libcxx;
42 }
43 else
44- clangNoMarch;
4546 # Overrides that create a useful environment for swift packages, allowing
47 # packaging with `swiftPackages.callPackage`. These are similar to
···25 #
26 # The following selects the correct Clang version, matching the version
27 # used in Swift, and applies the same libc overrides as `apple_sdk.stdenv`.
28+ clang = if pkgs.stdenv.isDarwin
000029 then
30+ swiftLlvmPackages.clang.override rec {
31 libc = apple_sdk.Libsystem;
32 bintools = pkgs.bintools.override { inherit libc; };
33 # Ensure that Swift’s internal clang uses the same libc++ and libc++abi as the
···37 inherit (llvmPackages) libcxx;
38 }
39 else
40+ swiftLlvmPackages.clang;
4142 # Overrides that create a useful environment for swift packages, allowing
43 # packaging with `swiftPackages.callPackage`. These are similar to