Skip to content

Commit 5b38348

Browse files
committed
Use --ld-path from Swift Driver
1 parent 9ca669c commit 5b38348

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/PackageModel/UserToolchain.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ public final class UserToolchain: Toolchain {
331331
var swiftCompilerFlags = swiftSDK.toolset.knownTools[.swiftCompiler]?.extraCLIOptions ?? []
332332

333333
if let linker = swiftSDK.toolset.knownTools[.linker]?.path {
334-
swiftCompilerFlags += ["-Xclang-linker", "--ld-path=\(linker)"]
334+
swiftCompilerFlags += ["--ld-path=\(linker)"]
335335
}
336336

337337
guard let sdkDir = swiftSDK.pathsConfiguration.sdkRootPath else {

Tests/BuildTests/BuildPlanTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3689,7 +3689,7 @@ final class BuildPlanTests: XCTestCase {
36893689
let exeCompileArguments = try result.target(for: "exe").swiftTarget().compileArguments()
36903690
let exeCompileArgumentsPattern: [StringPattern] = [
36913691
jsonFlag(tool: .swiftCompiler),
3692-
"-Xclang-linker", "--ld-path=/fake/toolchain/usr/bin/linker",
3692+
"--ld-path=/fake/toolchain/usr/bin/linker",
36933693
"-g", cliFlag(tool: .swiftCompiler),
36943694
.anySequence,
36953695
"-Xcc", jsonFlag(tool: .cCompiler), "-Xcc", "-g", "-Xcc", cliFlag(tool: .cCompiler),
@@ -3714,7 +3714,7 @@ final class BuildPlanTests: XCTestCase {
37143714
let exeLinkArguments = try result.buildProduct(for: "exe").linkArguments()
37153715
let exeLinkArgumentsPattern: [StringPattern] = [
37163716
jsonFlag(tool: .swiftCompiler),
3717-
"-Xclang-linker", "--ld-path=/fake/toolchain/usr/bin/linker",
3717+
"--ld-path=/fake/toolchain/usr/bin/linker",
37183718
"-g", cliFlag(tool: .swiftCompiler),
37193719
.anySequence,
37203720
"-Xlinker", jsonFlag(tool: .linker), "-Xlinker", cliFlag(tool: .linker),

0 commit comments

Comments
 (0)