[libcxxabi] r228408 - unwind: use -fno-rtti -fno-exceptions -funwind-tables

Saleem Abdulrasool compnerd at compnerd.org
Fri Feb 6 09:47:57 PST 2015


Author: compnerd
Date: Fri Feb  6 11:47:57 2015
New Revision: 228408

URL: http://llvm.org/viewvc/llvm-project?rev=228408&view=rev
Log:
unwind: use -fno-rtti -fno-exceptions -funwind-tables

RTTI and exceptions are not needed for the unwinder, the use of C++ there is for
very specific cases, and does not require dynamic_cast nor does it use
exceptions.  This avoids unnecessary references to type information being
emitted.

Modified:
    libcxxabi/trunk/cmake/config-ix.cmake
    libcxxabi/trunk/src/Unwind/CMakeLists.txt

Modified: libcxxabi/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/cmake/config-ix.cmake?rev=228408&r1=228407&r2=228408&view=diff
==============================================================================
--- libcxxabi/trunk/cmake/config-ix.cmake (original)
+++ libcxxabi/trunk/cmake/config-ix.cmake Fri Feb  6 11:47:57 2015
@@ -5,6 +5,8 @@ include(CheckCXXCompilerFlag)
 # Check compiler flags
 check_c_compiler_flag(-funwind-tables         LIBCXXABI_HAS_FUNWIND_TABLES)
 check_cxx_compiler_flag(-fPIC                 LIBCXXABI_HAS_FPIC_FLAG)
+check_cxx_compiler_flag(-fno-exceptions       LIBCXXABI_HAS_NO_EXCEPTIONS_FLAG)
+check_cxx_compiler_flag(-fno-rtti             LIBCXXABI_HAS_NO_RTTI_FLAG)
 check_cxx_compiler_flag(-fstrict-aliasing     LIBCXXABI_HAS_FSTRICT_ALIASING_FLAG)
 check_cxx_compiler_flag(-nodefaultlibs        LIBCXXABI_HAS_NODEFAULTLIBS_FLAG)
 check_cxx_compiler_flag(-nostdinc++           LIBCXXABI_HAS_NOSTDINCXX_FLAG)

Modified: libcxxabi/trunk/src/Unwind/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/CMakeLists.txt?rev=228408&r1=228407&r2=228408&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/CMakeLists.txt (original)
+++ libcxxabi/trunk/src/Unwind/CMakeLists.txt Fri Feb  6 11:47:57 2015
@@ -68,6 +68,11 @@ target_link_libraries(unwind ${libraries
 append_if(LIBCXXABI_COMPILE_FLAGS LIBCXXABI_HAS_FPIC_FLAG -fPIC)
 append_if(LIBCXXABI_LINK_FLAGS LIBCXXABI_HAS_NODEFAULTLIBS_FLAG -nodefaultlibs)
 
+set(LIBUNWIND_COMPILE_FLAGS)
+append_if(LIBUNWIND_COMPILE_FLAGS LIBCXXABI_HAS_NO_EXCEPTIONS_FLAG -fno-exceptions)
+append_if(LIBUNWIND_COMPILE_FLAGS LIBCXXABI_HAS_NO_RTTI_FLAG -fno-rtti)
+append_if(LIBUNWIND_COMPILE_FLAGS LIBCXXABI_HAS_FUNWIND_TABLES -funwind-tables)
+
 set(LIBCXXABI_UNWINDER_NAME "unwind")
 
 if ( APPLE )
@@ -86,11 +91,12 @@ if ( APPLE )
 endif()
 
 string(REPLACE ";" " " LIBCXXABI_COMPILE_FLAGS "${LIBCXXABI_COMPILE_FLAGS}")
+string(REPLACE ";" " " LIBUNWIND_COMPILE_FLAGS "${LIBUNWIND_COMPILE_FLAGS}")
 string(REPLACE ";" " " LIBCXXABI_LINK_FLAGS "${LIBCXXABI_LINK_FLAGS}")
 
 set_target_properties(unwind
   PROPERTIES
-    COMPILE_FLAGS "${LIBCXXABI_COMPILE_FLAGS}"
+    COMPILE_FLAGS "${LIBCXXABI_COMPILE_FLAGS} ${LIBUNWIND_COMPILE_FLAGS}"
     LINK_FLAGS    "${LIBCXXABI_LINK_FLAGS}"
     OUTPUT_NAME   "${LIBCXXABI_UNWINDER_NAME}"
     VERSION       "1.0"





More information about the cfe-commits mailing list