[llvm] [AMDGPU] Make libc build backwards compatible (triple) (PR #211214)

Robert Imschweiler via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 02:28:20 PDT 2026


https://github.com/ro-i created https://github.com/llvm/llvm-project/pull/211214

https://github.com/llvm/llvm-project/pull/210032 updated the triple but did not introduce backwards compatibility, leading to, e.g., failing check-offload tests due to missing libc.

>From d622ff18ce9a7caa4fe3525827286e3085fc51fc Mon Sep 17 00:00:00 2001
From: Robert Imschweiler <robert.imschweiler at amd.com>
Date: Wed, 22 Jul 2026 04:26:16 -0500
Subject: [PATCH] [AMDGPU] Make libc build backwards compatible (triple)

https://github.com/llvm/llvm-project/pull/210032 updated the triple but
did not introduce backwards compatibility, leading to, e.g., failing
check-offload tests due to missing libc.
---
 llvm/CMakeLists.txt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index e60a26681aff6..4525cf4c9f0c8 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -270,14 +270,18 @@ if(LIBOMP_ENABLE_ARM64X)
   set(RUNTIMES_arm64ec-pc-windows-msvc_LIBOMP_ENABLE_ARM64X ON)
 endif()
 
+# The AMDGPU offload triple was renamed amdgcn-amd-amdhsa -> amdgpu-amd-amdhsa.
+# Accept both names so builds that still configure the libc runtime target under
+# the legacy triple continue to enable the GPU libc build.
 foreach(_name ${LLVM_RUNTIME_TARGETS})
   if("libc" IN_LIST RUNTIMES_${_name}_LLVM_ENABLE_RUNTIMES)
-    if("${_name}" STREQUAL "amdgpu-amd-amdhsa" OR "${_name}" STREQUAL "nvptx64-nvidia-cuda" OR "${_name}" STREQUAL "spirv64-intel-unknown")
+    if("${_name}" STREQUAL "amdgpu-amd-amdhsa" OR "${_name}" STREQUAL "amdgcn-amd-amdhsa" OR "${_name}" STREQUAL "nvptx64-nvidia-cuda" OR "${_name}" STREQUAL "spirv64-intel-unknown")
       set(LLVM_LIBC_GPU_BUILD ON)
     endif()
   endif()
 endforeach()
 if("${LIBC_TARGET_TRIPLE}" STREQUAL "amdgpu-amd-amdhsa" OR
+   "${LIBC_TARGET_TRIPLE}" STREQUAL "amdgcn-amd-amdhsa" OR
    "${LIBC_TARGET_TRIPLE}" STREQUAL "nvptx64-nvidia-cuda" OR
    "${LIBC_TARGET_TRIPLE}" STREQUAL "spirv64-intel-unknown")
   set(LLVM_LIBC_GPU_BUILD ON)



More information about the llvm-commits mailing list