This is a follow-up of e92d2b80c6c9 ("[Driver] Detect libstdc++ include
paths for native gcc (-m32 and -m64) on Debian i386") for the Debian Hurd
case, which has the same multiarch name reduction from i686 to i386.
i386-linux-gnu is actually Linux-only, so this moves the code of that commit
to Linux.cpp, and adds the same to Hurd.cpp
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Driver/ToolChains/Gnu.cpp | ||
---|---|---|
3014–3017 | I'd be glad if we could use GCCInstallation.isValid(). However, @thakis has a chromium usage where lib/gcc/$triple/crtbegin.o is not provided while compile-only libstdc++ search paths are expected. For now, use GCCInstallation.isValid() ? GCCInstallation.getTriple().str() : "" | |
3018 | No need for a blank line | |
clang/test/Driver/hurd.cpp | ||
6 | -### cannot detect unused warning options: clang -Wfoobar '-###' a.cc -c => no warning It is probably not the test's task to check it. | |
10 | Windows may use backslashes in some places. | |
22 | {{^}} is important, otherwise a new addition cannot be detected. |
Fix GCCInstallation.isValid use in Generic_GCC::addLibStdCxxIncludePaths
Fix test further
clang/test/Driver/hurd.cpp | ||
---|---|---|
5 | The target should exactly match the hurd triple. Other aliases are supported but should be considered discouraged. Driver testing is difficult. Good to test -DCLANG_DEFAULT_RTLIB=compiler-rt -DCLANG_DEFAULT_CXX_STDLIB=libc++ as well whether you need to fix some options. If hurd.c has now duplicated testing for some properties, consider dropping it. We should try making tests orthogonal. | |
21 | You probably missed that I used "-L as the first line value (also note that the thing after CHECK: is aligned). The ensures the test can catch the case when a "-L" is added to the start of the list. |
Move all tests to hurd.cpp
clang/test/Driver/hurd.cpp | ||
---|---|---|
5 |
Well, i386-pc-gnu is the GCC triplet for hurd on x86. i386-pc-hurd-gnu is llvm-only. Alright anyway.
Ok I have moved everything from hurd.c to hurd.cpp. | |
21 | I noticed that afterwards indeed, fixed so. |
LGTM.
clang/test/Driver/hurd.cpp | ||
---|---|---|
22 | Since we now unsupport Windows, {{/|\\\\}} -> / Consider replacing gcc 4.6.0 with the actual gcc version which may be higher, just to reflect the truth. But perhaps these cleanups can be done separately. | |
50 | Drop {{(.exe)?}} I think "{{.*}}ld{{(.exe)?}}" can be cleaned as well. Is it i686-gnu-ld if you add a fake executable bin/i686-gnu-ld? |
simplify
clang/lib/Driver/ToolChains/Gnu.cpp | ||
---|---|---|
3014–3017 | Sorry, I noticed that we can just ignore !GCCInstallation.isValid(). The chromium usage should still work. |
clang/lib/Driver/ToolChains/Gnu.cpp | ||
---|---|---|
3014–3017 | Ok! |
I'd be glad if we could use GCCInstallation.isValid().
However, @thakis has a chromium usage where lib/gcc/$triple/crtbegin.o is not provided while compile-only libstdc++ search paths are expected.
For now, use GCCInstallation.isValid() ? GCCInstallation.getTriple().str() : ""