[clang][extract-api] Emit "navigator" property of "name" in SymbolGraph
[llvm-project.git] / compiler-rt / lib / dfsan / CMakeLists.txt
blobc5190584ac0652647763bdf8e10fb25d4fa8951c
1 include_directories(..)
3 # Runtime library sources and build flags.
4 set(DFSAN_RTL_SOURCES
5   dfsan.cpp
6   dfsan_allocator.cpp
7   dfsan_chained_origin_depot.cpp
8   dfsan_custom.cpp
9   dfsan_interceptors.cpp
10   dfsan_new_delete.cpp
11   dfsan_thread.cpp
12   )
14 set(DFSAN_RTL_HEADERS
15   dfsan.h
16   dfsan_allocator.h
17   dfsan_chained_origin_depot.h
18   dfsan_flags.inc
19   dfsan_flags.h
20   dfsan_platform.h
21   dfsan_thread.h
22   )
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
39     STATIC
40     ARCHS ${arch}
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}
48     PARENT_TARGET dfsan)
49   add_sanitizer_rt_symbols(clang_rt.dfsan
50     ARCHS ${arch}
51     EXTRA dfsan.syms.extra)
52   add_dependencies(dfsan
53     clang_rt.dfsan-${arch}-symbols)
54 endforeach()
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}
61                    VERBATIM
62                    COMMAND
63                     ${CMAKE_COMMAND} -E make_directory ${dfsan_abilist_dir}
64                    COMMAND
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})