srividya-sundaram wrote:

> For MSVC hosts, `clang-linker-wrapper` misparses MSVC flags as GNU linker 
> options.
> 
> ```
> clang-linker-wrapper --host-triple=x86_64-pc-windows-msvc ... -link -LTCG
> ```
> 
> Incorrect output:
> 
> ```
> link.exe ... -l ink -L TCG
> ```
> 
> Expected output:
> 
> ```
> link.exe ... -link -LTCG
> ```
> 
> Skip GNU `-l`/`-L` parsing for MSVC hosts. Keep the existing behavior for 
> GNU-style hosts, including `windows-gnu`, and add tests for both.



Could you share the `-v` output of the build where you first saw this error, 
run on Windows, with and without your patch? 

I'd like to see two things:
- the exact `clang-linker-wrapper` command line, and
- what the host linker (`link.exe` or `lld-link`) receives, and whether the 
link succeeds.

I ask because, on Linux with `--target=x86_64-pc-windows-msvc` (using `-###` 
and `--dry-run`), upstream `clang-cl` passes the second `/link` to 
`clang-linker-wrapper` as `/link` (slash), and `clang-linker-wrapper` treats it 
as an input file and passes it through, even without this patch. 

Only the dash form (`-link`, `-LTCG`) breaks. If your failing build passed 
`/link`, then something before `clang-linker-wrapper` may be turning it into 
`-link`.

Could you also add the real command to the PR description?


https://github.com/llvm/llvm-project/pull/243300
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to