[PATCH] D70958: [compiler-rt] [test] Disable ASLR on ASAN/MSAN/TSAN tests on NetBSD

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 5 23:11:18 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG6c2b2b9e20ab: [compiler-rt] [test] Disable ASLR on ASAN/MSAN/TSAN tests on NetBSD (authored by mgorny).
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70958/new/

https://reviews.llvm.org/D70958

Files:
  compiler-rt/test/asan/lit.cfg.py
  compiler-rt/test/lit.common.cfg.py
  compiler-rt/test/msan/lit.cfg.py
  compiler-rt/test/sanitizer_common/lit.common.cfg.py
  compiler-rt/test/sanitizer_common/netbsd_commands/run_noaslr.sh
  compiler-rt/test/tsan/lit.cfg.py


Index: compiler-rt/test/tsan/lit.cfg.py
===================================================================
--- compiler-rt/test/tsan/lit.cfg.py
+++ compiler-rt/test/tsan/lit.cfg.py
@@ -88,3 +88,6 @@
 
 if not config.parallelism_group:
   config.parallelism_group = 'shadow-memory'
+
+if config.host_os == 'NetBSD':
+  config.substitutions.insert(0, ('%run', config.netbsd_noaslr_prefix))
Index: compiler-rt/test/sanitizer_common/netbsd_commands/run_noaslr.sh
===================================================================
--- /dev/null
+++ compiler-rt/test/sanitizer_common/netbsd_commands/run_noaslr.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+/usr/sbin/paxctl +a "${1}"
+exec "${@}"
Index: compiler-rt/test/sanitizer_common/lit.common.cfg.py
===================================================================
--- compiler-rt/test/sanitizer_common/lit.common.cfg.py
+++ compiler-rt/test/sanitizer_common/lit.common.cfg.py
@@ -73,3 +73,6 @@
 
 if not config.parallelism_group:
   config.parallelism_group = 'shadow-memory'
+
+if config.host_os == 'NetBSD':
+  config.substitutions.insert(0, ('%run', config.netbsd_noaslr_prefix))
Index: compiler-rt/test/msan/lit.cfg.py
===================================================================
--- compiler-rt/test/msan/lit.cfg.py
+++ compiler-rt/test/msan/lit.cfg.py
@@ -45,3 +45,6 @@
   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))
Index: compiler-rt/test/lit.common.cfg.py
===================================================================
--- compiler-rt/test/lit.common.cfg.py
+++ compiler-rt/test/lit.common.cfg.py
@@ -498,3 +498,9 @@
 
 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'))
Index: compiler-rt/test/asan/lit.cfg.py
===================================================================
--- compiler-rt/test/asan/lit.cfg.py
+++ compiler-rt/test/asan/lit.cfg.py
@@ -237,3 +237,6 @@
 
 if not config.parallelism_group:
   config.parallelism_group = 'shadow-memory'
+
+if config.host_os == 'NetBSD':
+  config.substitutions.insert(0, ('%run', config.netbsd_noaslr_prefix))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70958.232496.patch
Type: text/x-patch
Size: 2660 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191206/f318fc2a/attachment.bin>


More information about the cfe-commits mailing list