2016-04-22 05:32:25 +08:00
|
|
|
# Build for the EfficiencySanitizer runtime support library.
|
|
|
|
|
2016-08-27 04:52:22 +08:00
|
|
|
add_compiler_rt_component(esan)
|
2016-04-22 05:32:25 +08:00
|
|
|
|
|
|
|
set(ESAN_RTL_CFLAGS ${SANITIZER_COMMON_CFLAGS})
|
|
|
|
append_rtti_flag(OFF ESAN_RTL_CFLAGS)
|
|
|
|
|
|
|
|
include_directories(..)
|
|
|
|
|
|
|
|
set(ESAN_SOURCES
|
|
|
|
esan.cpp
|
2016-05-21 03:26:52 +08:00
|
|
|
esan_flags.cpp
|
2016-04-24 00:41:24 +08:00
|
|
|
esan_interface.cpp
|
2016-05-25 10:04:04 +08:00
|
|
|
esan_interceptors.cpp
|
2016-05-28 08:25:16 +08:00
|
|
|
esan_linux.cpp
|
2016-06-04 00:14:07 +08:00
|
|
|
esan_sideline_linux.cpp
|
2016-05-26 01:49:00 +08:00
|
|
|
cache_frag.cpp
|
2016-05-31 21:21:03 +08:00
|
|
|
working_set.cpp
|
|
|
|
working_set_posix.cpp)
|
2016-04-22 05:32:25 +08:00
|
|
|
|
|
|
|
foreach (arch ${ESAN_SUPPORTED_ARCH})
|
|
|
|
add_compiler_rt_runtime(clang_rt.esan
|
|
|
|
STATIC
|
|
|
|
ARCHS ${arch}
|
|
|
|
SOURCES ${ESAN_SOURCES}
|
|
|
|
$<TARGET_OBJECTS:RTInterception.${arch}>
|
|
|
|
$<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
|
|
|
|
$<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
|
[sanitizer] Split Symbolizer/StackTraces from core RTSanitizerCommon
Summary:
Host symbolizer & stacktraces related code in their own RT:
`RTSanitizerCommonSymbolizer`, which is "libcdep" by nature. Symbolizer &
stacktraces specific code that used to live in common files is moved to a new
file `sanitizer_symbolizer_report.cc` as is.
The purpose of this is the enforce a separation between code that relies on
symbolization and code that doesn't. This saves the inclusion of spurious code
due to the interface functions with default visibility, and the extra data
associated.
The following sanitizers makefiles were modified & tested locally:
- dfsan: doesn't require the new symbolizer RT
- esan: requires it
- hwasan: requires it
- lsan: requires it
- msan: requires it
- safestack: doesn't require it
- xray: doesn't require it
- tsan: requires it
- ubsan: requires it
- ubsan_minimal: doesn't require it
- scudo: requires it (but not for Fuchsia that has a minimal runtime)
This was tested locally on Linux, Android, Fuchsia.
Reviewers: alekseyshl, eugenis, dberris, kubamracek, vitalybuka, dvyukov, mcgrathr
Reviewed By: alekseyshl, vitalybuka
Subscribers: srhines, kubamracek, mgorny, krytarowski, delcypher, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D45457
llvm-svn: 330131
2018-04-17 00:32:19 +08:00
|
|
|
$<TARGET_OBJECTS:RTSanitizerCommonSymbolizer.${arch}>
|
2016-04-22 05:32:25 +08:00
|
|
|
CFLAGS ${ESAN_RTL_CFLAGS})
|
|
|
|
add_sanitizer_rt_symbols(clang_rt.esan
|
|
|
|
ARCHS ${arch}
|
|
|
|
EXTRA esan.syms.extra)
|
|
|
|
add_dependencies(esan
|
|
|
|
clang_rt.esan-${arch}
|
|
|
|
clang_rt.esan-${arch}-symbols)
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
if (COMPILER_RT_INCLUDE_TESTS)
|
|
|
|
# TODO(bruening): add tests via add_subdirectory(tests)
|
|
|
|
endif()
|