summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src
diff options
context:
space:
mode:
authorSergey Dmitrouk <sdmitrouk@accesssoftek.com>2015-02-16 19:51:06 +0000
committerSergey Dmitrouk <sdmitrouk@accesssoftek.com>2015-02-16 19:51:06 +0000
commit0aa66cf8f838ca49eff577623018dd2a53719dbd (patch)
treef36f1dc0a0c9429a51e7e27cb17a3e8dd6db62c8 /libcxxabi/src
parent4d0397382c26ab3914654459223be8ca8f12f412 (diff)
downloadbcm5719-llvm-0aa66cf8f838ca49eff577623018dd2a53719dbd.tar.gz
bcm5719-llvm-0aa66cf8f838ca49eff577623018dd2a53719dbd.zip
Do not add -fno-exceptions without -funwind-tables
Adding just -fno-exceptions breaks libunwind in quite mysterious way when it's there, but exception handling doesn't work because of dummy unwind tables. Also as using exceptions implies references to symbols defined in libcxx, abort build of libcxxabi as shared library if we have to keep exceptions (when compiler supports -fno-exceptions, but not -funwind-tables; one example would be a cross-compiler, in which case testing for -funwind-tables flag by CMake actually requires libunwind to be available before it's built). llvm-svn: 229427
Diffstat (limited to 'libcxxabi/src')
-rw-r--r--libcxxabi/src/Unwind/CMakeLists.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/libcxxabi/src/Unwind/CMakeLists.txt b/libcxxabi/src/Unwind/CMakeLists.txt
index 77bb0191f65..2aa45dce2a4 100644
--- a/libcxxabi/src/Unwind/CMakeLists.txt
+++ b/libcxxabi/src/Unwind/CMakeLists.txt
@@ -70,9 +70,16 @@ 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)
+if ( LIBCXXABI_HAS_NO_EXCEPTIONS_FLAG AND LIBCXXABI_HAS_FUNWIND_TABLES )
+ list(APPEND LIBUNWIND_COMPILE_FLAGS -fno-exceptions)
+ list(APPEND LIBUNWIND_COMPILE_FLAGS -funwind-tables)
+elseif( LIBUNWIND_ENABLE_SHARED )
+ message(FATAL_ERROR "Compiler doesn't support generation of unwind tables "
+ "if exception support is disabled. Building libunwind "
+ "DSO with runtime dependency on libcxxabi is not "
+ "supported.")
+endif()
set(LIBCXXABI_UNWINDER_NAME "unwind")
OpenPOWER on IntegriCloud