1 # Build system for the common Sanitizer runtime support library components.
2 # These components are shared between AddressSanitizer and ThreadSanitizer.
13 sanitizer_stackdepot.cc
14 sanitizer_stacktrace.cc
15 sanitizer_symbolizer.cc
16 sanitizer_symbolizer_itanium.cc
17 sanitizer_symbolizer_linux.cc
18 sanitizer_symbolizer_mac.cc
19 sanitizer_symbolizer_win.cc
23 # Explicitly list all sanitizer_common headers. Not all of these are
24 # included in sanitizer_common source files, but we need to depend on
25 # headers when building our custom unit tests.
28 sanitizer_atomic_clang.h
29 sanitizer_atomic_msvc.h
32 sanitizer_common_interceptors.inc
33 sanitizer_common_interceptors_scanf.inc
35 sanitizer_internal_defs.h
40 sanitizer_placement_new.h
41 sanitizer_platform_interceptors.h
43 sanitizer_quarantine.h
44 sanitizer_report_decorator.h
45 sanitizer_stackdepot.h
46 sanitizer_stacktrace.h
47 sanitizer_symbolizer.h
50 set(SANITIZER_CFLAGS ${SANITIZER_COMMON_CFLAGS})
52 set(SANITIZER_RUNTIME_LIBRARIES)
54 # Build universal binary on APPLE.
55 add_compiler_rt_osx_object_library(RTSanitizerCommon
56 ARCH ${SANITIZER_COMMON_SUPPORTED_ARCH}
57 SOURCES ${SANITIZER_SOURCES}
58 CFLAGS ${SANITIZER_CFLAGS})
59 list(APPEND SANITIZER_RUNTIME_LIBRARIES RTSanitizerCommon.osx)
61 add_library(RTSanitizerCommon.arm.android OBJECT ${SANITIZER_SOURCES})
62 set_target_compile_flags(RTSanitizerCommon.arm.android
64 list(APPEND SANITIZER_RUNTIME_LIBRARIES RTSanitizerCommon.arm.android)
66 # Otherwise, build separate libraries for each target.
67 foreach(arch ${SANITIZER_COMMON_SUPPORTED_ARCH})
68 add_compiler_rt_object_library(RTSanitizerCommon ${arch}
69 SOURCES ${SANITIZER_SOURCES} CFLAGS ${SANITIZER_CFLAGS})
70 list(APPEND SANITIZER_RUNTIME_LIBRARIES RTSanitizerCommon.${arch})
74 # Unit tests for common sanitizer runtime.
75 if(LLVM_INCLUDE_TESTS)
76 add_subdirectory(tests)