--- a/lib/thread/thread.c +++ b/lib/thread/thread.c @@ -25,8 +25,11 @@ #ifdef __linux__ #include #include +#include +#ifdef __GLIBC__ #include #endif +#endif #ifdef __FreeBSD__ #include @@ -2952,11 +2955,16 @@ char **stack; size_t i; + #if defined(__linux__) && !defined(__GLIBC__) + SPDK_ERRLOG("musl does not provide the backtrace_symbols function needed for stack of %s\n", title); + return; + #else stack = backtrace_symbols(sspin_stack->addrs, sspin_stack->depth); if (stack == NULL) { SPDK_ERRLOG("Out of memory while allocate stack for %s\n", title); return; } + #endif SPDK_ERRLOG(" %s:\n", title); for (i = 0; i < sspin_stack->depth; i++) { /* --- a/module/bdev/ocf/ctx.c +++ b/module/bdev/ocf/ctx.c @@ -4,7 +4,10 @@ */ #include +#include +#if defined(__linux__) && defined(__GLIBC__) #include +#endif #include "spdk/env.h" #include "spdk/log.h"