1 include_directories(..)
3 # Runtime library sources and build flags.
7 dfsan_chained_origin_depot.cpp
17 dfsan_chained_origin_depot.h
24 set(DFSAN_COMMON_CFLAGS ${SANITIZER_COMMON_CFLAGS})
25 append_rtti_flag(OFF DFSAN_COMMON_CFLAGS)
26 # Prevent clang from generating libc calls.
27 append_list_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding DFSAN_COMMON_CFLAGS)
29 # Too many existing bugs, needs cleanup.
30 append_list_if(COMPILER_RT_HAS_WNO_FORMAT -Wno-format DFSAN_COMMON_CFLAGS)
32 # Static runtime library.
33 add_compiler_rt_component(dfsan)
35 foreach(arch ${DFSAN_SUPPORTED_ARCH})
36 set(DFSAN_CFLAGS ${DFSAN_COMMON_CFLAGS})
37 append_list_if(COMPILER_RT_HAS_FPIE_FLAG -fPIE DFSAN_CFLAGS)
38 add_compiler_rt_runtime(clang_rt.dfsan
41 SOURCES ${DFSAN_RTL_SOURCES}
42 $<TARGET_OBJECTS:RTInterception.${arch}>
43 $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
44 $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
45 $<TARGET_OBJECTS:RTSanitizerCommonSymbolizer.${arch}>
46 $<TARGET_OBJECTS:RTSanitizerCommonSymbolizerInternal.${arch}>
47 ADDITIONAL_HEADERS ${DFSAN_RTL_HEADERS}
48 CFLAGS ${DFSAN_CFLAGS}
50 add_sanitizer_rt_symbols(clang_rt.dfsan
52 EXTRA dfsan.syms.extra)
53 add_dependencies(dfsan
54 clang_rt.dfsan-${arch}-symbols)
57 set(dfsan_abilist_dir ${COMPILER_RT_OUTPUT_DIR}/share)
58 set(dfsan_abilist_filename ${dfsan_abilist_dir}/dfsan_abilist.txt)
59 add_custom_target(dfsan_abilist ALL
60 DEPENDS ${dfsan_abilist_filename})
61 add_custom_command(OUTPUT ${dfsan_abilist_filename}
64 ${CMAKE_COMMAND} -E make_directory ${dfsan_abilist_dir}
66 ${CMAKE_COMMAND} -E cat
67 ${CMAKE_CURRENT_SOURCE_DIR}/done_abilist.txt
68 ${CMAKE_CURRENT_SOURCE_DIR}/libc_ubuntu1404_abilist.txt
69 > ${dfsan_abilist_filename}
70 DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt)
71 add_dependencies(dfsan dfsan_abilist)
72 install(FILES ${dfsan_abilist_filename}
73 DESTINATION ${COMPILER_RT_INSTALL_DATA_DIR})