From b8fab512e9557dfcc7c886f0bf594f6c1e2f850d Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 4 Apr 2023 18:20:13 -0500 Subject: [PATCH] [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 --- llvm/runtimes/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt index f976628..f4c697e 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( -- 2.7.4