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 }