You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[lld][ELF] Only convert dependency filename to native form on Windows
Currently, llvm::sys::path::native is used unconditionally when
generating dependency filenames. This is correct on Windows, where
backslashes are valid path separators, but can be incorrect on
non-Windows platforms, because in that case backslashes in the
filenames are converted to forward slashes, while they should be treated
as ordinary characters.
This fixes the following inconsistency between ld.lld and ld.bfd:
$ cat test.s
.globl _start
_start:
$ cc -c test.s -o "back\\slash.o"
$ ld.lld -o test "back\\slash.o" --dependency-file=/dev/stdout
test: \
back/slash.o
back/slash.o:
$ ld.bfd -o test "back\\slash.o" --dependency-file=/dev/stdout
test: \
back\slash.o
back\slash.o:
In addition, while we're here, use 2-space indentation when printing out
dependency filenames (consistent with Clang and ld.bfd), and escape the
filename of the target (output file) too.
Signed-off-by: Ruoyu Zhong <[email protected]>
0 commit comments