summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJonas Hahnfeld <hahnjo@hahnjo.de>2019-02-17 12:16:20 +0000
committerJonas Hahnfeld <hahnjo@hahnjo.de>2019-02-17 12:16:20 +0000
commitbcc157dfbc24b73d6330ff25fdb14eecd9872f42 (patch)
tree11f006591235ff9edc848c76887917987262ff03 /CMakeLists.txt
parent3b34e7c533ea8837a1e11e14131edeb565a9a562 (diff)
downloadcompiler-rt-bcc157dfbc24b73d6330ff25fdb14eecd9872f42.tar.gz
[compiler-rt] Build custom libcxx with libcxxabi
This changes add_custom_libcxx to also build libcxxabi and merges the two into a static and hermetic library. There are multiple advantages: 1) The resulting libFuzzer doesn't expose C++ internals and looks like a plain C library. 2) We don't have to manually link in libstdc++ to provide cxxabi. 3) The sanitizer tests cannot interfere with an installed version of libc++.so in LD_LIBRARY_PATH. Differential Revision: https://reviews.llvm.org/D58013 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@354212 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7a8face86..52e73665d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -484,6 +484,15 @@ if(COMPILER_RT_USE_LIBCXX)
break()
endif()
endforeach()
+ foreach(path IN ITEMS ${LLVM_MAIN_SRC_DIR}/projects/libcxxabi
+ ${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi
+ ${LLVM_MAIN_SRC_DIR}/../libcxxabi
+ ${LLVM_EXTERNAL_LIBCXXABI_SOURCE_DIR})
+ if(IS_DIRECTORY ${path})
+ set(COMPILER_RT_LIBCXXABI_PATH ${path})
+ break()
+ endif()
+ endforeach()
endif()
set(COMPILER_RT_LLD_PATH ${LLVM_MAIN_SRC_DIR}/tools/lld)