[libc-commits] [PATCH] D146979: [libc] Simplify enabling the GPU build for libc

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Mar 27 11:22:42 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGfd059ea7ec04: [libc] Simplify enabling the GPU build for libc (authored by jhuber6).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146979/new/

https://reviews.llvm.org/D146979

Files:
  libc/CMakeLists.txt
  libc/cmake/modules/LLVMLibCArchitectures.cmake
  libc/cmake/modules/prepare_libc_gpu_build.cmake
  llvm/runtimes/CMakeLists.txt


Index: llvm/runtimes/CMakeLists.txt
===================================================================
--- llvm/runtimes/CMakeLists.txt
+++ llvm/runtimes/CMakeLists.txt
@@ -385,7 +385,8 @@
       list(APPEND extra_deps llvm-link)
     endif()
   endif()
-  if("libc" IN_LIST LLVM_ENABLE_RUNTIMES AND LLVM_LIBC_FULL_BUILD)
+  if("libc" IN_LIST LLVM_ENABLE_RUNTIMES AND 
+      (LLVM_LIBC_FULL_BUILD OR LIBC_GPU_BUILD OR LIBC_GPU_ARCHITECTURES))
     if(TARGET libc-hdrgen)
       set(libc_tools libc-hdrgen)
       set(libc_cmake_args "-DLIBC_HDRGEN_EXE=$<TARGET_FILE:libc-hdrgen>"
Index: libc/cmake/modules/prepare_libc_gpu_build.cmake
===================================================================
--- libc/cmake/modules/prepare_libc_gpu_build.cmake
+++ libc/cmake/modules/prepare_libc_gpu_build.cmake
@@ -29,8 +29,9 @@
                       " is not `Clang ${req_ver}.")
 endif()
 if(NOT LLVM_LIBC_FULL_BUILD)
-  message(FATAL_ERROR "LLVM_LIBC_FULL_BUILD must be enabled to build libc for "
-                      "GPU.")
+  message(STATUS "LLVM_LIBC_FULL_BUILD must be enabled to build libc for GPU. "
+                 "Overriding LLVM_LIBC_FULL_BUILD to ON.")
+  set(LLVM_LIBC_FULL_BUILD ON FORCE)
 endif()
 
 # Identify the program used to package multiple images into a single binary.
Index: libc/cmake/modules/LLVMLibCArchitectures.cmake
===================================================================
--- libc/cmake/modules/LLVMLibCArchitectures.cmake
+++ libc/cmake/modules/LLVMLibCArchitectures.cmake
@@ -6,7 +6,7 @@
 # platform.
 # ------------------------------------------------------------------------------
 
-if(LIBC_GPU_BUILD)
+if(LIBC_GPU_BUILD OR LIBC_GPU_ARCHITECTURES)
   # We set the generic target and OS to "gpu" here. More specific defintions
   # for the exact target GPU are set up in prepare_libc_gpu_build.cmake.
   set(LIBC_TARGET_OS "gpu")
Index: libc/CMakeLists.txt
===================================================================
--- libc/CMakeLists.txt
+++ libc/CMakeLists.txt
@@ -18,7 +18,7 @@
 # The top-level directory in which libc is being built.
 set(LIBC_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR})
 
-if(LLVM_LIBC_FULL_BUILD)
+if(LLVM_LIBC_FULL_BUILD OR LIBC_GPU_BUILD OR LIBC_GPU_ARCHITECTURES)
   if(NOT LIBC_HDRGEN_EXE)
     # We need to set up hdrgen first since other targets depend on it.
     add_subdirectory(utils/LibcTableGenUtil)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146979.508739.patch
Type: text/x-patch
Size: 2393 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230327/57871f3c/attachment.bin>


More information about the libc-commits mailing list