Skip to content

Commit 246b238

Browse files
authored
Remove <toolchain>/usr/bin/../lib/ from directories passed to linker to look up libraries for target triple (#6824) (#6837)
Also, update my github username in the mailmap. Resolves #6767
1 parent df48749 commit 246b238

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

.mailmap

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,5 @@ Valeriy Van <[email protected]> <[email protected]>
105105
106106
107107
108-
109-
108+
109+

Sources/Build/BuildDescription/ProductBuildDescription.swift

-8
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,6 @@ public final class ProductBuildDescription: SPMBuildCore.ProductBuildDescription
321321
args += ["-L", librarySearchPath.pathString]
322322
}
323323

324-
// Add toolchain's libdir at the very end (even after the user -Xlinker arguments).
325-
//
326-
// This will allow linking to libraries shipped in the toolchain.
327-
let toolchainLibDir = try buildParameters.toolchain.toolchainLibDir
328-
if self.fileSystem.isDirectory(toolchainLibDir) {
329-
args += ["-L", toolchainLibDir.pathString]
330-
}
331-
332324
// Library search path for the toolchain's copy of SwiftSyntax.
333325
#if BUILD_MACROS_AS_DYLIBS
334326
if product.type == .macro {

Tests/BuildTests/BuildPlanTests.swift

+1-4
Original file line numberDiff line numberDiff line change
@@ -3409,11 +3409,8 @@ final class BuildPlanTests: XCTestCase {
34093409
}
34103410

34113411
func testExtraBuildFlags() throws {
3412-
let libpath = AbsolutePath("/fake/path/lib")
3413-
34143412
let fs = InMemoryFileSystem(emptyFiles:
34153413
"/A/Sources/exe/main.swift",
3416-
libpath.appending(components: "libSomething.dylib").pathString,
34173414
"<end>"
34183415
)
34193416

@@ -3444,7 +3441,7 @@ final class BuildPlanTests: XCTestCase {
34443441
))
34453442

34463443
let exe = try result.buildProduct(for: "exe").linkArguments()
3447-
XCTAssertMatch(exe, [.anySequence, "-L", "/path/to/foo", "-L/path/to/foo", "-Xlinker", "-rpath=foo", "-Xlinker", "-rpath", "-Xlinker", "foo", "-L", "\(libpath)"])
3444+
XCTAssertMatch(exe, [.anySequence, "-L", "/path/to/foo", "-L/path/to/foo", "-Xlinker", "-rpath=foo", "-Xlinker", "-rpath", "-Xlinker", "foo"])
34483445
}
34493446

34503447
func testUserToolchainCompileFlags() throws {

0 commit comments

Comments
 (0)