diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake index 51824974a..4d3dfb418 100644 --- a/cmake/EthCompilerSettings.cmake +++ b/cmake/EthCompilerSettings.cmake @@ -54,6 +54,12 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA # Set stack size to 32MB - by default Apple's clang defines a stack size of 8MB. # Normally 16MB is enough to run all tests, but it will exceed the stack, if -DSANITIZE=address is used. set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-stack_size -Wl,0x2000000") + + # Boost libraries use visibility=hidden to reduce unnecessary DWARF entries. + # Unless we match visibility, ld will give a warning message like: + # ld: warning: direct access in function 'boost::filesystem... from file ... + # means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings. + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") endif() # Some Linux-specific Clang settings. We don't want these for OS X.