2012-06-25 16:40:10 +08:00
|
|
|
# First, add the subdirectories which contain feature-based runtime libraries
|
|
|
|
# and several convenience helper libraries.
|
2013-09-02 16:57:23 +08:00
|
|
|
|
2014-02-18 15:26:58 +08:00
|
|
|
include(AddCompilerRT)
|
|
|
|
include(SanitizerUtils)
|
2014-08-09 06:01:20 +08:00
|
|
|
|
2016-07-21 15:39:55 +08:00
|
|
|
# Hoist the building of sanitizer_common on whether we're building either the
|
|
|
|
# sanitizers or xray (or both).
|
|
|
|
#
|
|
|
|
#TODO: Refactor sanitizer_common into smaller pieces (e.g. flag parsing, utils).
|
|
|
|
if (COMPILER_RT_HAS_SANITIZER_COMMON AND
|
|
|
|
(COMPILER_RT_BUILD_SANITIZERS OR COMPILER_RT_BUILD_XRAY))
|
|
|
|
add_subdirectory(sanitizer_common)
|
|
|
|
endif()
|
|
|
|
|
2015-09-15 03:59:24 +08:00
|
|
|
if(COMPILER_RT_BUILD_BUILTINS)
|
|
|
|
add_subdirectory(builtins)
|
|
|
|
endif()
|
|
|
|
|
2019-05-01 02:13:22 +08:00
|
|
|
if(COMPILER_RT_BUILD_CRT AND COMPILER_RT_HAS_CRT)
|
|
|
|
add_subdirectory(crt)
|
|
|
|
endif()
|
|
|
|
|
2016-08-19 23:13:21 +08:00
|
|
|
function(compiler_rt_build_runtime runtime)
|
|
|
|
string(TOUPPER ${runtime} runtime_uppercase)
|
|
|
|
if(COMPILER_RT_HAS_${runtime_uppercase})
|
|
|
|
add_subdirectory(${runtime})
|
2017-06-28 05:10:46 +08:00
|
|
|
if(${runtime} STREQUAL tsan)
|
|
|
|
add_subdirectory(tsan/dd)
|
|
|
|
endif()
|
[scudo] Initial standalone skeleton check-in
Summary:
This is the initial check-in for the Standalone version of Scudo.
The project is initially going to live in scudo/standalone then will
replace scudo. See http://lists.llvm.org/pipermail/llvm-dev/2019-January/129113.html
for details.
This initial CL is meant to lay out the project structure, of both
code & tests, providing a minimal amount of functionalities, namely
various definitions, some atomic helpers and an intrusive list.
(empty.cc is just here to have a compilation unit, but will go away
in the upcoming CLs).
Initial support is restricted to Linux i386 & x86_64 in make files
and will be extended once things land & work.
We will grow organically from here, adding functionalities in limited
amounts.
Reviewers: morehouse, eugenis, vitalybuka, kcc, mcgrathr, flowerhack
Reviewed By: morehouse, vitalybuka
Subscribers: srhines, mgorny, krytarowski, delcypher, jfb, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D57412
llvm-svn: 353055
2019-02-05 00:25:40 +08:00
|
|
|
if(${runtime} STREQUAL scudo)
|
|
|
|
add_subdirectory(scudo/standalone)
|
|
|
|
endif()
|
2015-12-10 08:40:58 +08:00
|
|
|
endif()
|
2016-08-19 23:13:21 +08:00
|
|
|
endfunction()
|
|
|
|
|
|
|
|
if(COMPILER_RT_BUILD_SANITIZERS)
|
|
|
|
compiler_rt_build_runtime(interception)
|
2015-12-10 08:40:58 +08:00
|
|
|
|
|
|
|
if(COMPILER_RT_HAS_SANITIZER_COMMON)
|
2016-01-16 08:31:29 +08:00
|
|
|
add_subdirectory(stats)
|
2015-12-10 08:40:58 +08:00
|
|
|
add_subdirectory(lsan)
|
|
|
|
add_subdirectory(ubsan)
|
|
|
|
endif()
|
|
|
|
|
2017-06-28 03:32:39 +08:00
|
|
|
foreach(sanitizer ${COMPILER_RT_SANITIZERS_TO_BUILD})
|
|
|
|
compiler_rt_build_runtime(${sanitizer})
|
|
|
|
endforeach()
|
2017-09-19 02:13:47 +08:00
|
|
|
endif()
|
2015-12-10 08:40:58 +08:00
|
|
|
|
2017-10-02 13:03:55 +08:00
|
|
|
if(COMPILER_RT_BUILD_PROFILE AND COMPILER_RT_HAS_PROFILE)
|
2016-08-19 23:13:21 +08:00
|
|
|
compiler_rt_build_runtime(profile)
|
2016-07-20 22:14:50 +08:00
|
|
|
endif()
|
2016-07-21 15:39:55 +08:00
|
|
|
|
2016-08-19 23:13:21 +08:00
|
|
|
if(COMPILER_RT_BUILD_XRAY)
|
|
|
|
compiler_rt_build_runtime(xray)
|
2016-07-21 15:39:55 +08:00
|
|
|
endif()
|
2017-08-22 07:25:50 +08:00
|
|
|
|
|
|
|
if(COMPILER_RT_BUILD_LIBFUZZER)
|
|
|
|
compiler_rt_build_runtime(fuzzer)
|
|
|
|
endif()
|
2020-01-28 10:43:46 +08:00
|
|
|
|
|
|
|
# It doesn't normally make sense to build runtimes when a sanitizer is enabled,
|
|
|
|
# so we don't add_subdirectory the runtimes in that case. However, the opposite
|
|
|
|
# is true for fuzzers that exercise parts of the runtime. So we add the fuzzer
|
|
|
|
# directories explicitly here.
|
|
|
|
add_subdirectory(scudo/standalone/fuzz)
|