summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
author Chih-Hung Hsieh <chh@google.com> 2022-10-03 12:15:03 -0700
committer Nicolas Geoffray <ngeoffray@google.com> 2022-10-11 12:05:16 +0000
commit22afe6d71c324502d99074749a3e84c577c3316b (patch)
tree691e2707809112f1a85703198f78007f5e914bae /build
parentbe282e173efd05b53632fe16d843474368283191 (diff)
Fix art-asan test mprotect errors
* Add -fsanitize-address-use-after-return=never in test/runtime cc defaults. * Increase stack frame size limit. * Avoid LOG(FATAL) in thread.cc. Bug: 249586057 Test: presubmit; art-asan Change-Id: I5728ea721e1699b9266dbb7265c9f4198de1e841
Diffstat (limited to 'build')
-rw-r--r--build/art.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/build/art.go b/build/art.go
index 383517bd1a..7b06353ca1 100644
--- a/build/art.go
+++ b/build/art.go
@@ -93,7 +93,7 @@ func globalFlags(ctx android.LoadHookContext) ([]string, []string) {
// the debug version. So make the gap consistent (and adjust for the worst).
if len(ctx.Config().SanitizeDevice()) > 0 || len(ctx.Config().SanitizeHost()) > 0 {
cflags = append(cflags,
- "-DART_STACK_OVERFLOW_GAP_arm=8192",
+ "-DART_STACK_OVERFLOW_GAP_arm=16384",
"-DART_STACK_OVERFLOW_GAP_arm64=16384",
"-DART_STACK_OVERFLOW_GAP_x86=16384",
"-DART_STACK_OVERFLOW_GAP_x86_64=20480")
@@ -153,7 +153,11 @@ func hostFlags(ctx android.LoadHookContext) []string {
if len(ctx.Config().SanitizeHost()) > 0 {
// art/test/137-cfi/cfi.cc
// error: stack frame size of 1944 bytes in function 'Java_Main_unwindInProcess'
- hostFrameSizeLimit = 6400
+ // b/249586057, need larger stack frame for newer clang compilers
+ hostFrameSizeLimit = 10000
+ // cannot add "-fsanitize-address-use-after-return=never" everywhere,
+ // or some file like compiler_driver.o can have stack frame of 30072 bytes.
+ // cflags = append(cflags, "-fsanitize-address-use-after-return=never")
}
cflags = append(cflags,
fmt.Sprintf("-Wframe-larger-than=%d", hostFrameSizeLimit),