summaryrefslogtreecommitdiffstats
path: root/libunwind/src
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2019-11-06 10:51:42 -0800
committerSaleem Abdulrasool <compnerd@compnerd.org>2019-11-06 10:51:42 -0800
commitcbc872a63f81ad9482bb288165af63d7444fa3ed (patch)
tree5cee79331ea43659e6d3176e1430ac830e793cf9 /libunwind/src
parenta8ccb48f697d3fbe85c593248ff1053fdf522a6e (diff)
downloadbcm5719-llvm-cbc872a63f81ad9482bb288165af63d7444fa3ed.tar.gz
bcm5719-llvm-cbc872a63f81ad9482bb288165af63d7444fa3ed.zip
unwind: disable RTTI during the build of libunwind
Disable the type information emission for libunwind. libunwind does not use `dynamic_cast`. This results in a smaller binary, and more importantly, avoids the dependency on libc++abi. This ensures that we have complete symbol resolution of symbols on ELF targets without linking to the C++ runtime support library. This change avoids the emission of a reference to `__si_class_type_info`.
Diffstat (limited to 'libunwind/src')
-rw-r--r--libunwind/src/CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/libunwind/src/CMakeLists.txt b/libunwind/src/CMakeLists.txt
index ed20ff0015f..2dab16afbdf 100644
--- a/libunwind/src/CMakeLists.txt
+++ b/libunwind/src/CMakeLists.txt
@@ -111,6 +111,11 @@ set_property(SOURCE ${LIBUNWIND_C_SOURCES}
# Build the shared library.
if (LIBUNWIND_ENABLE_SHARED)
add_library(unwind_shared SHARED ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
+ if(CMAKE_C_COMPILER_ID STREQUAL MSVC)
+ target_compile_options(unwind_shared PRIVATE /GR-)
+ else()
+ target_compile_options(unwind_shared PRIVATE -fno-rtti)
+ endif()
if(COMMAND llvm_setup_rpath)
llvm_setup_rpath(unwind_shared)
endif()
@@ -142,6 +147,11 @@ endif()
# Build the static library.
if (LIBUNWIND_ENABLE_STATIC)
add_library(unwind_static STATIC ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
+ if(CMAKE_C_COMPILER_ID STREQUAL MSVC)
+ target_compile_options(unwind_static PRIVATE /GR-)
+ else()
+ target_compile_options(unwind_static PRIVATE -fno-rtti)
+ endif()
target_link_libraries(unwind_static PRIVATE ${LIBUNWIND_LIBRARIES})
set_target_properties(unwind_static
PROPERTIES
OpenPOWER on IntegriCloud