Skip to content

Commit a337984

Browse files
kabiroberaiMaxDesiatov
authored andcommitted
Fix forwarding of -ld-path
The Clang linker driver spells this as --ld-path so we can't forward the argument wholesale anymore, since we spell it -ld-path. (cherry picked from commit 9a357ee) # Conflicts: # Sources/SwiftDriver/Jobs/WindowsToolchain+LinkerSupport.swift
1 parent b2488ae commit a337984

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

Sources/SwiftDriver/Jobs/DarwinToolchain+LinkerSupport.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ extension DarwinToolchain {
181181
commandLine.appendFlag("-fuse-ld=\(arg.asSingle)")
182182
}
183183

184-
try commandLine.appendLast(.ldPath, from: &parsedOptions)
184+
if let arg = parsedOptions.getLastArgument(.ldPath)?.asSingle {
185+
commandLine.append(.joinedOptionAndPath("--ld-path=", try VirtualPath(path: arg)))
186+
}
185187

186188
let fSystemArgs = parsedOptions.arguments(for: .F, .Fsystem)
187189
for opt in fSystemArgs {

Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ extension GenericUnixToolchain {
101101
}
102102
}
103103

104-
try commandLine.appendLast(.ldPath, from: &parsedOptions)
104+
if let arg = parsedOptions.getLastArgument(.ldPath)?.asSingle {
105+
commandLine.append(.joinedOptionAndPath("--ld-path=", try VirtualPath(path: arg)))
106+
}
105107

106108
// Configure the toolchain.
107109
//

Sources/SwiftDriver/Jobs/WebAssemblyToolchain+LinkerSupport.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ extension WebAssemblyToolchain {
4343
commandLine.appendFlag("-fuse-ld=\(linkerArg)")
4444
}
4545

46-
try commandLine.appendLast(.ldPath, from: &parsedOptions)
46+
if let arg = parsedOptions.getLastArgument(.ldPath)?.asSingle {
47+
commandLine.append(.joinedOptionAndPath("--ld-path=", try VirtualPath(path: arg)))
48+
}
4749

4850
// Configure the toolchain.
4951
//

0 commit comments

Comments
 (0)