Files
termux-packages/packages/swift/swiftpm-Sources-Build-BuildPlan.swift.patch
termux-pacman-bot cf4874e3ee fix(swift): cross-compilation of Swift packages broke now that the runtime libraries were moved to $PREFIX/lib
Remove the lines in the Swift package manager that automatically added that directory
when building, as we already have our clang patch to add the right directory.
2023-04-13 16:33:57 +00:00

22 lines
1.0 KiB
Diff

This breaks cross-compilation of Swift packages after moving the runtime libraries to $PREFIX/lib.
diff --git a/swiftpm/Sources/Build/BuildPlan.swift b/swiftpm/Sources/Build/BuildPlan.swift
index 08104f1cf..de93111c5 100644
--- a/swiftpm/Sources/Build/BuildPlan.swift
+++ b/swiftpm/Sources/Build/BuildPlan.swift
@@ -1538,15 +1538,6 @@ public final class ProductBuildDescription: SPMBuildCore.ProductBuildDescription
// User arguments (from -Xlinker and -Xswiftc) should follow generated arguments to allow user overrides
args += buildParameters.linkerFlags
args += stripInvalidArguments(buildParameters.swiftCompilerFlags)
-
- // Add toolchain's libdir at the very end (even after the user -Xlinker arguments).
- //
- // This will allow linking to libraries shipped in the toolchain.
- let toolchainLibDir = try buildParameters.toolchain.toolchainLibDir
- if self.fileSystem.isDirectory(toolchainLibDir) {
- args += ["-L", toolchainLibDir.pathString]
- }
-
return args
}