[llvm] b8fab51 - [libc] Ensure that the required clang tools are up-to-date for libc GPU

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 17:50:51 PDT 2023


Author: Joseph Huber
Date: 2023-04-04T19:50:32-05:00
New Revision: b8fab512e9557dfcc7c886f0bf594f6c1e2f850d

URL: https://github.com/llvm/llvm-project/commit/b8fab512e9557dfcc7c886f0bf594f6c1e2f850d
DIFF: https://github.com/llvm/llvm-project/commit/b8fab512e9557dfcc7c886f0bf594f6c1e2f850d.diff

LOG: [libc] Ensure that the required clang tools are up-to-date for libc GPU

The `clang-offload-packager`. `nvptx-arch`, and `amdgpu-arch` tools are
required for building the GPU target of `libc`. This patch ensures that
we build this tool when directly building `libc` via `ninja libc` or similar.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D147581

Added: 
    

Modified: 
    llvm/runtimes/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index f9766286bbbc2..f4c697e4746af 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -399,6 +399,9 @@ if(runtimes)
       # "libc" is detected in LLVM_ENABLE_RUNTIMES.
       message(FATAL_ERROR "libc-hdrgen target missing unexpectedly")
     endif()
+    if(LIBC_GPU_BUILD OR LIBC_GPU_ARCHITECTURES)
+      list(APPEND extra_deps clang-offload-packager nvptx-arch amdgpu-arch)
+    endif()
   endif()
   if(NOT LLVM_RUNTIME_TARGETS)
     runtime_default_target(


        


More information about the llvm-commits mailing list