[PATCH] D76240: [Sanitizers][Test] If the default linker is LLD, disable threads
Nemanja Ivanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 27 04:50:14 PDT 2020
nemanjai added a comment.
In D76240#1944755 <https://reviews.llvm.org/D76240#1944755>, @MaskRay wrote:
> > In D76240#1927115 <https://reviews.llvm.org/D76240#1927115>, @MaskRay wrote:
> > For lld, I think --threads={0,1,2,...} is better than the current --(no-)threads.
>
> I have a change to rename lld `--no-threads` to `--threads=N`. It takes more efforts to actually work because I need to patch `llvm::parallel::for_each_n` called by lld/include/lld/Common/Threads.h#L75
>
> Can the lit test run a system lld which may not support --threads= after --no-threads is removed?
Yes, they certainly can:
set(CLANG_DEFAULT_LINKER "" CACHE STRING
"Default linker to use (linker name or absolute path, empty for platform default)")
However, this patch wouldn't make them pass `--no-threads` for such cases since the string in `CLANG_DEFAULT_LINKER` won't be exactly `lld` (but rather a path to some custom version of `lld`).
Also, thank you for working on the `--threads=N` option. I think that can be a great usability improvement for LLD. Once this lands, I think it would be useful to add a couple of CMake variables:
`LIT_DEFAULT_LINKER_THREADS=N` - pass the option `-Wl,--threads=N` to the linker flags in sanitizer tests (i.e. replace what we check for in this patch)
`CLANG_DEFAULT_LINKER_THREADS=N` - pass the above option whenever clang is invoking the linker (i.e. a global value for the Clang we are building)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76240/new/
https://reviews.llvm.org/D76240
More information about the llvm-commits
mailing list