[compiler-rt] [compiler-rt][test][builtins] Check linker support for --start-group (PR #205610)

Kelvin Li via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 07:51:30 PDT 2026


kkwli wrote:

@jdenny-ornl Please apply the following change.
```diff
diff --git a/compiler-rt/test/builtins/CMakeLists.txt b/compiler-rt/test/builtins/CMakeLists.txt
index 843e76264e12..ead49429cc6b 100644
--- a/compiler-rt/test/builtins/CMakeLists.txt
+++ b/compiler-rt/test/builtins/CMakeLists.txt
@@ -44,8 +44,12 @@ endif()
 pythonize_bool(BUILTINS_IS_MSVC)
 
 # Check if the linker supports --start-group and --end-group options
-include(CheckLinkerFlag)
-check_linker_flag(C "-Wl,--start-group" COMPILER_RT_HAS_START_GROUP)
+if(CMAKE_TRY_COMPILE_TARGET_TYPE STREQUAL "STATIC_LIBRARY")
+  set(COMPILER_RT_HAS_START_GROUP ON)
+else()
+  include(CheckLinkerFlag)
+  check_linker_flag(C "-Wl,--start-group" COMPILER_RT_HAS_START_GROUP)
+endif()
 pythonize_bool(COMPILER_RT_HAS_START_GROUP)
 
 set(BUILTIN_TEST_ARCH ${BUILTIN_SUPPORTED_ARCH})
```

> Wouldn't the cmake result still be bypassed for nvptx?
Yes. The guard is still in `lit.cfg.py`.

https://github.com/llvm/llvm-project/pull/205610


More information about the llvm-commits mailing list