--- a/sources/shiboken2/libshiboken/signature.cpp +++ b/sources/shiboken2/libshiboken/signature.cpp @@ -473,12 +473,15 @@ //////////////////////////////////////////////////////////////////////////// // a stack trace for linux-like platforms #include +#if defined(__GLIBC__) #include +#endif #include #include #include void handler(int sig) { +#if defined(__GLIBC__) void *array[30]; size_t size; @@ -486,8 +489,13 @@ size = backtrace(array, 30); // print out all the frames to stderr +#endif fprintf(stderr, "Error: signal %d:\n", sig); +#if defined(__GLIBC__) backtrace_symbols_fd(array, size, STDERR_FILENO); +#else + fprintf(stderr, "sorry, no backtrace on musl libc\n"); +#endif exit(1); }