[llvm] [offload][flang-rt] Fix NVPTX runtime build (PR #180530)

Robert Imschweiler via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 9 07:11:55 PST 2026


ro-i wrote:

The recent change was that I used the config from https://github.com/llvm/llvm-project/blob/main/offload/cmake/caches/FlangOffload.cmake, i.e. enabling flang-rt for the GPUs. The current issue is that the flang-rt cmake config is *not* correctly disabling the non-existent functions because that check:

https://github.com/llvm/llvm-project/blob/7de4eb97d9c07d44a1460cc30b6f26fbdf77416e/flang-rt/CMakeLists.txt#L233-L240

doesn't work correctly for NVPTX because it has `-c`:

https://github.com/llvm/llvm-project/blob/7de4eb97d9c07d44a1460cc30b6f26fbdf77416e/libcxx/cmake/caches/NVPTX.cmake#L39-L39

which means that no linking is performed. Since there is no `-nostdlibinc`, the symbol is found in the host (!) headers. And since there is no linking performed, the check doesn't run into the linker error.

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


More information about the llvm-commits mailing list