[compiler-rt] [Darwin][CompilerRT] Set compiler ID to 'Clang' for Compiler RT Tests for Apple Clang (PR #121858)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 6 18:47:33 PST 2025
https://github.com/thetruestblue updated https://github.com/llvm/llvm-project/pull/121858
>From 0072d4d0aa5d96cf107720e2eab3881e3b33aaeb Mon Sep 17 00:00:00 2001
From: thetruestblue <bgaston2 at apple.com>
Date: Mon, 6 Jan 2025 15:49:02 -0800
Subject: [PATCH 1/2] [Darwin][CompilerRT] Set compiler ID to 'Clang' for
Compiler RT Tests
This patch restores previous behavior we relied on. Even when the Compiler ID is set to AppleClang, we expect Compiler RT Tests to use Clang as the compiler ID. This impacts various make and lit commands.
Caused by: https://github.com/llvm/llvm-project/pull/117812/files
rdar://141548700
---
compiler-rt/cmake/base-config-ix.cmake | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/compiler-rt/cmake/base-config-ix.cmake b/compiler-rt/cmake/base-config-ix.cmake
index 9717c21d8977bd..f5a5195f7790da 100644
--- a/compiler-rt/cmake/base-config-ix.cmake
+++ b/compiler-rt/cmake/base-config-ix.cmake
@@ -79,7 +79,12 @@ endif()
get_filename_component(_test_compiler_name "${COMPILER_RT_TEST_COMPILER}" NAME)
if("${COMPILER_RT_TEST_COMPILER}" STREQUAL "${CMAKE_C_COMPILER}")
- set(COMPILER_RT_TEST_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
+ if ("${CMAKE_C_COMPILER}" STREQUAL "AppleClang")
+ # Compiler-rt tests expect compiler ID 'Clang' for AppleClang.
+ set(COMPILER_RT_TEST_COMPILER_ID Clang)
+ else()
+ set(COMPILER_RT_TEST_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
+ endif()
elseif("${_test_compiler_name}" MATCHES "clang.*")
set(COMPILER_RT_TEST_COMPILER_ID Clang)
elseif("${_test_compiler_name}" MATCHES "cl.exe$")
>From 21072641454b5c3426cc9f426d059df651788fc3 Mon Sep 17 00:00:00 2001
From: thetruestblue <bblueconway at gmail.com>
Date: Mon, 6 Jan 2025 18:47:25 -0800
Subject: [PATCH 2/2] Update base-config-ix.cmake
---
compiler-rt/cmake/base-config-ix.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compiler-rt/cmake/base-config-ix.cmake b/compiler-rt/cmake/base-config-ix.cmake
index f5a5195f7790da..e7ed29de723e80 100644
--- a/compiler-rt/cmake/base-config-ix.cmake
+++ b/compiler-rt/cmake/base-config-ix.cmake
@@ -79,7 +79,7 @@ endif()
get_filename_component(_test_compiler_name "${COMPILER_RT_TEST_COMPILER}" NAME)
if("${COMPILER_RT_TEST_COMPILER}" STREQUAL "${CMAKE_C_COMPILER}")
- if ("${CMAKE_C_COMPILER}" STREQUAL "AppleClang")
+ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
# Compiler-rt tests expect compiler ID 'Clang' for AppleClang.
set(COMPILER_RT_TEST_COMPILER_ID Clang)
else()
More information about the llvm-commits
mailing list