[libc-commits] [libc] [libc] Build the `libc` objects using a generic AMDGPU ABI (PR #65782)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Fri Sep 8 10:52:08 PDT 2023


https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/65782:

Summary:
AMDGPU binaries use a "code object" as the ABI indicator. We are
currently trying to move over to a newer code object. We want these
library functions to use the "generic" or default ABI such that it is
specified when linked into the user application. Currently this will
default to v4 as the startup code will use whatever the current default
is.


>From 75324b5d7f57e220d9fb68addb8c79b5be01ab6b Mon Sep 17 00:00:00 2001
From: Joseph Huber <jhuber6 at vols.utk.edu>
Date: Fri, 8 Sep 2023 12:20:38 -0500
Subject: [PATCH] [libc] Build the `libc` objects using a generic AMDGPU ABI

Summary:
AMDGPU binaries use a "code object" as the ABI indicator. We are
currently trying to move over to a newer code object. We want these
library functions to use the "generic" or default ABI such that it is
specified when linked into the user application. Currently this will
default to v4 as the startup code will use whatever the current default
is.
---
 libc/cmake/modules/LLVMLibCObjectRules.cmake | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libc/cmake/modules/LLVMLibCObjectRules.cmake b/libc/cmake/modules/LLVMLibCObjectRules.cmake
index c5862a829be5f9b..2c3cf116fc8607d 100644
--- a/libc/cmake/modules/LLVMLibCObjectRules.cmake
+++ b/libc/cmake/modules/LLVMLibCObjectRules.cmake
@@ -168,6 +168,7 @@ function(_build_gpu_objects fq_target_name internal_target_name)
       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 "SHELL:-Xclang -mcode-object-version=none")
       elseif("${gpu_arch}" IN_LIST all_nvptx_architectures)
         set(gpu_target_triple "nvptx64-nvidia-cuda")
         get_nvptx_compile_options(nvptx_options ${gpu_arch})



More information about the libc-commits mailing list