[PATCH] D46609: [CMake] Build shared version of ASan and UBSan for Fuchsia
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 9 14:27:52 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT331922: [CMake] Build shared version of runtimes for Fuchsia (authored by phosek, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D46609?vs=145836&id=146003#toc
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D46609
Files:
CMakeLists.txt
lib/asan/CMakeLists.txt
lib/hwasan/CMakeLists.txt
lib/msan/CMakeLists.txt
lib/profile/CMakeLists.txt
lib/ubsan/CMakeLists.txt
lib/ubsan_minimal/CMakeLists.txt
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -278,6 +278,12 @@
set(SANITIZER_LIMIT_FRAME_SIZE FALSE)
endif()
+if(FUCHSIA OR UNIX)
+ set(SANITIZER_USE_SYMBOLS TRUE)
+else()
+ set(SANITIZER_USE_SYMBOLS FALSE)
+endif()
+
# Build sanitizer runtimes with debug info.
if(MSVC)
# Use /Z7 instead of /Zi for the asan runtime. This avoids the LNK4099
Index: lib/asan/CMakeLists.txt
===================================================================
--- lib/asan/CMakeLists.txt
+++ lib/asan/CMakeLists.txt
@@ -227,7 +227,7 @@
DEFS ${ASAN_DYNAMIC_DEFINITIONS}
PARENT_TARGET asan)
- if (UNIX AND NOT ${arch} STREQUAL "i386")
+ if (SANITIZER_USE_SYMBOLS AND NOT ${arch} STREQUAL "i386")
add_sanitizer_rt_symbols(clang_rt.asan_cxx
ARCHS ${arch})
add_dependencies(asan clang_rt.asan_cxx-${arch}-symbols)
Index: lib/hwasan/CMakeLists.txt
===================================================================
--- lib/hwasan/CMakeLists.txt
+++ lib/hwasan/CMakeLists.txt
@@ -131,7 +131,7 @@
DEFS ${ASAN_DYNAMIC_DEFINITIONS}
PARENT_TARGET hwasan)
- if(UNIX)
+ if(SANITIZER_USE_SYMBOLS)
add_sanitizer_rt_symbols(clang_rt.hwasan
ARCHS ${arch}
EXTRA hwasan.syms.extra)
Index: lib/ubsan_minimal/CMakeLists.txt
===================================================================
--- lib/ubsan_minimal/CMakeLists.txt
+++ lib/ubsan_minimal/CMakeLists.txt
@@ -44,7 +44,7 @@
LINK_LIBS ${UBSAN_DYNAMIC_LIBS}
PARENT_TARGET ubsan-minimal)
- if (UNIX AND NOT APPLE)
+ if (SANITIZER_USE_SYMBOLS AND NOT APPLE)
set(ARCHS_FOR_SYMBOLS ${UBSAN_SUPPORTED_ARCH})
list(REMOVE_ITEM ARCHS_FOR_SYMBOLS i386 i686)
add_sanitizer_rt_symbols(clang_rt.ubsan_minimal
Index: lib/ubsan/CMakeLists.txt
===================================================================
--- lib/ubsan/CMakeLists.txt
+++ lib/ubsan/CMakeLists.txt
@@ -173,7 +173,7 @@
CFLAGS ${UBSAN_CXXFLAGS}
PARENT_TARGET ubsan)
- if (UNIX)
+ if (FUCHSIA OR UNIX)
add_compiler_rt_runtime(clang_rt.ubsan_standalone
SHARED
ARCHS ${UBSAN_SUPPORTED_ARCH}
Index: lib/profile/CMakeLists.txt
===================================================================
--- lib/profile/CMakeLists.txt
+++ lib/profile/CMakeLists.txt
@@ -68,7 +68,7 @@
list(APPEND PROFILE_SOURCES WindowsMMap.c)
endif()
-if(UNIX)
+if(FUCHSIA OR UNIX)
set(EXTRA_FLAGS
-fPIC
-Wno-pedantic)
Index: lib/msan/CMakeLists.txt
===================================================================
--- lib/msan/CMakeLists.txt
+++ lib/msan/CMakeLists.txt
@@ -54,7 +54,7 @@
PARENT_TARGET msan)
list(APPEND MSAN_RUNTIME_LIBRARIES clang_rt.msan-${arch}
clang_rt.msan_cxx-${arch})
- if(UNIX)
+ if(SANITIZER_USE_SYMBOLS)
add_sanitizer_rt_symbols(clang_rt.msan
ARCHS ${arch}
EXTRA msan.syms.extra)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46609.146003.patch
Type: text/x-patch
Size: 2997 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180509/36d0b754/attachment.bin>
More information about the llvm-commits
mailing list