[compiler-rt] [compiler-rt] Don't detect a versioned clang test compiler as GCC (PR #117812)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 2 10:46:53 PST 2024


https://github.com/arichardson updated https://github.com/llvm/llvm-project/pull/117812

>From 1ba6fd76faceba73b7f4b3db0c787af972465369 Mon Sep 17 00:00:00 2001
From: Alex Richardson <alexrichardson at google.com>
Date: Tue, 26 Nov 2024 16:02:04 -0800
Subject: [PATCH 1/2] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20in?=
 =?UTF-8?q?itial=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.6-beta.1
---
 compiler-rt/cmake/base-config-ix.cmake | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/compiler-rt/cmake/base-config-ix.cmake b/compiler-rt/cmake/base-config-ix.cmake
index 286a622a4b5202..406387b64f5b70 100644
--- a/compiler-rt/cmake/base-config-ix.cmake
+++ b/compiler-rt/cmake/base-config-ix.cmake
@@ -77,9 +77,9 @@ else()
   set(COMPILER_RT_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE PATH "C++ Compiler to use for testing")
 endif()
 
-if("${COMPILER_RT_TEST_COMPILER}" MATCHES "clang[+]*$")
-  set(COMPILER_RT_TEST_COMPILER_ID Clang)
-elseif("${COMPILER_RT_TEST_COMPILER}" MATCHES "clang.*.exe$")
+if ("${COMPILER_RT_TEST_COMPILER}" STREQUAL ${CMAKE_C_COMPILER})
+  set(COMPILER_RT_TEST_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
+elseif("${COMPILER_RT_TEST_COMPILER}" MATCHES "clang[^/]*$")
   set(COMPILER_RT_TEST_COMPILER_ID Clang)
 elseif("${COMPILER_RT_TEST_COMPILER}" MATCHES "cl.exe$")
   set(COMPILER_RT_TEST_COMPILER_ID MSVC)

>From 5966be4bc17d4d5dc86e62fa436fb365829e33e1 Mon Sep 17 00:00:00 2001
From: Alex Richardson <alexrichardson at google.com>
Date: Mon, 2 Dec 2024 10:46:40 -0800
Subject: [PATCH 2/2] fix whitespace

Created using spr 1.3.6-beta.1
---
 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 38f086e695fd41..9717c21d8977bd 100644
--- a/compiler-rt/cmake/base-config-ix.cmake
+++ b/compiler-rt/cmake/base-config-ix.cmake
@@ -78,7 +78,7 @@ else()
 endif()
 
 get_filename_component(_test_compiler_name "${COMPILER_RT_TEST_COMPILER}" NAME)
-if ("${COMPILER_RT_TEST_COMPILER}" STREQUAL "${CMAKE_C_COMPILER}")
+if("${COMPILER_RT_TEST_COMPILER}" STREQUAL "${CMAKE_C_COMPILER}")
   set(COMPILER_RT_TEST_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
 elseif("${_test_compiler_name}" MATCHES "clang.*")
   set(COMPILER_RT_TEST_COMPILER_ID Clang)



More information about the llvm-commits mailing list