Skip to content

Commit

Permalink
[CMake] Build shared version of runtimes for Fuchsia
Browse files Browse the repository at this point in the history
Fuchsia is no longer treated as UNIX which means we need to explicitly
enable building of shared versions of runtimes.

Differential Revision: https://reviews.llvm.org/D46609

llvm-svn: 331922
  • Loading branch information
petrhosek committed May 9, 2018
1 parent 34794a9 commit 1608ca6
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions compiler-rt/CMakeLists.txt
Expand Up @@ -278,6 +278,12 @@ else()
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
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/asan/CMakeLists.txt
Expand Up @@ -227,7 +227,7 @@ else()
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)
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/hwasan/CMakeLists.txt
Expand Up @@ -131,7 +131,7 @@ foreach(arch ${HWASAN_SUPPORTED_ARCH})
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)
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/msan/CMakeLists.txt
Expand Up @@ -54,7 +54,7 @@ foreach(arch ${MSAN_SUPPORTED_ARCH})
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)
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/profile/CMakeLists.txt
Expand Up @@ -68,7 +68,7 @@ if(WIN32)
list(APPEND PROFILE_SOURCES WindowsMMap.c)
endif()

if(UNIX)
if(FUCHSIA OR UNIX)
set(EXTRA_FLAGS
-fPIC
-Wno-pedantic)
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/ubsan/CMakeLists.txt
Expand Up @@ -173,7 +173,7 @@ else()
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}
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/ubsan_minimal/CMakeLists.txt
Expand Up @@ -44,7 +44,7 @@ if(COMPILER_RT_HAS_UBSAN_MINIMAL)
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
Expand Down

0 comments on commit 1608ca6

Please sign in to comment.