diff options
Diffstat (limited to 'pkgs/development/compilers/swift/swift-driver/patches')
4 files changed, 0 insertions, 101 deletions
diff --git a/pkgs/development/compilers/swift/swift-driver/patches/disable-catalyst.patch b/pkgs/development/compilers/swift/swift-driver/patches/disable-catalyst.patch deleted file mode 100644 index b9eb23f21061..000000000000 --- a/pkgs/development/compilers/swift/swift-driver/patches/disable-catalyst.patch +++ /dev/null @@ -1,17 +0,0 @@ -Tries to parse SDKSettings.plist looking for a Catalyst version map, but we -don't currently support this. - ---- a/Sources/SwiftDriver/Toolchains/DarwinToolchain.swift -+++ b/Sources/SwiftDriver/Toolchains/DarwinToolchain.swift -@@ -297,11 +297,7 @@ public final class DarwinToolchain: Toolchain { - debugDescription: "Malformed version string") - } - self.version = version -- if self.canonicalName.hasPrefix("macosx") { -- self.versionMap = try keyedContainer.decode(VersionMap.self, forKey: .versionMap) -- } else { - self.versionMap = VersionMap() -- } - } - - 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 { diff --git a/pkgs/development/compilers/swift/swift-driver/patches/nix-resource-root.patch b/pkgs/development/compilers/swift/swift-driver/patches/nix-resource-root.patch deleted file mode 100644 index 8c24db5aad1d..000000000000 --- a/pkgs/development/compilers/swift/swift-driver/patches/nix-resource-root.patch +++ /dev/null @@ -1,28 +0,0 @@ -Swift normally looks for the Clang resource dir in a subdir/symlink of its own -resource dir. We provide a symlink to the Swift build-time Clang as a default -there, but we also here patch a check to try locate it via NIX_CC. - ---- a/Sources/SwiftDriver/Jobs/Toolchain+LinkerSupport.swift -+++ b/Sources/SwiftDriver/Jobs/Toolchain+LinkerSupport.swift -@@ -10,6 +10,7 @@ - // - //===----------------------------------------------------------------------===// - -+import Foundation - import SwiftOptions - - import protocol TSCBasic.FileSystem -@@ -26,6 +27,13 @@ extension Toolchain { - for targetInfo: FrontendTargetInfo, - parsedOptions: inout ParsedOptions - ) throws -> VirtualPath { -+ let env = ProcessInfo.processInfo.environment -+ if let nixCC = env["NIX_CC"] { -+ return try VirtualPath(path: nixCC) -+ .appending(components: "resource-root", "lib", -+ targetInfo.target.triple.platformName(conflatingDarwin: true)!) -+ } -+ - return VirtualPath.lookup(targetInfo.runtimeResourcePath.path) - .appending(components: "clang", "lib", - targetInfo.target.triple.platformName(conflatingDarwin: true)!) diff --git a/pkgs/development/compilers/swift/swift-driver/patches/prevent-sdk-dirs-warnings.patch b/pkgs/development/compilers/swift/swift-driver/patches/prevent-sdk-dirs-warnings.patch deleted file mode 100644 index 6080865ebe37..000000000000 --- a/pkgs/development/compilers/swift/swift-driver/patches/prevent-sdk-dirs-warnings.patch +++ /dev/null @@ -1,16 +0,0 @@ -Prevents a user-visible warning on every compilation: - - ld: warning: directory not found for option '-L.../MacOSX11.0.sdk/usr/lib/swift' - ---- a/Sources/SwiftDriver/Jobs/Toolchain+LinkerSupport.swift -+++ b/Sources/SwiftDriver/Jobs/Toolchain+LinkerSupport.swift -@@ -50,7 +50,9 @@ extension Toolchain { - result.append(sdkPath.appending(components: "System", "iOSSupport", "usr", "lib", "swift")) - } - -+ if sdkPath.absolutePath?.pathString.starts(with: "@storeDir@") == false { - result.append(sdkPath.appending(components: "usr", "lib", "swift")) -+ } - } - - return result |