diff options
author | Mingli Yu <mingli.yu@windriver.com> | 2021-01-25 19:01:06 -0800 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2021-01-28 13:27:00 +1100 |
commit | 3edad542988a78b22034e7c42a9fc5e5334bb849 (patch) | |
tree | 7a5674a8d48d6e27b9608f0ec68f715a8f92ba06 /unittest | |
parent | 75546dfbb14c9f821018732d5fa66ea0096088f6 (diff) | |
download | mariadb-git-3edad542988a78b22034e7c42a9fc5e5334bb849.tar.gz |
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: Mingli Yu <mingli.yu@windriver.com>
Diffstat (limited to 'unittest')
-rw-r--r-- | unittest/mysys/stacktrace-t.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/unittest/mysys/stacktrace-t.c b/unittest/mysys/stacktrace-t.c index 8fa0db15b36..d8408f80d76 100644 --- a/unittest/mysys/stacktrace-t.c +++ b/unittest/mysys/stacktrace-t.c @@ -29,6 +29,7 @@ void test_my_safe_print_str() memcpy(b_stack, "LEGAL", 6); memcpy(b_bss, "LEGAL", 6); +#ifdef HAVE_STACKTRACE #ifndef __SANITIZE_ADDRESS__ fprintf(stderr, "\n===== stack =====\n"); my_safe_print_str(b_stack, 65535); @@ -48,6 +49,7 @@ void test_my_safe_print_str() fprintf(stderr, "\n===== (const char*) 1 =====\n"); my_safe_print_str((const char*)1, 5); #endif /*__SANITIZE_ADDRESS__*/ +#endif /*HAVE_STACKTRACE*/ free(b_heap); |