Index: llvm/trunk/CMakeLists.txt =================================================================== --- llvm/trunk/CMakeLists.txt +++ llvm/trunk/CMakeLists.txt @@ -530,6 +530,8 @@ endif() option(LLVM_BUILD_LLVM_DYLIB "Build libllvm dynamic library" ${LLVM_BUILD_LLVM_DYLIB_default}) +option(LLVM_DYLIB_SYMBOL_VERSIONING OFF) + option(LLVM_OPTIMIZED_TABLEGEN "Force TableGen to be built with optimization" OFF) if(CMAKE_CROSSCOMPILING OR (LLVM_OPTIMIZED_TABLEGEN AND (LLVM_ENABLE_ASSERTIONS OR CMAKE_CONFIGURATION_TYPES))) set(LLVM_USE_HOST_TOOLS ON) Index: llvm/trunk/tools/llvm-shlib/CMakeLists.txt =================================================================== --- llvm/trunk/tools/llvm-shlib/CMakeLists.txt +++ llvm/trunk/tools/llvm-shlib/CMakeLists.txt @@ -50,6 +50,10 @@ target_link_libraries(LLVM PRIVATE ${LIB_NAMES}) +if (LLVM_DYLIB_SYMBOL_VERSIONING) + set_property(TARGET LLVM APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--default-symver") +endif() + if (APPLE) set_property(TARGET LLVM APPEND_STRING PROPERTY LINK_FLAGS