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 ADDITIONAL_HEADERS ${DFSAN_RTL_HEADERS}
47 CFLAGS ${DFSAN_CFLAGS}
49 add_sanitizer_rt_symbols(clang_rt.dfsan
51 EXTRA dfsan.syms.extra)
52 add_dependencies(dfsan
53 clang_rt.dfsan-${arch}-symbols)
56 set(dfsan_abilist_dir ${COMPILER_RT_OUTPUT_DIR}/share)
57 set(dfsan_abilist_filename ${dfsan_abilist_dir}/dfsan_abilist.txt)
58 add_custom_target(dfsan_abilist ALL
59 DEPENDS ${dfsan_abilist_filename})
60 add_custom_command(OUTPUT ${dfsan_abilist_filename}
63 ${CMAKE_COMMAND} -E make_directory ${dfsan_abilist_dir}
65 cat ${CMAKE_CURRENT_SOURCE_DIR}/done_abilist.txt
66 ${CMAKE_CURRENT_SOURCE_DIR}/libc_ubuntu1404_abilist.txt
67 > ${dfsan_abilist_filename}
68 DEPENDS done_abilist.txt libc_ubuntu1404_abilist.txt)
69 add_dependencies(dfsan dfsan_abilist)
70 install(FILES ${dfsan_abilist_filename}
71 DESTINATION ${COMPILER_RT_INSTALL_DATA_DIR})