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 # Used by asan/hwasan even without COMPILER_RT_HAS_LSAN.
40 add_compiler_rt_object_libraries(RTLSanCommon
41 OS ${SANITIZER_COMMON_SUPPORTED_OS}
42 ARCHS ${LSAN_COMMON_SUPPORTED_ARCH}
43 SOURCES ${LSAN_COMMON_SOURCES}
44 ADDITIONAL_HEADERS ${LSAN_HEADERS}
45 CFLAGS ${LSAN_CFLAGS})
47 if(COMPILER_RT_HAS_LSAN)
48 add_compiler_rt_component(lsan)
50 set(LSAN_LINK_LIBS ${SANITIZER_COMMON_LINK_LIBS})
52 add_weak_symbols("lsan" WEAK_SYMBOL_LINK_FLAGS)
53 add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINK_FLAGS)
55 add_compiler_rt_runtime(clang_rt.lsan
57 OS ${LSAN_SUPPORTED_OS}
58 ARCHS ${LSAN_SUPPORTED_ARCH}
59 SOURCES ${LSAN_SOURCES}
60 ADDITIONAL_HEADERS ${LSAN_HEADERS}
61 OBJECT_LIBS RTLSanCommon
65 RTSanitizerCommonCoverage
66 RTSanitizerCommonSymbolizer
68 LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS} ${WEAK_SYMBOL_LINK_FLAGS}
69 LINK_LIBS ${LSAN_LINK_LIBS}
72 foreach(arch ${LSAN_SUPPORTED_ARCH})
73 add_compiler_rt_runtime(clang_rt.lsan
76 SOURCES ${LSAN_SOURCES}
77 $<TARGET_OBJECTS:RTInterception.${arch}>
78 $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
79 $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
80 $<TARGET_OBJECTS:RTSanitizerCommonCoverage.${arch}>
81 $<TARGET_OBJECTS:RTSanitizerCommonSymbolizer.${arch}>
82 $<TARGET_OBJECTS:RTSanitizerCommonSymbolizerInternal.${arch}>
83 $<TARGET_OBJECTS:RTLSanCommon.${arch}>
84 ADDITIONAL_HEADERS ${LSAN_HEADERS}