<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - LLD fails for paths with whitespace if options passed by file (@)"
   href="https://bugs.llvm.org/show_bug.cgi?id=47527">47527</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLD fails for paths with whitespace if options passed by file (@)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>zulliger@software-natives.ch
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, smithp352@googlemail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>