[all-commits] [llvm/llvm-project] 640ba3: [libc] Fix standard cross build targeting the GPU ...

Joseph Huber via All-commits all-commits at lists.llvm.org
Fri Feb 23 10:00:12 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 640ba3f8d1dcf25d8b34ce463fb6a7d58e7dc998
      https://github.com/llvm/llvm-project/commit/640ba3f8d1dcf25d8b34ce463fb6a7d58e7dc998
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2024-02-23 (Fri, 23 Feb 2024)

  Changed paths:
    M libc/cmake/modules/LLVMLibCTestRules.cmake
    M libc/cmake/modules/prepare_libc_gpu_build.cmake

  Log Message:
  -----------
  [libc] Fix standard cross build targeting the GPU (#82724)

Summary:
The GPU target has recently been changed to support standard `libc`
build rules. This means we should be able to build for it both in
`LLVM_ENABLE_PROJECTS` mode, or targeting the runtimes directory
directly as in the LLVM `libc` documentation. Previously this failed
because the version check on the compiler was too strict and the
`--target=` options were not being set on the link jobs unless in CMake
cross compiliation mode. This patch fixes those so the following config
should work now to build the GPU target directly if using NVPTX.

```
cmake ../runtimes -DCMAKE_BUILD_TYPE=Release \
  -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang \
  -DLLVM_ENABLE_RUNTIMES=libc -DLLVM_RUNTIMES_TARGET=nvptx64-nvidia-cuda \
  -DLLVM_DEFAULT_TARGET_TRIPLE=nvptx64-nvidia-cuda \
  -DLIBC_HDRGEN_EXE=/path/to/hdrgen/libc-hdrgen \
  -DLLVM_LIBC_FULL_BUILD=ON -GNinja
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list