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(COMPILER_RT_HAS_FPIE_FLAG -fPIE MSAN_RTL_CFLAGS)
16 # Prevent clang from generating libc calls.
17 append_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding MSAN_RTL_CFLAGS)
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)
38 add_dependencies(compiler-rt msan)
40 if(COMPILER_RT_INCLUDE_TESTS)
41 add_subdirectory(tests)