Skip to content

Commit fab4533

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

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

.mailmap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,5 @@ Tim Gymnich <[email protected]> <[email protected]>
101101
102102
103103
104-
105-
104+
105+

Sources/Build/BuildDescription/ProductBuildDescription.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,6 @@ public final class ProductBuildDescription: SPMBuildCore.ProductBuildDescription
314314
args += ["-L", librarySearchPath.pathString]
315315
}
316316

317-
// Add toolchain's libdir at the very end (even after the user -Xlinker arguments).
318-
//
319-
// This will allow linking to libraries shipped in the toolchain.
320-
let toolchainLibDir = try buildParameters.toolchain.toolchainLibDir
321-
if self.fileSystem.isDirectory(toolchainLibDir) {
322-
args += ["-L", toolchainLibDir.pathString]
323-
}
324-
325317
// Library search path for the toolchain's copy of SwiftSyntax.
326318
#if BUILD_MACROS_AS_DYLIBS
327319
if product.type == .macro {

Tests/BuildTests/BuildPlanTests.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3518,11 +3518,8 @@ final class BuildPlanTests: XCTestCase {
35183518
}
35193519

35203520
func testExtraBuildFlags() throws {
3521-
let libpath = AbsolutePath("/fake/path/lib")
3522-
35233521
let fs = InMemoryFileSystem(emptyFiles:
35243522
"/A/Sources/exe/main.swift",
3525-
libpath.appending(components: "libSomething.dylib").pathString,
35263523
"<end>"
35273524
)
35283525

@@ -3553,7 +3550,7 @@ final class BuildPlanTests: XCTestCase {
35533550
))
35543551

35553552
let exe = try result.buildProduct(for: "exe").linkArguments()
3556-
XCTAssertMatch(exe, [.anySequence, "-L", "/path/to/foo", "-L/path/to/foo", "-Xlinker", "-rpath=foo", "-Xlinker", "-rpath", "-Xlinker", "foo", "-L", "\(libpath)"])
3553+
XCTAssertMatch(exe, [.anySequence, "-L", "/path/to/foo", "-L/path/to/foo", "-Xlinker", "-rpath=foo", "-Xlinker", "-rpath", "-Xlinker", "foo"])
35573554
}
35583555

35593556
func testUserToolchainCompileFlags() throws {

0 commit comments

Comments
 (0)