llvm-project/compiler-rt/lib
Kostya Kortchinsky ee0695766c [scudo] Add Android support
Summary:
This change adds Android support to the allocator (but doesn't yet enable it in
the cmake config), and should be the last fragment of the rewritten change
D31947.

Android has more memory constraints than other platforms, so the idea of a
unique context per thread would not have worked. The alternative chosen is to
allocate a set of contexts based on the number of cores on the machine, and
share those contexts within the threads. Contexts can be dynamically reassigned
to threads to prevent contention, based on a scheme suggested by @dvyuokv in
the initial review.

Additionally, given that Android doesn't support ELF TLS (only emutls for now),
we use the TSan TLS slot to make things faster: Scudo is mutually exclusive
with other sanitizers so this shouldn't cause any problem.

An additional change made here, is replacing `thread_local` by `THREADLOCAL`
and using the initial-exec thread model in the non-Android version to prevent
extraneous weak definition and checks on the relevant variables.

Reviewers: kcc, dvyukov, alekseyshl

Reviewed By: alekseyshl

Subscribers: srhines, mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D32649

llvm-svn: 302300
2017-05-05 21:38:22 +00:00
..
BlocksRuntime
asan [ASAN] Add interceptor for __longjmp_chk 2017-05-04 14:03:57 +00:00
builtins [compiler-rt][mips] Add support for quad precision builtins for mips64 2017-05-04 13:34:17 +00:00
cfi CFI: Add a blacklist entry for std::_Sp_counted_ptr_inplace::_Sp_counted_ptr_inplace(). 2017-05-05 18:46:14 +00:00
dfsan [sanitizer-coverage] remove more unused code 2017-04-19 23:05:53 +00:00
esan [sanitizer] Move fread and fwrite interceptors to sanitizer_common 2017-03-30 07:25:33 +00:00
interception [interception] Check for export table's size before referring to its elements. 2017-01-30 18:23:37 +00:00
lsan [sanitizer] Intercept mcheck and mprobe on Linux 2017-05-03 07:09:10 +00:00
msan Revert r301904 causing tsan test failure in x86_64-linux-autoconf 2017-05-02 10:22:05 +00:00
profile [profile] Sync up InstrProfData.inc (NFC) 2017-04-15 00:10:33 +00:00
safestack [compiler-rt] Do not introduce __sanitizer namespace globally 2016-09-15 21:02:18 +00:00
sanitizer_common [asan] print the 'unexpected format specifier in printf interceptor' warning just once (came up in https://github.com/google/oss-fuzz/pull/562). Not touching a similar scanf warning -- for some reason it does not fire for me. 2017-05-03 18:38:34 +00:00
scudo [scudo] Add Android support 2017-05-05 21:38:22 +00:00
stats Revert "[sancov] moving sancov rt to sancov/ directory" 2017-01-12 01:37:35 +00:00
tsan [tsan] Detect races on modifying accesses in Swift code 2017-05-03 16:51:01 +00:00
ubsan [ubsan] Implement __sanitizer_print_stack_trace for standalone UBSan runtime. 2017-05-05 09:02:28 +00:00
xray [XRay][compiler-rt] Add function id utilities for XRay 2017-05-05 01:27:11 +00:00
CMakeLists.txt Revert "[sancov] moving sancov rt to sancov/ directory" 2017-01-12 01:37:35 +00:00