Skip to content

Commit 58c9a79

Browse files
author
Kostya Kortchinsky
committedSep 18, 2017
[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 llvm-svn: 313561
1 parent dc7d460 commit 58c9a79

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed
 

‎compiler-rt/test/sanitizer_common/android_commands/android_run.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def build_env():
1313
# Android linker ignores RPATH. Set LD_LIBRARY_PATH to Output dir.
1414
args.append('LD_LIBRARY_PATH=%s' % (ANDROID_TMPDIR,))
1515
for (key, value) in os.environ.items():
16-
if key in ['ASAN_OPTIONS', 'ASAN_ACTIVATION_OPTIONS']:
16+
if key in ['ASAN_OPTIONS', 'ASAN_ACTIVATION_OPTIONS', 'SCUDO_OPTIONS']:
1717
args.append('%s="%s"' % (key, value))
1818
return ' '.join(args)
1919

‎compiler-rt/test/scudo/lit.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if not config.android:
3232
c_flags += ["-lrt"]
3333

3434
def build_invocation(compile_flags):
35-
return " " + " ".join([config.clang] + compile_flags) + " "
35+
return " " + " ".join([config.compile_wrapper, config.clang] + compile_flags) + " "
3636

3737
# Add clang substitutions.
3838
config.substitutions.append(("%clang_scudo ",

‎compiler-rt/test/scudo/lit.site.cfg.in

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
config.name_suffix = "@SCUDO_TEST_CONFIG_SUFFIX@"
44
config.target_arch = "@SCUDO_TEST_TARGET_ARCH@"
55
config.target_cflags = "@SCUDO_TEST_TARGET_CFLAGS@"
6-
config.android = "@ANDROID@"
76

87
# Load common config for all compiler-rt lit tests.
98
lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")

‎compiler-rt/test/scudo/preinit.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
// Verifies that calling malloc in a preinit_array function succeeds, and that
55
// the resulting pointer can be freed at program termination.
66

7+
// On some Android versions, calling mmap() from a preinit function segfaults.
8+
// It looks like __mmap2.S ends up calling a NULL function pointer.
9+
// UNSUPPORTED: android
10+
711
#include <assert.h>
812
#include <stdlib.h>
913
#include <string.h>

0 commit comments

Comments
 (0)
Please sign in to comment.