[PATCH] D46461: [asan] Set flags appropriately for RTEMS

Walter Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 4 13:49:08 PDT 2018


waltl created this revision.
waltl added reviewers: vitalybuka, eugenis, alekseyshl.
Herald added a subscriber: kubamracek.

Disable both unmap_shadow_on_exit and protect_shadow_gap.


Repository:
  rL LLVM

https://reviews.llvm.org/D46461

Files:
  compiler-rt/lib/asan/asan_flags.cc
  compiler-rt/lib/asan/asan_flags.inc


Index: compiler-rt/lib/asan/asan_flags.inc
===================================================================
--- compiler-rt/lib/asan/asan_flags.inc
+++ compiler-rt/lib/asan/asan_flags.inc
@@ -86,9 +86,10 @@
 ASAN_FLAG(bool, check_malloc_usable_size, true,
           "Allows the users to work around the bug in Nvidia drivers prior to "
           "295.*.")
-ASAN_FLAG(bool, unmap_shadow_on_exit, false,
+ASAN_FLAG(bool, unmap_shadow_on_exit, !SANITIZER_RTEMS,
           "If set, explicitly unmaps the (huge) shadow at exit.")
-ASAN_FLAG(bool, protect_shadow_gap, true, "If set, mprotect the shadow gap")
+ASAN_FLAG(bool, protect_shadow_gap, !SANITIZER_RTEMS,
+          "If set, mprotect the shadow gap")
 ASAN_FLAG(bool, print_stats, false,
           "Print various statistics after printing an error message or if "
           "atexit=1.")
Index: compiler-rt/lib/asan/asan_flags.cc
===================================================================
--- compiler-rt/lib/asan/asan_flags.cc
+++ compiler-rt/lib/asan/asan_flags.cc
@@ -160,6 +160,10 @@
   CHECK_LE(f->max_redzone, 2048);
   CHECK(IsPowerOfTwo(f->redzone));
   CHECK(IsPowerOfTwo(f->max_redzone));
+  if (SANITIZER_RTEMS) {
+    CHECK(!f->unmap_shadow_on_exit);
+    CHECK(!f->protect_shadow_gap);
+  }
 
   // quarantine_size is deprecated but we still honor it.
   // quarantine_size can not be used together with quarantine_size_mb.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46461.145278.patch
Type: text/x-patch
Size: 1406 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180504/485c252b/attachment.bin>


More information about the llvm-commits mailing list