[llvm-bugs] [Bug 47527] New: LLD fails for paths with whitespace if options passed by file (@)
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Sep 14 12:26:47 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=47527
Bug ID: 47527
Summary: LLD fails for paths with whitespace if options passed
by file (@)
Product: lld
Version: unspecified
Hardware: PC
OS: other
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: unassignedbugs at nondot.org
Reporter: zulliger at software-natives.ch
CC: llvm-bugs at lists.llvm.org, smithp352 at googlemail.com
I’m using LLD from LLVM 10.0 Windows/64Bit (downloaded as precompiled binaries)
as a “drop-in” for GNU Gold on Windows 10/64Bit. I’m using a third-party GCC 7
cross toolchain targetting PowerPC (but that probably doesn’t matter. The
toolchain is unpatched in respect to the topic discussed here).
collect2.exe calls “the linker”, e.g. ld.exe passing in all options in a
“options file”, such as in `c:\thetoolchain\powerpc-indel-eabi\bin\ld.exe
@c:\users\…\temp\fjoiu32d`. In my particular case, some paths contain spaces
and LLD seems to fail to correctly interpret them. Here’s how collect2.exe puts
the paths in the options file:
```
-Bstatic
-o
D39x.elf
-Lw:/common/lib/611042000\ GIN-PCIe\ Debug
-LW:/xxx/RTOS/Lib45/611042000\ GIN-PCIe\ Debug
-Lc:/imd/toolchain/gcc-7/bin/../lib/gcc/powerpc-indel-eabi/7.2.0/e500v2
```
By experimenting, I’ve found that LLD could properly handle paths with spaces
if the paths would be in the following form (no '\' but enclosed in '"')
```
-Bstatic
-o
D39x.elf
"-Lw:/common/lib/611042000 GIN-PCIe Debug"
"-LW:/xxx/RTOS/Lib45/611042000 GIN-PCIe Debug"
-Lc:/imd/toolchain/gcc-7/bin/../lib/gcc/powerpc-indel-eabi/7.2.0/e500v2
```
But since I don’t like to adjust the GNU toolchain, and since LLD is meant to
be useful as a drop-in, I believe LLVM should add support for the "path with
spaces”-style currently used by GCC.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200914/10cdc132/attachment.html>
More information about the llvm-bugs
mailing list