[PATCH] D71513: [compiler-rt] [test] Disable MPROTECT on two builtin tests

Michał Górny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 14 08:10:21 PST 2019


mgorny created this revision.
mgorny added reviewers: krytarowski, rnk, samsonov, howard.hinnant.
Herald added subscribers: llvm-commits, dberris.
Herald added a project: LLVM.

Introduce a new %paxctl_nomprotect substitution and call it on two
builtin tests that do not work with MPROTECT on NetBSD.  This
substitution evaluates to no-op command (':') on other systems.


https://reviews.llvm.org/D71513

Files:
  compiler-rt/test/builtins/Unit/clear_cache_test.c
  compiler-rt/test/builtins/Unit/enable_execute_stack_test.c
  compiler-rt/test/lit.common.cfg.py


Index: compiler-rt/test/lit.common.cfg.py
===================================================================
--- compiler-rt/test/lit.common.cfg.py
+++ compiler-rt/test/lit.common.cfg.py
@@ -504,3 +504,6 @@
                                  "test", "sanitizer_common", "netbsd_commands")
   config.netbsd_noaslr_prefix = ('sh ' +
                                  os.path.join(nb_commands_dir, 'run_noaslr.sh'))
+  config.substitutions.append( ('%paxctl_nomprotect', '/usr/sbin/paxctl +m') )
+else:
+  config.substitutions.append( ('%paxctl_nomprotect', ':') )
Index: compiler-rt/test/builtins/Unit/enable_execute_stack_test.c
===================================================================
--- compiler-rt/test/builtins/Unit/enable_execute_stack_test.c
+++ compiler-rt/test/builtins/Unit/enable_execute_stack_test.c
@@ -1,5 +1,5 @@
 // REQUIRES: native-run
-// RUN: %clang_builtins %s %librt -o %t && %run %t
+// RUN: %clang_builtins %s %librt -o %t && %paxctl_nomprotect %t && %run %t
 // REQUIRES: librt_has_enable_execute_stack
 //===-- enable_execute_stack_test.c - Test __enable_execute_stack ----------===//
 //
Index: compiler-rt/test/builtins/Unit/clear_cache_test.c
===================================================================
--- compiler-rt/test/builtins/Unit/clear_cache_test.c
+++ compiler-rt/test/builtins/Unit/clear_cache_test.c
@@ -1,6 +1,6 @@
 // REQUIRES: native-run
 // UNSUPPORTED: arm, aarch64
-// RUN: %clang_builtins %s %librt -o %t && %run %t
+// RUN: %clang_builtins %s %librt -o %t && %paxctl_nomprotect %t && %run %t
 // REQUIRES: librt_has_clear_cache
 //===-- clear_cache_test.c - Test clear_cache -----------------------------===//
 //


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71513.233935.patch
Type: text/x-patch
Size: 1679 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191214/e3bd0f08/attachment.bin>


More information about the llvm-commits mailing list