Commit Graph

3 Commits

Author SHA1 Message Date
Nico Weber c6a1b16db7 clang: try to fix Driver/undefined-libs.cpp on non-linux 2021-02-10 09:45:04 -05:00
Timm Bäder 6f9db455a5 [clang][NFC] Fix undefined-libs tests
Not all platforms accept -stdlib or -rtlib. Instead of complaining about
the wrong argument to these options, clang complains about the option
itself being present.

Pass an appropriate -target to the clang invocations.
2021-02-10 15:01:09 +01:00
Timm Bäder a6439b5208 [clang][driver] Only warn once about invalid library values
Since ToolChain::GetCXXStdlibType() is a simple getter that might emit
the "invalid library name in argument" warning, it can conceivably be
called several times while initializing the build pipeline.

Before this patch, a simple 'clang++ -stdlib=foo ./test.cpp' would print
the warning twice, -rt=lib=foo would print 6 times.

Change this and always only print the warning once. Keep the rest of the
semantics of the functions.

Differential Revision: https://reviews.llvm.org/D95915
2021-02-10 06:19:52 +01:00