Andrew Geissler | eef6386 | 2021-01-29 15:58:13 -0600 | [diff] [blame] | 1 | From 966cbeb309f867ff4ac8e7f4462be4780e421700 Mon Sep 17 00:00:00 2001 |
| 2 | From: Mingli Yu <mingli.yu@windriver.com> |
| 3 | Date: Mon, 25 Jan 2021 19:01:06 -0800 |
| 4 | Subject: [PATCH] stacktrace-t.c: make the test conditional |
| 5 | |
| 6 | Fixes: |
| 7 | /prj/tmp/work/cortexa57-poky-linux-musl/mariadb/10.5.8-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux-musl/../../libexec/aarch64-poky-linux-musl/gcc/aarch64-poky-linux-musl/10.2.0/ld.bfd: /usr/src/debug/mariadb/10.5.8-r0/mariadb-10.5.8/unittest/mysys/stacktrace-t.c:36: undefined reference to `my_safe_print_str' |
| 8 | |
| 9 | Upstream-Status: Submitted [https://jira.mariadb.org/browse/MDEV-24131] |
| 10 | |
| 11 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> |
| 12 | --- |
| 13 | unittest/mysys/stacktrace-t.c | 2 ++ |
| 14 | 1 file changed, 2 insertions(+) |
| 15 | |
| 16 | diff --git a/unittest/mysys/stacktrace-t.c b/unittest/mysys/stacktrace-t.c |
| 17 | index 8fa0db15b36..d8408f80d76 100644 |
| 18 | --- a/unittest/mysys/stacktrace-t.c |
| 19 | +++ b/unittest/mysys/stacktrace-t.c |
| 20 | @@ -29,6 +29,7 @@ void test_my_safe_print_str() |
| 21 | memcpy(b_stack, "LEGAL", 6); |
| 22 | memcpy(b_bss, "LEGAL", 6); |
| 23 | |
| 24 | +#ifdef HAVE_STACKTRACE |
| 25 | #ifndef __SANITIZE_ADDRESS__ |
| 26 | fprintf(stderr, "\n===== stack =====\n"); |
| 27 | my_safe_print_str(b_stack, 65535); |
| 28 | @@ -48,6 +49,7 @@ void test_my_safe_print_str() |
| 29 | fprintf(stderr, "\n===== (const char*) 1 =====\n"); |
| 30 | my_safe_print_str((const char*)1, 5); |
| 31 | #endif /*__SANITIZE_ADDRESS__*/ |
| 32 | +#endif /*HAVE_STACKTRACE*/ |
| 33 | |
| 34 | free(b_heap); |
| 35 | |
| 36 | -- |
| 37 | 2.17.1 |
| 38 | |