Commit 3edad542 authored by Mingli Yu's avatar Mingli Yu Committed by Daniel Black

MDEV-24131: unittest stacktrace-t fails to compile (OpenBSD)

This was because OpenBSD (and others) can be missing HAVE_BACKTRACE / HAVE_BACKTRACE_FD
which is the condition for my_safe_print_str to be defined.

Fixes:
/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'
Signed-off-by: default avatarMingli Yu <mingli.yu@windriver.com>
parent 75546dfb
...@@ -29,6 +29,7 @@ void test_my_safe_print_str() ...@@ -29,6 +29,7 @@ void test_my_safe_print_str()
memcpy(b_stack, "LEGAL", 6); memcpy(b_stack, "LEGAL", 6);
memcpy(b_bss, "LEGAL", 6); memcpy(b_bss, "LEGAL", 6);
#ifdef HAVE_STACKTRACE
#ifndef __SANITIZE_ADDRESS__ #ifndef __SANITIZE_ADDRESS__
fprintf(stderr, "\n===== stack =====\n"); fprintf(stderr, "\n===== stack =====\n");
my_safe_print_str(b_stack, 65535); my_safe_print_str(b_stack, 65535);
...@@ -48,6 +49,7 @@ void test_my_safe_print_str() ...@@ -48,6 +49,7 @@ void test_my_safe_print_str()
fprintf(stderr, "\n===== (const char*) 1 =====\n"); fprintf(stderr, "\n===== (const char*) 1 =====\n");
my_safe_print_str((const char*)1, 5); my_safe_print_str((const char*)1, 5);
#endif /*__SANITIZE_ADDRESS__*/ #endif /*__SANITIZE_ADDRESS__*/
#endif /*HAVE_STACKTRACE*/
free(b_heap); free(b_heap);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment