Skip to content

Commit 347e06c

Browse files
authored
Merge pull request #4434 from juj/backslashes_in_llvm_link_response_files
backslashes_in_llvm_link_response_files
2 parents 1248763 + 6fd9767 commit 347e06c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/shared.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,12 @@ def consider_archive(f):
15361536

15371537
response_fh = open(response_file, 'w')
15381538
for arg in actual_files:
1539+
# Starting from LLVM 3.9.0 trunk around July 2016, LLVM escapes backslashes in response files, so Windows paths
1540+
# "c:\path\to\file.txt" with single slashes no longer work. LLVM upstream dev 3.9.0 from January 2016 still treated
1541+
# backslashes without escaping. To preserve compatibility with both versions of llvm-link, don't pass backslash
1542+
# path delimiters at all to response files, but always use forward slashes.
1543+
if WINDOWS: arg = arg.replace('\\', '/')
1544+
15391545
# escaped double quotes allows 'space' characters in pathname the response file can use
15401546
response_fh.write("\"" + arg + "\"\n")
15411547
response_fh.close()

0 commit comments

Comments
 (0)