When the target is hexagon-unknown-linux-musl select lld as the default linker.
Details
Diff Detail
Event Timeline
This does not take into account CLANG_DEFAULT_LINKER, resulting in a check-clang failure:
$ cmake -GNinja \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_CXX_COMPILER=clang++ \ -DLLVM_ENABLE_PROJECTS=clang \ -DPYTHON_EXECUTABLE=$(command -v python3) \ ../llvm && ninja check-clang ... Testing Time: 163.80s Expected Passes : 17055 Expected Failures : 23 Unsupported Tests : 55 $ cmake -GNinja \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_CXX_COMPILER=clang++ \ -DLLVM_ENABLE_PROJECTS=clang \ -DPYTHON_EXECUTABLE=$(command -v python3) \ -DCLANG_DEFAULT_LINKER=lld \ ../llvm && ninja check-clang ... Testing Time: 176.55s ******************** Failing Tests (1): Clang :: Driver/hexagon-toolchain-elf.c Expected Passes : 17050 Expected Failures : 23 Unsupported Tests : 59 Unexpected Failures: 1
Weird -- the baseline didn't take CLANG_DEFAULT_LINKER into account either, though, right? Is it a regression?
Weird -- the baseline didn't take CLANG_DEFAULT_LINKER into account either, though, right?
I assume by baseline you mean the test before this change? It does not seem like it.
Is it a regression?
I guess not but the test is still broken when CLANG_DEFAULT_LINKER is set.
These are new tests how do you get the generic lld driver to work? When I invoke it using just "lld" I need to add -flavor gnu or I get this error:
Invoke ld.lld (Unix), ld64.lld (macOS), lld-link (Windows), wasm-ld (WebAssembly) instead
Since this isn't something that can be always known in advance I think the testcase should just be removed.
Why not just check if CLANG_DEFAULT_LINKER is empty?
const char *getDefaultLinker() const override { StringRef ClangDefault = CLANG_DEFAULT_LINKER; return ClangDefault.isEmpty() ? (getTriple().isMusl() ? "ld.lld" : "hexagon-link") : ClangDefault.str(); }
These are new tests how do you get the generic lld driver to work?
It doesn't, Clang invokes the appropriate driver in ToolChain::GetLinkerPath(): https://github.com/llvm/llvm-project/blob/6011627f5118dd64a0c33694b604c70e766d8c40/clang/lib/Driver/ToolChain.cpp#L537-L541