[compiler-rt] r254308 - [CMake] Add -fvisibility-inlines-hidden if the compiler supports it.

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 30 11:32:07 PST 2015


Updated r254316.

Thanks,
-Chris

> On Nov 30, 2015, at 10:42 AM, Alexey Samsonov <vonosmas at gmail.com> wrote:
> 
> 
> On Mon, Nov 30, 2015 at 9:42 AM, Chris Bieneman via llvm-commits <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
> Author: cbieneman
> Date: Mon Nov 30 11:42:30 2015
> New Revision: 254308
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=254308&view=rev <http://llvm.org/viewvc/llvm-project?rev=254308&view=rev>
> Log:
> [CMake] Add -fvisibility-inlines-hidden if the compiler supports it.
> 
> This results in a significant reduction in the size of the sanitizer libraries.
> 
> Modified:
>     compiler-rt/trunk/cmake/config-ix.cmake
> 
> Modified: compiler-rt/trunk/cmake/config-ix.cmake
> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/config-ix.cmake?rev=254308&r1=254307&r2=254308&view=diff <http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/config-ix.cmake?rev=254308&r1=254307&r2=254308&view=diff>
> ==============================================================================
> --- compiler-rt/trunk/cmake/config-ix.cmake (original)
> +++ compiler-rt/trunk/cmake/config-ix.cmake Mon Nov 30 11:42:30 2015
> @@ -30,6 +30,12 @@ check_cxx_compiler_flag(-fno-lto
>  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)
> 
> I think this should be next to
> append_list_if(COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG -fvisibility=hidden SANITIZER_COMMON_CFLAGS)
> in CMakeLists.txt.
>  
> +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)
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits>
> 
> 
> 
> -- 
> Alexey Samsonov
> vonosmas at gmail.com <mailto:vonosmas at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151130/86d006e1/attachment.html>


More information about the llvm-commits mailing list