Skip to content

Commit 88d1724

Browse files
committed
[sanitizer] Fix suffix-log-path_test.c on arm-linux-gnu
The recent suffix-log-path_test.c checks for a full stacktrace and since on some arm-linux-gnu configuration the slow unwinder is used on default (when the compiler emits thumb code as default), it requires -funwind-tables on tests. It also seems to fix the issues disable by d025df3. Reviewed By: ostannard Differential Revision: https://reviews.llvm.org/D96337
1 parent d5387ec commit 88d1724

File tree

7 files changed

+9
-18
lines changed

7 files changed

+9
-18
lines changed

compiler-rt/test/lsan/TestCases/Linux/cleanup_in_tsd_destructor.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
// RUN: %env_lsan_opts=$LSAN_BASE:use_tls=1 %run %t
99
// RUN: %env_lsan_opts=$LSAN_BASE:use_tls=0 not %run %t 2>&1 | FileCheck %s
1010

11-
// Investigate why it does not fail with use_stack=0
12-
// UNSUPPORTED: arm-linux || armhf-linux
13-
1411
#include <assert.h>
1512
#include <pthread.h>
1613
#include <stdio.h>

compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// RUN: %env_lsan_opts=$LSAN_BASE:"use_tls=1" %run %t 2>&1
66
// RUN: %env_lsan_opts="" %run %t 2>&1
77

8-
// Investigate why it does not fail with use_tls=0
9-
// UNSUPPORTED: arm-linux || armhf-linux
10-
118
#include <assert.h>
129
#include <pthread.h>
1310
#include <stdio.h>

compiler-rt/test/lsan/TestCases/disabler.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// RUN: %clang_lsan %s -o %t
44
// RUN: %env_lsan_opts=$LSAN_BASE not %run %t 2>&1 | FileCheck %s
55

6-
// Investigate why it does not fail with use_stack=0
7-
// UNSUPPORTED: arm-linux || armhf-linux
8-
96
#include <stdio.h>
107
#include <stdlib.h>
118

compiler-rt/test/lsan/TestCases/do_leak_check_override.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
// RUN: %env_lsan_opts=$LSAN_BASE not %run %t 2>&1 | FileCheck --check-prefix=CHECK-strict %s
77
// RUN: %env_lsan_opts=$LSAN_BASE not %run %t foo 2>&1 | FileCheck --check-prefix=CHECK-normal %s
88

9-
// Investigate why LeakyGlobal leak does show
10-
// UNSUPPORTED: arm-linux || armhf-linux
11-
129
#include <stdio.h>
1310
#include <stdlib.h>
1411
#include <sanitizer/lsan_interface.h>

compiler-rt/test/lsan/TestCases/ignore_object.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// RUN: %clang_lsan %s -o %t
44
// RUN: %env_lsan_opts=$LSAN_BASE not %run %t 2>&1 | FileCheck %s
55

6-
// Investigate why it does not fail with use_stack=0
7-
// UNSUPPORTED: arm-linux || armhf-linux
8-
96
#include <stdio.h>
107
#include <stdlib.h>
118

compiler-rt/test/lsan/TestCases/use_after_return.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
// RUN: ASAN_OPTIONS=$ASAN_OPTIONS:detect_stack_use_after_return=1 %env_lsan_opts=$LSAN_BASE:"use_stacks=1" %run %t 2>&1
77
// RUN: ASAN_OPTIONS=$ASAN_OPTIONS:detect_stack_use_after_return=1 %env_lsan_opts="" %run %t 2>&1
88

9-
// Investigate why it does not fail with use_stack=0
10-
// UNSUPPORTED: arm-linux || armhf-linux
11-
129
#include <stdio.h>
1310
#include <stdlib.h>
1411
#include "sanitizer_common/print_address.h"

compiler-rt/test/sanitizer_common/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ foreach(tool ${SUPPORTED_TOOLS})
7676
set(SANITIZER_COMMON_TEST_TARGET_ARCH ${arch})
7777
get_test_cc_for_arch(${arch} SANITIZER_COMMON_TEST_TARGET_CC SANITIZER_COMMON_TEST_TARGET_CFLAGS)
7878
set(CONFIG_NAME ${tool}-${arch}-${OS_NAME})
79+
80+
# ARM on Linux might use the slow unwinder as default and the unwind table is
81+
# required to get a complete stacktrace.
82+
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT ANDROID)
83+
list(APPEND SANITIZER_COMMON_TEST_TARGET_CFLAGS -funwind-tables)
84+
string(REPLACE ";" " " SANITIZER_COMMON_TEST_TARGET_CFLAGS
85+
"${SANITIZER_COMMON_TEST_TARGET_CFLAGS}")
86+
endif()
87+
7988
configure_lit_site_cfg(
8089
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
8190
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)

0 commit comments

Comments
 (0)