1 include_directories(..)
3 set(LSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
4 append_rtti_flag(OFF LSAN_CFLAGS)
6 # Too many existing bugs, needs cleanup.
7 append_list_if(COMPILER_RT_HAS_WNO_FORMAT -Wno-format LSAN_CFLAGS)
9 set(LSAN_COMMON_SOURCES
11 lsan_common_fuchsia.cpp
37 set(LSAN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
39 add_compiler_rt_object_libraries(RTLSanCommon
40 OS ${SANITIZER_COMMON_SUPPORTED_OS}
41 ARCHS ${LSAN_COMMON_SUPPORTED_ARCH}
42 SOURCES ${LSAN_COMMON_SOURCES}
43 ADDITIONAL_HEADERS ${LSAN_HEADERS}
44 CFLAGS ${LSAN_CFLAGS})
46 if(COMPILER_RT_HAS_LSAN)
47 add_compiler_rt_component(lsan)
49 set(LSAN_LINK_LIBS ${SANITIZER_COMMON_LINK_LIBS})
51 add_weak_symbols("lsan" WEAK_SYMBOL_LINK_FLAGS)
52 add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINK_FLAGS)
54 add_compiler_rt_runtime(clang_rt.lsan
56 OS ${LSAN_SUPPORTED_OS}
57 ARCHS ${LSAN_SUPPORTED_ARCH}
58 SOURCES ${LSAN_SOURCES}
59 ADDITIONAL_HEADERS ${LSAN_HEADERS}
60 OBJECT_LIBS RTLSanCommon
64 RTSanitizerCommonCoverage
65 RTSanitizerCommonSymbolizer
67 LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS} ${WEAK_SYMBOL_LINK_FLAGS}
68 LINK_LIBS ${LSAN_LINK_LIBS}
71 foreach(arch ${LSAN_SUPPORTED_ARCH})
72 add_compiler_rt_runtime(clang_rt.lsan
75 SOURCES ${LSAN_SOURCES}
76 $<TARGET_OBJECTS:RTInterception.${arch}>
77 $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
78 $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
79 $<TARGET_OBJECTS:RTSanitizerCommonCoverage.${arch}>
80 $<TARGET_OBJECTS:RTSanitizerCommonSymbolizer.${arch}>
81 $<TARGET_OBJECTS:RTSanitizerCommonSymbolizerInternal.${arch}>
82 $<TARGET_OBJECTS:RTLSanCommon.${arch}>
83 ADDITIONAL_HEADERS ${LSAN_HEADERS}