[libc-commits] [libc] a031f72 - [libc] Correctly pass the compile options to the internal GPU compilation

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Tue Mar 14 06:20:41 PDT 2023


Author: Joseph Huber
Date: 2023-03-14T08:19:13-05:00
New Revision: a031f72187ce495b9faa4ccf99b1e901a3872f4b

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

LOG: [libc] Correctly pass the compile options to the internal GPU compilation

Summary:
We use an internal option to create the GPU binary used for testing.
This wasn't getting the proper flags passed to it due to a missing
variable name.

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCObjectRules.cmake

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCObjectRules.cmake b/libc/cmake/modules/LLVMLibCObjectRules.cmake
index 3cfa1995a9e04..478df34d8983c 100644
--- a/libc/cmake/modules/LLVMLibCObjectRules.cmake
+++ b/libc/cmake/modules/LLVMLibCObjectRules.cmake
@@ -83,12 +83,13 @@ function(_build_gpu_objects fq_target_name internal_target_name)
   )
 
   set(include_dirs ${LIBC_BUILD_DIR}/include ${LIBC_SOURCE_DIR} ${LIBC_BUILD_DIR})
+  set(common_compile_options ${ADD_GPU_OBJ_COMPILE_OPTIONS})
 
   # The packaged version will be built for every target GPU architecture. We do
   # this so we can support multiple accelerators on the same machine.
   foreach(gpu_arch ${LIBC_GPU_ARCHITECTURES})
     set(gpu_target_name ${fq_target_name}.${gpu_arch})
-    set(compile_options ${ADD_GPU_OBJ_COMPILE_OPTIONS})
+    set(compile_options ${common_compile_options})
     # Derive the triple from the specified architecture.
     if("${gpu_arch}" IN_LIST all_amdgpu_architectures)
       set(gpu_target_triple "amdgcn-amd-amdhsa")


        


More information about the libc-commits mailing list