[PATCH] D149978: [Clang][NVPTX] Allow passing arguments to the linker while standalone

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 5 14:17:03 PDT 2023


jhuber6 added a comment.

In D149978#4323221 <https://reviews.llvm.org/D149978#4323221>, @tra wrote:

> In D149978#4323210 <https://reviews.llvm.org/D149978#4323210>, @jhuber6 wrote:
>
>> Somewhat annoying, I've discovered that LLVM adds `-Wl,-fcolor-diagnostics` which obviously isn't supported by `nvlink` so it fails while including this in `libc`'s CMake. Any clue if there's a way to work around that?
>
> I guess the options are to either filter out the automatically added option or to avoid adding that particular argument if we know that the target is NVPTX. The latter would probably be preferable as there would be only one place where the decision is made.

The latter is a little difficult, the logic adds it based off of the host linker, but we explicitly override the host triple when we build via `--target=`. So there's be no way to turn it off in LLVM unless it's a blanket check on building `libc`. And since it's a global flag I can't just disable it only for the target. So I think the options are, either filter it out manually here or make a new flag called `-Xcuda-nvlink`, which I wouldn't like to do.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149978/new/

https://reviews.llvm.org/D149978



More information about the cfe-commits mailing list