@@ 28,8 28,11 @@
#include <wayland-client.h>
#ifdef __linux__
+#include <features.h>
+#ifdef __GLIBC__
#include<execinfo.h>
#endif
+#endif
#include "xdg-output-unstable-v1.h"
#include "wlr-output-power-management-unstable-v1.h"
@@ 432,6 435,7 @@ static void handle_error (int signum)
fputs(msg, stderr);
#ifdef __linux__
+#ifdef __GLIBC__
fputs("Attempting to get backtrace:\n", stderr);
/* In some rare cases, getting a backtrace can also cause a segfault.
@@ 443,6 447,7 @@ static void handle_error (int signum)
backtrace_symbols_fd(buffer, calls, fileno(stderr));
fputs("\n", stderr);
#endif
+#endif
/* Let the default handlers deal with the rest. */
signal(signum, SIG_DFL);