1 include_directories(..)
3 # Runtime library sources and build flags.
13 set(MSAN_RTL_CFLAGS ${SANITIZER_COMMON_CFLAGS})
14 append_no_rtti_flag(MSAN_RTL_CFLAGS)
15 append_if(MSAN_RTL_CFLAGS COMPILER_RT_HAS_FPIE_FLAG -fPIE)
16 # Prevent clang from generating libc calls.
17 append_if(MSAN_RTL_CFLAGS COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding)
19 # Static runtime library.
20 add_custom_target(msan)
22 if(CAN_TARGET_${arch})
23 add_compiler_rt_static_runtime(clang_rt.msan-${arch} ${arch}
24 SOURCES ${MSAN_RTL_SOURCES}
25 $<TARGET_OBJECTS:RTInterception.${arch}>
26 $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
27 $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
28 CFLAGS ${MSAN_RTL_CFLAGS})
29 add_dependencies(msan clang_rt.msan-${arch})
31 add_sanitizer_rt_symbols(clang_rt.msan-${arch} msan.syms.extra)
32 add_dependencies(msan clang_rt.msan-${arch}-symbols)
36 add_compiler_rt_resource_file(msan_blacklist msan_blacklist.txt)
37 add_dependencies(msan msan_blacklist)
39 if(LLVM_INCLUDE_TESTS)
40 add_subdirectory(tests)