[libc] Ensure that the required clang tools are up-to-date for libc GPU
authorJoseph Huber <jhuber6@vols.utk.edu>
Tue, 4 Apr 2023 23:20:13 +0000 (18:20 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Wed, 5 Apr 2023 00:50:32 +0000 (19:50 -0500)
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

llvm/runtimes/CMakeLists.txt

index f976628..f4c697e 100644 (file)
@@ -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(