[compiler-rt] r313561 - [scudo] Additional modifications for Android tests support
Kostya Kortchinsky via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 18 13:31:57 PDT 2017
Author: cryptoad
Date: Mon Sep 18 13:31:57 2017
New Revision: 313561
URL: http://llvm.org/viewvc/llvm-project?rev=313561&view=rev
Log:
[scudo] Additional modifications for Android tests support
Summary:
With the recent move of `android_commands` to `sanitizer_common`, some things
have to be updated with regard to Scudo on Android.
Notably:
- `config.android` is dealt with in the common code
- `config.compile_wrapper` can be prepended to allow for the use of the android
commands
- `SCUDO_OPTIONS` must be passed with the environment when running a test
- `preinit.cpp` fails with some API levels, not sure why, I will have to dig
into this later.
Note that `check-scudo` is not enabled yet in the bots. It's all local testing
for now until everything looks good.
Reviewers: alekseyshl, vitalybuka
Reviewed By: vitalybuka
Subscribers: srhines, kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D37990
Modified:
compiler-rt/trunk/test/sanitizer_common/android_commands/android_run.py
compiler-rt/trunk/test/scudo/lit.cfg
compiler-rt/trunk/test/scudo/lit.site.cfg.in
compiler-rt/trunk/test/scudo/preinit.cpp
Modified: compiler-rt/trunk/test/sanitizer_common/android_commands/android_run.py
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/android_commands/android_run.py?rev=313561&r1=313560&r2=313561&view=diff
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/android_commands/android_run.py (original)
+++ compiler-rt/trunk/test/sanitizer_common/android_commands/android_run.py Mon Sep 18 13:31:57 2017
@@ -13,7 +13,7 @@ def build_env():
# Android linker ignores RPATH. Set LD_LIBRARY_PATH to Output dir.
args.append('LD_LIBRARY_PATH=%s' % (ANDROID_TMPDIR,))
for (key, value) in os.environ.items():
- if key in ['ASAN_OPTIONS', 'ASAN_ACTIVATION_OPTIONS']:
+ if key in ['ASAN_OPTIONS', 'ASAN_ACTIVATION_OPTIONS', 'SCUDO_OPTIONS']:
args.append('%s="%s"' % (key, value))
return ' '.join(args)
Modified: compiler-rt/trunk/test/scudo/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/scudo/lit.cfg?rev=313561&r1=313560&r2=313561&view=diff
==============================================================================
--- compiler-rt/trunk/test/scudo/lit.cfg (original)
+++ compiler-rt/trunk/test/scudo/lit.cfg Mon Sep 18 13:31:57 2017
@@ -32,7 +32,7 @@ if not config.android:
c_flags += ["-lrt"]
def build_invocation(compile_flags):
- return " " + " ".join([config.clang] + compile_flags) + " "
+ return " " + " ".join([config.compile_wrapper, config.clang] + compile_flags) + " "
# Add clang substitutions.
config.substitutions.append(("%clang_scudo ",
Modified: compiler-rt/trunk/test/scudo/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/scudo/lit.site.cfg.in?rev=313561&r1=313560&r2=313561&view=diff
==============================================================================
--- compiler-rt/trunk/test/scudo/lit.site.cfg.in (original)
+++ compiler-rt/trunk/test/scudo/lit.site.cfg.in Mon Sep 18 13:31:57 2017
@@ -3,7 +3,6 @@
config.name_suffix = "@SCUDO_TEST_CONFIG_SUFFIX@"
config.target_arch = "@SCUDO_TEST_TARGET_ARCH@"
config.target_cflags = "@SCUDO_TEST_TARGET_CFLAGS@"
-config.android = "@ANDROID@"
# Load common config for all compiler-rt lit tests.
lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
Modified: compiler-rt/trunk/test/scudo/preinit.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/scudo/preinit.cpp?rev=313561&r1=313560&r2=313561&view=diff
==============================================================================
--- compiler-rt/trunk/test/scudo/preinit.cpp (original)
+++ compiler-rt/trunk/test/scudo/preinit.cpp Mon Sep 18 13:31:57 2017
@@ -4,6 +4,10 @@
// Verifies that calling malloc in a preinit_array function succeeds, and that
// the resulting pointer can be freed at program termination.
+// On some Android versions, calling mmap() from a preinit function segfaults.
+// It looks like __mmap2.S ends up calling a NULL function pointer.
+// UNSUPPORTED: android
+
#include <assert.h>
#include <stdlib.h>
#include <string.h>
More information about the llvm-commits
mailing list