<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64009>64009</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang: Arguments taking comma-separated arguments cannot deal with nested commas
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          vext01
      </td>
    </tr>
</table>

<pre>
    For example, this works:

```
$ clang -flto -fuse-ld=lld -Xlinker --lto-newpm-passes=instcombine,sroa /tmp/a.c
$
```

But this does not:
```
$ clang -flto -fuse-ld=lld -Wl,--lto-newpm-passes=instcombine,sroa /tmp/a.c
ld.lld: error: cannot open sroa: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

The problem is, `-Wl` expects a comma separated list, but so does the underlying linker argument and there's no way to disambiguate it.

None of the following work:
 - `Wl,--lto-newpm-passes=instcombine,sroa`
 - `Wl,"--lto-newpm-passes=instcombine,sroa"`
 - `Wl,--lto-newpm-passes="instcombine,sroa"`
 - `Wl,--lto-newpm-passes=instcombine\,sroa`

Not so bad for `-Wl` since we can workaround with `-Xlinker`, but what other options don't have a workaround?

Cheers
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVE1v6zYQ_DXUZSFDWvlLBx3yEuj4TgXaKyWuLDYUVyBXdvLvC8qO4xZB0fQBhmwLu7PDmVnqGO3JEzVq90PtXjK9yMihOdObFGXWsXlvWg5Ab3qaHSl8BhlthAuH16iqJ1W8qOLjuS9un-tf3ELvtD9BPjhhyIclUu6Mql6cM5D_4ax_pQB57oRzT5d5ymcdI0VVvVgfpeepsz7NjIE1KGxlmhW2etPfJ3w9eX3-WOTK1TBF8CyfdL9H9Hen8Pn_s3Rm4xLYE1AIHNKPXnvPAjyTh9SV3v1kiEs_wmAdAQcwNlAvHN6vKCvBv4Hc5Ot5mrQ3MGjryMDFygj0ZgV6NgQlKDwukSA_gzBEIrD-zL0Wy15h_S_6_TYSzIE7RxPYmJxX-yKJsS-A3mbqJYK-jodIsw5ayICzUVJttwhEvmovI8HiDQX3bv3pg7gOp2UiL5DYy0iBFB6SUXDR74mssVFPnT0tWgisbB7J_WRPwMMKPbBzfEnIKZV3lyFPhL9j3l2Ah1aF-F-7Eb8C-LJbIf4awGP37vmf_D80Wi3otIGBw4N70fqe4EIph6tmOvDib9lJZbfVTHg3Ky-jFuDkEvCcspPWyis8CIz6TKAfcFTVPtJ4HolCzExTmbqqdUZNuT_W9XZ32B2zsdlu94SHuj50pS6Pu3o7FFRif-wq6oZd3WW2wQKr4oBlWSFWx82-3vVUY192VB10ZdS2oElbt3HuPG04nDIb40LNflsUdeZ0Ry6u1xvidYsQ000XmlSfd8spqm2Rchs_EcSKo-a-dE-3rEYQ_ZqStsY-_4y9vhfcdtuQdldBPcVUsXbEbAmuGUXm9fLEVmF7sjIu3abnSWGbCNy-8jnwn9SLwnY9T1TYrkf6KwAA__-KDsxW">