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 | f8005d62ca3331389e2bb9489710e177ba94da74 (patch) | |
tree | 4b23b3724779ccbb9a6618bf2c6119d308215a84 /test | |
parent | 1ad28c758255a9594220c5210bbc6fed26e6da07 (diff) |
[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
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318038 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/lit.common.cfg | 4 | ||||
-rw-r--r-- | test/lit.common.configured.in | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/test/lit.common.cfg b/test/lit.common.cfg index af4bf007c..4b33bb033 100644 --- a/test/lit.common.cfg +++ b/test/lit.common.cfg @@ -46,6 +46,10 @@ else: # Add compiler ID to the list of available features. config.available_features.add(compiler_id) +# If needed, add cflag for shadow scale. +if config.asan_shadow_scale != '': + config.target_cflags += " -mllvm -asan-mapping-scale=" + config.asan_shadow_scale + # BFD linker in 64-bit android toolchains fails to find libm.so, which is a # transitive shared library dependency (via asan runtime). if config.android: diff --git a/test/lit.common.configured.in b/test/lit.common.configured.in index c39a2e4af..e2da4cc9b 100644 --- a/test/lit.common.configured.in +++ b/test/lit.common.configured.in @@ -25,6 +25,7 @@ set_default("python_executable", "@PYTHON_EXECUTABLE@") set_default("compiler_rt_debug", @COMPILER_RT_DEBUG_PYBOOL@) set_default("compiler_rt_libdir", "@COMPILER_RT_RESOLVED_LIBRARY_OUTPUT_DIR@") set_default("emulator", "@COMPILER_RT_EMULATOR@") +set_default("asan_shadow_scale", "@COMPILER_RT_ASAN_SHADOW_SCALE@") set_default("ios", False) set_default("iossim", False) set_default("sanitizer_can_use_cxxabi", @SANITIZER_CAN_USE_CXXABI_PYBOOL@) |