[PATCH] D61053: [compiler-rt] Build custom libc++abi without exceptions.

Matt Morehouse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 23 19:06:53 PDT 2019


morehouse created this revision.
morehouse added a reviewer: phosek.
Herald added subscribers: llvm-commits, christof, mgorny, dberris.
Herald added a reviewer: EricWF.
Herald added a project: LLVM.

Since neither compiler-rt nor the libc++ we build use exceptions, we
don't need libc++abi to have them either.

This resolves an issue where libFuzzer's private libc++ contains
implementations for __cxa_throw and friends, causing fuzz targets built
with their own C++ library to segfault during exception unwinding.

See https://github.com/google/oss-fuzz/issues/2328.


https://reviews.llvm.org/D61053

Files:
  compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt


Index: compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt
===================================================================
--- compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt
+++ compiler-rt/cmake/Modules/CustomLibcxx/CMakeLists.txt
@@ -4,6 +4,7 @@
 # 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 "")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61053.196371.patch
Type: text/x-patch
Size: 599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190424/3b556bf4/attachment.bin>


More information about the llvm-commits mailing list