Skip to content

[5.9.0] Remove <toolchain>/usr/bin/../lib/ from directories passed to linker to look up libraries for target triple #6844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,5 @@ Valeriy Van <[email protected]> <[email protected]>
Valeriy Van <[email protected]> <[email protected]>
therealbnut <[email protected]> <[email protected]>
therealbnut <[email protected]> <[email protected]>
buttaface <[email protected]> <[email protected]>
buttaface <[email protected]> <[email protected]>
finagolfin <[email protected]> <[email protected]>
finagolfin <[email protected]> <[email protected]>
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,6 @@ public final class ProductBuildDescription: SPMBuildCore.ProductBuildDescription
args += ["-L", librarySearchPath.pathString]
}

// 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]
}

// Library search path for the toolchain's copy of SwiftSyntax.
#if BUILD_MACROS_AS_DYLIBS
if product.type == .macro {
Expand Down
5 changes: 1 addition & 4 deletions Tests/BuildTests/BuildPlanTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3409,11 +3409,8 @@ final class BuildPlanTests: XCTestCase {
}

func testExtraBuildFlags() throws {
let libpath = AbsolutePath("/fake/path/lib")

let fs = InMemoryFileSystem(emptyFiles:
"/A/Sources/exe/main.swift",
libpath.appending(components: "libSomething.dylib").pathString,
"<end>"
)

Expand Down Expand Up @@ -3444,7 +3441,7 @@ final class BuildPlanTests: XCTestCase {
))

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

func testUserToolchainCompileFlags() throws {
Expand Down