summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt1
-rw-r--r--compiler-rt/test/fuzzer/libcxx.test15
2 files changed, 16 insertions, 0 deletions
diff --git a/compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt b/compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt
index 683b88e020a..3b1eb910ec8 100644
--- a/compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt
+++ b/compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt
@@ -4,6 +4,7 @@ project(custom-libcxx C CXX)
# Build static libcxxabi.
set(LIBCXXABI_STANDALONE_BUILD 1)
set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
+set(LIBCXXABI_ENABLE_EXCEPTIONS OFF CACHE BOOL "")
set(LIBCXXABI_HERMETIC_STATIC_LIBRARY ON CACHE STRING "")
set(LIBCXXABI_LIBCXX_PATH ${COMPILER_RT_LIBCXX_PATH} CACHE PATH "")
set(LIBCXXABI_INCLUDE_TESTS OFF CACHE BOOL "")
diff --git a/compiler-rt/test/fuzzer/libcxx.test b/compiler-rt/test/fuzzer/libcxx.test
new file mode 100644
index 00000000000..180c7957814
--- /dev/null
+++ b/compiler-rt/test/fuzzer/libcxx.test
@@ -0,0 +1,15 @@
+# Ensures that the libFuzzer library does not export exceptions.
+
+RUN: %cpp_compiler %S/SimpleTest.cpp -o %t
+RUN: nm %t 2>&1 | FileCheck %s
+
+CHECK-NOT: t __cxa_allocate_dependent_exception
+CHECK-NOT: t __cxa_allocate_exception
+CHECK-NOT: t __cxa_begin_catch
+CHECK-NOT: t __cxa_call_unexpected
+CHECK-NOT: t __cxa_current_exception_type
+CHECK-NOT: t __cxa_end_catch
+CHECK-NOT: t __cxa_free_dependent_exception
+CHECK-NOT: t __cxa_free_exception
+CHECK-NOT: t __cxa_get_exception_ptr
+CHECK-NOT: t __cxa_throw
OpenPOWER on IntegriCloud