Skip to content

Commit

Permalink
Remove <toolchain>/usr/bin/../lib/ from directories passed to linker …
Browse files Browse the repository at this point in the history
…to look up libraries for target triple (swiftlang#6824)

Also, update my github username in the mailmap.

Resolves swiftlang#6767
  • Loading branch information
finagolfin committed Aug 23, 2023
1 parent 2dbd2ee commit a101cfb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
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]>
8 changes: 0 additions & 8 deletions Sources/Build/BuildDescription/ProductBuildDescription.swift
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

0 comments on commit a101cfb

Please sign in to comment.