[compiler-rt] be622a4 - [CMake] Fix compiler-rt -Wl,-z,gnu-version-script-compat warnings on non-Solaris

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 15 01:35:53 PST 2022


Author: Fangrui Song
Date: 2022-01-15T01:35:48-08:00
New Revision: be622a47ff8dc0dd66f081d8dded4ac6832ee008

URL: https://github.com/llvm/llvm-project/commit/be622a47ff8dc0dd66f081d8dded4ac6832ee008
DIFF: https://github.com/llvm/llvm-project/commit/be622a47ff8dc0dd66f081d8dded4ac6832ee008.diff

LOG: [CMake] Fix compiler-rt -Wl,-z,gnu-version-script-compat warnings on non-Solaris

Added: 
    

Modified: 
    compiler-rt/CMakeLists.txt
    compiler-rt/cmake/config-ix.cmake

Removed: 
    


################################################################################
diff  --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index 0dcb417a85f8f..12946d74c797b 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -630,9 +630,6 @@ if(ANDROID)
   set(COMPILER_RT_TEST_USE_LLD TRUE)
   append_list_if(COMPILER_RT_HAS_FUSE_LD_LLD_FLAG -fuse-ld=lld SANITIZER_COMMON_LINK_FLAGS)
   append_list_if(COMPILER_RT_HAS_LLD -fuse-ld=lld COMPILER_RT_UNITTEST_LINK_FLAGS)
-  if(COMPILER_RT_HAS_FUSE_LD_LLD_FLAG)
-    set(COMPILER_RT_HAS_GNU_VERSION_SCRIPT_COMPAT FALSE)
-  endif()
 endif()
 pythonize_bool(COMPILER_RT_HAS_LLD)
 pythonize_bool(COMPILER_RT_TEST_USE_LLD)

diff  --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
index 9a005b2e48c13..d196deff5dc19 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -174,8 +174,10 @@ check_library_exists(stdc++ __cxa_throw "" COMPILER_RT_HAS_LIBSTDCXX)
 compiler_rt_check_linker_flag("-Wl,-z,text" COMPILER_RT_HAS_Z_TEXT)
 compiler_rt_check_linker_flag("-fuse-ld=lld" COMPILER_RT_HAS_FUSE_LD_LLD_FLAG)
 
-set(VERS_COMPAT_OPTION "-Wl,-z,gnu-version-script-compat")
-compiler_rt_check_linker_flag("${VERS_COMPAT_OPTION}" COMPILER_RT_HAS_GNU_VERSION_SCRIPT_COMPAT)
+if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+  set(VERS_COMPAT_OPTION "-Wl,-z,gnu-version-script-compat")
+  compiler_rt_check_linker_flag("${VERS_COMPAT_OPTION}" COMPILER_RT_HAS_GNU_VERSION_SCRIPT_COMPAT)
+endif()
 
 set(DUMMY_VERS ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/dummy.vers)
 file(WRITE ${DUMMY_VERS} "{};")


        


More information about the llvm-commits mailing list