[clang] [LinkerWrapper] Accept some needed COFF linker arguments (PR #72889)

Michael Kruse via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 20 14:29:26 PST 2023


Meinersbur wrote:

The command-line argument handling is not related to [PE](https://en.wikipedia.org/wiki/Portable_Executable)/COFF, but to Microsoft's `link.exe` command line interface, for instance [`/libpath:`](https://learn.microsoft.com/en-us/cpp/build/reference/libpath-additional-libpath?view=msvc-170). `/usr/bin/lld-link` is a `link.exe`-compatible interface for lld with an appropriate default triple, like `clang-cl` is for `clang`. IIRC, `lld` choses its command-line interface based on the `argv[0]` name, so should clang-linker-wrapper when passed `--linker-path=/usr/bin/lld-link` instead of `--linker-path=/usr/bin/lld`, but both should be able to generate PE files.

That is, this patch is not necessarily wrong, but the commit message and "// COFF-style linker options." should refer to the command line interface instead.

https://github.com/llvm/llvm-project/pull/72889


More information about the cfe-commits mailing list