Skip to content

Only pass --rsp-quoting=windows to clang #1717

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

Merged
merged 1 commit into from
Oct 25, 2024
Merged
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
9 changes: 0 additions & 9 deletions Sources/SwiftDriver/Jobs/LinkJob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@ extension Driver {
mutating func linkJob(inputs: [TypedVirtualPath]) throws -> Job {
var commandLine: [Job.ArgTemplate] = []

#if os(Windows)
// We invoke clang as `clang.exe`, which expects a POSIX-style response file by default (`clang-cl.exe` expects
// Windows-style response files).
// The driver is outputting Windows-style response files because swift-frontend expects Windows-style response
// files.
// Force `clang.exe` into parsing Windows-style response files.
commandLine.appendFlag("--rsp-quoting=windows")
#endif

// Compute the final output file
let outputFile: VirtualPath
if let output = parsedOptions.getLastArgument(.o) {
Expand Down
7 changes: 7 additions & 0 deletions Sources/SwiftDriver/Jobs/WindowsToolchain+LinkerSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ extension WindowsToolchain {
let clangTool: Tool = cxxCompatEnabled ? .clangxx : .clang
var clang = try getToolPath(clangTool)

// We invoke clang as `clang.exe`, which expects a POSIX-style response file by default (`clang-cl.exe` expects
// Windows-style response files).
// The driver is outputting Windows-style response files because swift-frontend expects Windows-style response
// files.
// Force `clang.exe` into parsing Windows-style response files.
commandLine.appendFlag("--rsp-quoting=windows")

let targetTriple = targetInfo.target.triple
if !targetTriple.triple.isEmpty {
commandLine.appendFlag("-target")
Expand Down