1*7c3d14c8STreehugger Robotinclude_directories(..) 2*7c3d14c8STreehugger Robot 3*7c3d14c8STreehugger Robot# Runtime library sources and build flags. 4*7c3d14c8STreehugger Robotset(MSAN_RTL_SOURCES 5*7c3d14c8STreehugger Robot msan.cc 6*7c3d14c8STreehugger Robot msan_allocator.cc 7*7c3d14c8STreehugger Robot msan_chained_origin_depot.cc 8*7c3d14c8STreehugger Robot msan_interceptors.cc 9*7c3d14c8STreehugger Robot msan_linux.cc 10*7c3d14c8STreehugger Robot msan_report.cc 11*7c3d14c8STreehugger Robot msan_thread.cc 12*7c3d14c8STreehugger Robot msan_poisoning.cc 13*7c3d14c8STreehugger Robot ) 14*7c3d14c8STreehugger Robot 15*7c3d14c8STreehugger Robotset(MSAN_RTL_CXX_SOURCES 16*7c3d14c8STreehugger Robot msan_new_delete.cc) 17*7c3d14c8STreehugger Robot 18*7c3d14c8STreehugger Robot 19*7c3d14c8STreehugger Robotset(MSAN_RTL_CFLAGS ${SANITIZER_COMMON_CFLAGS}) 20*7c3d14c8STreehugger Robotappend_rtti_flag(OFF MSAN_RTL_CFLAGS) 21*7c3d14c8STreehugger Robotappend_list_if(COMPILER_RT_HAS_FPIE_FLAG -fPIE MSAN_RTL_CFLAGS) 22*7c3d14c8STreehugger Robot# Prevent clang from generating libc calls. 23*7c3d14c8STreehugger Robotappend_list_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding MSAN_RTL_CFLAGS) 24*7c3d14c8STreehugger Robot 25*7c3d14c8STreehugger Robotset(MSAN_RUNTIME_LIBRARIES) 26*7c3d14c8STreehugger Robot 27*7c3d14c8STreehugger Robot# Static runtime library. 28*7c3d14c8STreehugger Robotadd_custom_target(msan) 29*7c3d14c8STreehugger Robotset_target_properties(msan PROPERTIES FOLDER "Compiler-RT Misc") 30*7c3d14c8STreehugger Robot 31*7c3d14c8STreehugger Robotforeach(arch ${MSAN_SUPPORTED_ARCH}) 32*7c3d14c8STreehugger Robot add_compiler_rt_runtime(clang_rt.msan 33*7c3d14c8STreehugger Robot STATIC 34*7c3d14c8STreehugger Robot ARCHS ${arch} 35*7c3d14c8STreehugger Robot SOURCES ${MSAN_RTL_SOURCES} 36*7c3d14c8STreehugger Robot $<TARGET_OBJECTS:RTInterception.${arch}> 37*7c3d14c8STreehugger Robot $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> 38*7c3d14c8STreehugger Robot $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}> 39*7c3d14c8STreehugger Robot $<TARGET_OBJECTS:RTUbsan.${arch}> 40*7c3d14c8STreehugger Robot CFLAGS ${MSAN_RTL_CFLAGS} 41*7c3d14c8STreehugger Robot PARENT_TARGET msan) 42*7c3d14c8STreehugger Robot add_compiler_rt_runtime(clang_rt.msan_cxx 43*7c3d14c8STreehugger Robot STATIC 44*7c3d14c8STreehugger Robot ARCHS ${arch} 45*7c3d14c8STreehugger Robot SOURCES ${MSAN_RTL_CXX_SOURCES} 46*7c3d14c8STreehugger Robot $<TARGET_OBJECTS:RTUbsan_cxx.${arch}> 47*7c3d14c8STreehugger Robot CFLAGS ${MSAN_RTL_CFLAGS} 48*7c3d14c8STreehugger Robot PARENT_TARGET msan) 49*7c3d14c8STreehugger Robot list(APPEND MSAN_RUNTIME_LIBRARIES clang_rt.msan-${arch} 50*7c3d14c8STreehugger Robot clang_rt.msan_cxx-${arch}) 51*7c3d14c8STreehugger Robot if(UNIX) 52*7c3d14c8STreehugger Robot add_sanitizer_rt_symbols(clang_rt.msan 53*7c3d14c8STreehugger Robot ARCHS ${arch} 54*7c3d14c8STreehugger Robot EXTRA msan.syms.extra) 55*7c3d14c8STreehugger Robot add_sanitizer_rt_symbols(clang_rt.msan_cxx 56*7c3d14c8STreehugger Robot ARCHS ${arch} 57*7c3d14c8STreehugger Robot EXTRA msan.syms.extra) 58*7c3d14c8STreehugger Robot add_dependencies(msan clang_rt.msan-${arch}-symbols 59*7c3d14c8STreehugger Robot clang_rt.msan_cxx-${arch}-symbols) 60*7c3d14c8STreehugger Robot endif() 61*7c3d14c8STreehugger Robotendforeach() 62*7c3d14c8STreehugger Robot 63*7c3d14c8STreehugger Robotadd_compiler_rt_resource_file(msan_blacklist msan_blacklist.txt msan) 64*7c3d14c8STreehugger Robotadd_dependencies(compiler-rt msan) 65*7c3d14c8STreehugger Robot 66*7c3d14c8STreehugger Robotif(COMPILER_RT_INCLUDE_TESTS) 67*7c3d14c8STreehugger Robot add_subdirectory(tests) 68*7c3d14c8STreehugger Robotendif() 69