[compiler-rt] [compiler-rt] Initial support for builtins on GPU targets (PR #95304)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 10:09:35 PDT 2024


jhuber6 wrote:

> There are two ways to build compiler-rt:
> 
>     1. The old way in theory supports building for multiple targets in a single build, but in practice only reliably works for sufficiently similar targets like x86 and x86-64 or different flavors of arm32. The target is controlled by `-DCOMPILER_RT_DEFAULT_TARGET`.
> 
>     2. The new way which builds only for a single target at a time, relying on `-DCMAKE_<LANG>_COMPILER_TARGET`. You also need to set `-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON` to disable the legacy logic. This is used by the runtimes build.
> 
> 
> I'd like to eventually fully deprecate (1) and make (2) the only way since (1) is a maintenance nightmare: it doesn't use standard CMake logic, instead it invokes Clang directly as `add_custom_target`, has its own way of handling flags, etc.

Okay, (2) is basically what I've been testing this against. I've run into some issues getting it to work in the runtimes case however.  This seems to stem from the fact that we have a separate `LLVM_BUILTIN_TARGETS`. I'd like to populate that automatically if not set for every `LLVM_RUNTIME_TARGETS` that contains `compiler-rt`. Is that reasonable?

https://github.com/llvm/llvm-project/pull/95304


More information about the llvm-commits mailing list