about summary refs log tree commit diff
path: root/pkgs/development/compilers/swift
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/swift')
-rw-r--r--pkgs/development/compilers/swift/compiler/default.nix1
-rw-r--r--pkgs/development/compilers/swift/compiler/patches/swift-darwin-link-cxxabi.patch14
-rw-r--r--pkgs/development/compilers/swift/default.nix18
-rw-r--r--pkgs/development/compilers/swift/foundation/default.nix1
-rw-r--r--pkgs/development/compilers/swift/sourcekit-lsp/default.nix1
-rw-r--r--pkgs/development/compilers/swift/swift-docc/default.nix1
6 files changed, 10 insertions, 26 deletions
diff --git a/pkgs/development/compilers/swift/compiler/default.nix b/pkgs/development/compilers/swift/compiler/default.nix
index 76c2da0a656a..cef1358aed73 100644
--- a/pkgs/development/compilers/swift/compiler/default.nix
+++ b/pkgs/development/compilers/swift/compiler/default.nix
@@ -284,7 +284,6 @@ in stdenv.mkDerivation {
     patch -p1 -d swift -i ${./patches/swift-linux-fix-libc-paths.patch}
     patch -p1 -d swift -i ${./patches/swift-linux-fix-linking.patch}
     patch -p1 -d swift -i ${./patches/swift-darwin-libcxx-flags.patch}
-    patch -p1 -d swift -i ${./patches/swift-darwin-link-cxxabi.patch}
     patch -p1 -d swift -i ${substituteAll {
       src = ./patches/swift-darwin-plistbuddy-workaround.patch;
       inherit swiftArch;
diff --git a/pkgs/development/compilers/swift/compiler/patches/swift-darwin-link-cxxabi.patch b/pkgs/development/compilers/swift/compiler/patches/swift-darwin-link-cxxabi.patch
deleted file mode 100644
index dad9b3285dc1..000000000000
--- a/pkgs/development/compilers/swift/compiler/patches/swift-darwin-link-cxxabi.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-This patches the stdlib backdeploy static lib to have its users link c++abi.
-Without this, later steps that try to link this fail looking for global
-new/delete operators (__Znwm/__ZdlPv).
-
---- a/stdlib/toolchain/Compatibility56/Overrides.cpp
-+++ b/stdlib/toolchain/Compatibility56/Overrides.cpp
-@@ -23,6 +23,7 @@
- using namespace swift;
- 
- __asm__ (".linker_option \"-lc++\"");
-+__asm__ (".linker_option \"-lc++abi\"");
- 
- #define OVERRIDE(name, ret, attrs, ccAttrs, namespace, typedArgs, namedArgs) \
-   Override_ ## name name;
diff --git a/pkgs/development/compilers/swift/default.nix b/pkgs/development/compilers/swift/default.nix
index afb8ce39dcce..c111a8d86bfa 100644
--- a/pkgs/development/compilers/swift/default.nix
+++ b/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
diff --git a/pkgs/development/compilers/swift/foundation/default.nix b/pkgs/development/compilers/swift/foundation/default.nix
index b0da48c68a95..eab509c5aaa1 100644
--- a/pkgs/development/compilers/swift/foundation/default.nix
+++ b/pkgs/development/compilers/swift/foundation/default.nix
@@ -63,6 +63,7 @@ in stdenv.mkDerivation {
 
   meta = {
     description = "Core utilities, internationalization, and OS independence for Swift";
+    mainProgram = "plutil";
     homepage = "https://github.com/apple/swift-corelibs-foundation";
     platforms = lib.platforms.linux;
     license = lib.licenses.asl20;
diff --git a/pkgs/development/compilers/swift/sourcekit-lsp/default.nix b/pkgs/development/compilers/swift/sourcekit-lsp/default.nix
index caba3e3441f3..a2dd73fefa13 100644
--- a/pkgs/development/compilers/swift/sourcekit-lsp/default.nix
+++ b/pkgs/development/compilers/swift/sourcekit-lsp/default.nix
@@ -67,6 +67,7 @@ stdenv.mkDerivation {
 
   meta = {
     description = "Language Server Protocol implementation for Swift and C-based languages";
+    mainProgram = "sourcekit-lsp";
     homepage = "https://github.com/apple/sourcekit-lsp";
     platforms = with lib.platforms; linux ++ darwin;
     license = lib.licenses.asl20;
diff --git a/pkgs/development/compilers/swift/swift-docc/default.nix b/pkgs/development/compilers/swift/swift-docc/default.nix
index e79487e7eded..5dec14eb475d 100644
--- a/pkgs/development/compilers/swift/swift-docc/default.nix
+++ b/pkgs/development/compilers/swift/swift-docc/default.nix
@@ -51,6 +51,7 @@ stdenv.mkDerivation {
 
   meta = {
     description = "Documentation compiler for Swift";
+    mainProgram = "docc";
     homepage = "https://github.com/apple/swift-docc";
     platforms = with lib.platforms; linux ++ darwin;
     license = lib.licenses.asl20;