diff options
| author | Walter Lee <waltl@google.com> | 2017-11-13 14:02:27 +0000 |
|---|---|---|
| committer | Walter Lee <waltl@google.com> | 2017-11-13 14:02:27 +0000 |
| commit | 52b2bd7845497c36e45b87a42f737c5cc925b537 (patch) | |
| tree | 5ee32686a8e54c0ff16e451afa325b32d046587b /compiler-rt/lib/asan/asan_mapping.h | |
| parent | d6b0ecb79514e4c188e725e33b4bc92f5213f602 (diff) | |
| download | bcm5719-llvm-52b2bd7845497c36e45b87a42f737c5cc925b537.tar.gz bcm5719-llvm-52b2bd7845497c36e45b87a42f737c5cc925b537.zip | |
[asan] Add CMake hook to override shadow scale in compiler_rt
Allow user to override shadow scale in compiler_rt by passing
-DCOMPILER_RT_ASAN_SHADOW_SCALE=n to CMake. Propagate the override
shadow scale value via a compiler define to compiler-rt and asan
tests. Tests will use the define to partially disable unsupported
tests. Set "-mllvm -asan-mapping-scale=<n>" for compiler_rt tests.
Differential Revision: https://reviews.llvm.org/D39469
llvm-svn: 318038
Diffstat (limited to 'compiler-rt/lib/asan/asan_mapping.h')
| -rw-r--r-- | compiler-rt/lib/asan/asan_mapping.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/asan_mapping.h b/compiler-rt/lib/asan/asan_mapping.h index febe090e2ea..c1e965c7a01 100644 --- a/compiler-rt/lib/asan/asan_mapping.h +++ b/compiler-rt/lib/asan/asan_mapping.h @@ -131,7 +131,11 @@ // || `[0x30000000, 0x35ffffff]` || LowShadow || // || `[0x00000000, 0x2fffffff]` || LowMem || +#if defined(ASAN_SHADOW_SCALE) +static const u64 kDefaultShadowScale = ASAN_SHADOW_SCALE; +#else static const u64 kDefaultShadowScale = 3; +#endif static const u64 kDefaultShadowSentinel = ~(uptr)0; static const u64 kDefaultShadowOffset32 = 1ULL << 29; // 0x20000000 static const u64 kDefaultShadowOffset64 = 1ULL << 44; |

