summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-11-30 17:42:30 +0000
committerChris Bieneman <beanz@apple.com>2015-11-30 17:42:30 +0000
commit9b6d4ffdf9c1d31eb61be5738dc869917009d1a8 (patch)
tree5c0097705981c8fc032a83e46952d3c0a1ae45c8
parente6241798c919e4afc6f106be22d5b0f74c2e6694 (diff)
downloadbcm5719-llvm-9b6d4ffdf9c1d31eb61be5738dc869917009d1a8.tar.gz
bcm5719-llvm-9b6d4ffdf9c1d31eb61be5738dc869917009d1a8.zip
[CMake] Add -fvisibility-inlines-hidden if the compiler supports it.
This results in a significant reduction in the size of the sanitizer libraries. llvm-svn: 254308
-rw-r--r--compiler-rt/cmake/config-ix.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/cmake/config-ix.cmake b/compiler-rt/cmake/config-ix.cmake
index 07d285c75c7..24bb7e34ba1 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -30,6 +30,12 @@ check_cxx_compiler_flag(-fno-lto COMPILER_RT_HAS_FNO_LTO_FLAG)
check_cxx_compiler_flag(-msse3 COMPILER_RT_HAS_MSSE3_FLAG)
check_cxx_compiler_flag(-std=c99 COMPILER_RT_HAS_STD_C99_FLAG)
+if(NOT WIN32 AND NOT CYGWIN)
+ # MinGW warns if -fvisibility-inlines-hidden is used.
+ check_cxx_compiler_flag("-fvisibility-inlines-hidden" COMPILER_RT_HAS_FVISIBILITY_INLINES_HIDDEN_FLAG)
+ append_string_if(COMPILER_RT_HAS_FVISIBILITY_INLINES_HIDDEN_FLAG "-fvisibility-inlines-hidden" CMAKE_CXX_FLAGS)
+endif()
+
check_cxx_compiler_flag(/GR COMPILER_RT_HAS_GR_FLAG)
check_cxx_compiler_flag(/GS COMPILER_RT_HAS_GS_FLAG)
check_cxx_compiler_flag(/MT COMPILER_RT_HAS_MT_FLAG)
OpenPOWER on IntegriCloud