From 11c00348214b9192bae7611dc68af2637d6ab38c Mon Sep 17 00:00:00 2001 From: ahs Date: Fri, 9 Apr 2021 09:34:03 +0530 Subject: Fixing segfault crash in x86_64 get_size testcase getsize_x86_64 testcase is crashing with segfault when trying to access the stack pointer. Compile the testcase with -mstackrealign option to realign the runtime stack so that segfault is avoided when accessing the stack pointer. Bug: 184920505 Signed-off-by: ahs Test: run vts -m vts_linux_kselftest_x86_64 -t size_get_size_x86_64 Change-Id: I013a72cbe5311167bad0c278a1f23ff16327e83c --- Android.bp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Android.bp b/Android.bp index 71975a4b9aba..e56904c3722e 100644 --- a/Android.bp +++ b/Android.bp @@ -474,6 +474,11 @@ cc_test { name: "kselftest_size_test", relative_install_path: "linux-kselftest/size", srcs: ["tools/testing/selftests/size/get_size.c"], + arch: { + x86_64: { + cflags: ["-mstackrealign"], + }, + }, defaults: ["kselftest_defaults"], nocrt: true, // coverage runtime calls atexit, which is unavailable with nocrt. -- cgit v1.2.3