[PATCH] D109624: [clang] Make the driver not diagnose errors on nonexistent linker inputs

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 10 12:34:47 PDT 2021


thakis added a comment.

> I wonder if there are deeper reasons for GCC and Clang's current behaviour than early diagnosis and slightly nicer error messages.

One easy way to find out is land this and if it breaks something, add a comment and a test for the next person :)

> Since cl.exe seems to match the behaviour your patch is switching to, maybe we should only do this in clang-cl mode?

Maybe! But the current behavior is arguably wrong for the `clang -fuse-ld=lld -Wl,-chroot,some/path /foo.o` case, so maybe we should try changing both for starters and then row back if needed?



================
Comment at: clang/lib/Driver/Driver.cpp:2165
+  // So do not diagnose this on the driver level. Rely on the linker diagnosing
+  // it. (If we don't end up invoking the driver, this means we'll emit a
+  // "'linker' input unused [-Wunused-command-line-argument]" warning instead
----------------
hans wrote:
> you mean "If we don't end up invoking the *linker*"?
Err, yes.


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

https://reviews.llvm.org/D109624



More information about the llvm-commits mailing list