diff options
Diffstat (limited to 'lib/ubsan/CMakeLists.txt')
-rw-r--r-- | lib/ubsan/CMakeLists.txt | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/lib/ubsan/CMakeLists.txt b/lib/ubsan/CMakeLists.txt index 675c47f6a65e..09c7a851e075 100644 --- a/lib/ubsan/CMakeLists.txt +++ b/lib/ubsan/CMakeLists.txt @@ -2,6 +2,8 @@ set(UBSAN_SOURCES ubsan_diag.cc + ubsan_init.cc + ubsan_flags.cc ubsan_handlers.cc ubsan_value.cc ) @@ -14,11 +16,10 @@ set(UBSAN_CXX_SOURCES include_directories(..) set(UBSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS}) +append_no_rtti_flag(UBSAN_CFLAGS) +set(UBSAN_CXXFLAGS ${SANITIZER_COMMON_CFLAGS}) -filter_available_targets(UBSAN_SUPPORTED_ARCH - x86_64 i386) - -set(UBSAN_RUNTIME_LIBRARIES) +add_custom_target(ubsan) if(APPLE) # Build universal binary on APPLE. @@ -26,31 +27,31 @@ if(APPLE) ARCH ${UBSAN_SUPPORTED_ARCH} SOURCES ${UBSAN_SOURCES} ${UBSAN_CXX_SOURCES} $<TARGET_OBJECTS:RTSanitizerCommon.osx> - CFLAGS ${UBSAN_CFLAGS}) - list(APPEND UBSAN_RUNTIME_LIBRARIES clang_rt.ubsan_osx) + CFLAGS ${UBSAN_CXXFLAGS}) + add_dependencies(ubsan clang_rt.ubsan_osx) else() # Build separate libraries for each target. foreach(arch ${UBSAN_SUPPORTED_ARCH}) # Main UBSan runtime. - add_compiler_rt_static_runtime(clang_rt.ubsan-${arch} ${arch} + add_compiler_rt_runtime(clang_rt.ubsan-${arch} ${arch} STATIC SOURCES ${UBSAN_SOURCES} CFLAGS ${UBSAN_CFLAGS}) # C++-specific parts of UBSan runtime. Requires a C++ ABI library. - add_compiler_rt_static_runtime(clang_rt.ubsan_cxx-${arch} ${arch} + add_compiler_rt_runtime(clang_rt.ubsan_cxx-${arch} ${arch} STATIC SOURCES ${UBSAN_CXX_SOURCES} - CFLAGS ${UBSAN_CFLAGS}) - list(APPEND UBSAN_RUNTIME_LIBRARIES + CFLAGS ${UBSAN_CXXFLAGS}) + add_dependencies(ubsan clang_rt.san-${arch} clang_rt.ubsan-${arch} clang_rt.ubsan_cxx-${arch}) - if (UNIX AND NOT ${arch} STREQUAL "i386") + if (UNIX AND NOT ${arch} STREQUAL "i386" AND NOT ${arch} STREQUAL "i686") add_sanitizer_rt_symbols(clang_rt.ubsan-${arch} ubsan.syms.extra) add_sanitizer_rt_symbols(clang_rt.ubsan_cxx-${arch} ubsan.syms.extra) - list(APPEND UBSAN_RUNTIME_LIBRARIES + add_dependencies(ubsan clang_rt.ubsan-${arch}-symbols clang_rt.ubsan_cxx-${arch}-symbols) endif() endforeach() endif() -add_subdirectory(lit_tests) +add_dependencies(compiler-rt ubsan) |