about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/swift/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/swift/default.nix')
-rw-r--r--nixpkgs/pkgs/development/compilers/swift/default.nix18
1 files changed, 7 insertions, 11 deletions
diff --git a/nixpkgs/pkgs/development/compilers/swift/default.nix b/nixpkgs/pkgs/development/compilers/swift/default.nix
index afb8ce39dcce..c111a8d86bfa 100644
--- a/nixpkgs/pkgs/development/compilers/swift/default.nix
+++ b/nixpkgs/pkgs/development/compilers/swift/default.nix
@@ -25,9 +25,13 @@ let
     #
     # The following selects the correct Clang version, matching the version
     # used in Swift, and applies the same libc overrides as `apple_sdk.stdenv`.
-    clang = if pkgs.stdenv.isDarwin
+    clang = let
+      # https://github.com/NixOS/nixpkgs/issues/295322
+      clangNoMarch = swiftLlvmPackages.clang.override { disableMarch = true; };
+    in
+    if pkgs.stdenv.isDarwin
       then
-        swiftLlvmPackages.clang.override rec {
+        clangNoMarch.override rec {
           libc = apple_sdk.Libsystem;
           bintools = pkgs.bintools.override { inherit libc; };
           # Ensure that Swift’s internal clang uses the same libc++ and libc++abi as the
@@ -35,17 +39,9 @@ let
           # that can happen when a Swift application dynamically links different versions
           # of libc++ and libc++abi than libraries it links are using.
           inherit (llvmPackages) libcxx;
-          extraPackages = [
-            llvmPackages.libcxxabi
-            # Use the compiler-rt associated with clang, but use the libc++abi from the stdenv
-            # to avoid linking against two different versions (for the same reasons as above).
-            (swiftLlvmPackages.compiler-rt.override {
-              inherit (llvmPackages) libcxxabi;
-            })
-          ];
         }
       else
-        swiftLlvmPackages.clang;
+        clangNoMarch;
 
     # Overrides that create a useful environment for swift packages, allowing
     # packaging with `swiftPackages.callPackage`. These are similar to