about summary refs log tree commit diff
path: root/pkgs/development/compilers/swift/swift-driver/patches/linux-fix-linking.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/swift/swift-driver/patches/linux-fix-linking.patch')
-rw-r--r--pkgs/development/compilers/swift/swift-driver/patches/linux-fix-linking.patch40
1 files changed, 0 insertions, 40 deletions
diff --git a/pkgs/development/compilers/swift/swift-driver/patches/linux-fix-linking.patch b/pkgs/development/compilers/swift/swift-driver/patches/linux-fix-linking.patch
deleted file mode 100644
index 8f91b3a234b5..000000000000
--- a/pkgs/development/compilers/swift/swift-driver/patches/linux-fix-linking.patch
+++ /dev/null
@@ -1,40 +0,0 @@
---- a/Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift
-+++ b/Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift
-@@ -10,6 +10,7 @@
- //
- //===----------------------------------------------------------------------===//
- 
-+import Foundation
- import SwiftOptions
- 
- import func TSCBasic.lookupExecutablePath
-@@ -120,7 +121,20 @@ extension GenericUnixToolchain {
-       // just using `clang` and avoid a dependency on the C++ runtime.
-       let clangTool: Tool =
-         parsedOptions.hasArgument(.enableExperimentalCxxInterop) ? .clangxx : .clang
--      var clangPath = try getToolPath(clangTool)
-+
-+      // For Nix, prefer linking using the wrapped system clang, instead of using
-+      // the unwrapped clang packaged with swift. The latter is unable to link, but
-+      // we still want to use it for other purposes (clang importer).
-+      var clangPath: AbsolutePath
-+      let env = ProcessInfo.processInfo.environment
-+      if let nixCC = env["NIX_CC"],
-+         let binPath = try? AbsolutePath(validating: "\(nixCC)/bin"),
-+         let tool = lookupExecutablePath(filename: parsedOptions.hasArgument(.enableExperimentalCxxInterop)
-+                                                        ? "clang++" : "clang",
-+                                         searchPaths: [binPath]) {
-+        clangPath = tool
-+      } else {
-+      clangPath = try getToolPath(clangTool)
-       if let toolsDirPath = parsedOptions.getLastArgument(.toolsDirectory) {
-         // FIXME: What if this isn't an absolute path?
-         let toolsDir = try AbsolutePath(validating: toolsDirPath.asSingle)
-@@ -136,6 +150,7 @@ extension GenericUnixToolchain {
-         commandLine.appendFlag("-B")
-         commandLine.appendPath(toolsDir)
-       }
-+      } // nixCC
- 
-       // Executables on Linux get -pie
-       if targetTriple.os == .linux && linkerOutputType == .executable {