[libc-commits] [PATCH] D153581: [libc] Can build amdgpu libc even if rocm is missing

Jon Chesterfield via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jun 22 12:29:55 PDT 2023


JonChesterfield created this revision.
JonChesterfield added a reviewer: jhuber6.
Herald added subscribers: libc-commits, tpr, dstuttard, yaxunl, kzhuravl.
Herald added projects: libc-project, All.
JonChesterfield requested review of this revision.
Herald added a subscriber: wdng.

Clang defaults to failing to build if it can't find rocm device libs


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153581

Files:
  libc/cmake/modules/LLVMLibCObjectRules.cmake


Index: libc/cmake/modules/LLVMLibCObjectRules.cmake
===================================================================
--- libc/cmake/modules/LLVMLibCObjectRules.cmake
+++ libc/cmake/modules/LLVMLibCObjectRules.cmake
@@ -151,6 +151,7 @@
       if("${gpu_arch}" IN_LIST all_amdgpu_architectures)
         set(gpu_target_triple "amdgcn-amd-amdhsa")
         list(APPEND compile_options "-mcpu=${gpu_arch}")
+        list(APPEND compile_options "-nogpulib")
       elseif("${gpu_arch}" IN_LIST all_nvptx_architectures)
         set(gpu_target_triple "nvptx64-nvidia-cuda")
         get_nvptx_compile_options(nvptx_options ${gpu_arch})


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153581.533729.patch
Type: text/x-patch
Size: 633 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230622/5300aaa9/attachment.bin>


More information about the libc-commits mailing list