mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-28 02:37:37 +00:00
[compiler-rt] [test] Disable ASLR on ASAN/MSAN/TSAN tests on NetBSD
Use a new %run wrapper for ASAN/MSAN/TSAN tests that calls paxctl in order to disable ASLR on the test executables. This makes it possible to test sanitizers on systems where ASLR is enabled by default. Differential Revision: https://reviews.llvm.org/D70958
This commit is contained in:
parent
90409f73a5
commit
6c2b2b9e20
@ -237,3 +237,6 @@ if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'SunOS', 'Windows', 'Net
|
||||
|
||||
if not config.parallelism_group:
|
||||
config.parallelism_group = 'shadow-memory'
|
||||
|
||||
if config.host_os == 'NetBSD':
|
||||
config.substitutions.insert(0, ('%run', config.netbsd_noaslr_prefix))
|
||||
|
@ -498,3 +498,9 @@ elif config.use_lld and (not config.has_lld):
|
||||
|
||||
config.clang = " " + " ".join(run_wrapper + [config.compile_wrapper, config.clang]) + " "
|
||||
config.target_cflags = " " + " ".join(target_cflags + extra_cflags) + " "
|
||||
|
||||
if config.host_os == 'NetBSD':
|
||||
nb_commands_dir = os.path.join(config.compiler_rt_src_root,
|
||||
"test", "sanitizer_common", "netbsd_commands")
|
||||
config.netbsd_noaslr_prefix = ('sh ' +
|
||||
os.path.join(nb_commands_dir, 'run_noaslr.sh'))
|
||||
|
@ -45,3 +45,6 @@ if config.host_arch in ['mips64', 'mips64el']:
|
||||
config.substitutions.append( ('CHECK-%short-stack', 'CHECK-SHORT-STACK'))
|
||||
else:
|
||||
config.substitutions.append( ('CHECK-%short-stack', 'CHECK-FULL-STACK'))
|
||||
|
||||
if config.host_os == 'NetBSD':
|
||||
config.substitutions.insert(0, ('%run', config.netbsd_noaslr_prefix))
|
||||
|
@ -73,3 +73,6 @@ if config.host_os not in ['Linux', 'Darwin', 'NetBSD', 'FreeBSD']:
|
||||
|
||||
if not config.parallelism_group:
|
||||
config.parallelism_group = 'shadow-memory'
|
||||
|
||||
if config.host_os == 'NetBSD':
|
||||
config.substitutions.insert(0, ('%run', config.netbsd_noaslr_prefix))
|
||||
|
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
/usr/sbin/paxctl +a "${1}"
|
||||
exec "${@}"
|
@ -88,3 +88,6 @@ if config.android:
|
||||
|
||||
if not config.parallelism_group:
|
||||
config.parallelism_group = 'shadow-memory'
|
||||
|
||||
if config.host_os == 'NetBSD':
|
||||
config.substitutions.insert(0, ('%run', config.netbsd_noaslr_prefix))
|
||||
|
Loading…
Reference in New Issue
Block a user