Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Revert "swift: don't pass -march to swiftc"

This reverts commit 8a7841ceef0a7c7794174178de786ae76cc27457.

Sam f86158cd 9fd2efac

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