From: Carlo Marcelo Arenas Belón Date: Mon, 3 Jun 2019 22:32:38 +0000 (-0700) Subject: tools: hscollider FTBS in alpine linux X-Git-Tag: v5.2.0^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ea4e06275f0178461ac8417c5f12233f3064023;p=thirdparty%2Fvectorscan.git tools: hscollider FTBS in alpine linux alpine uses musl instead of glibc and therefore doesn't have backtrace() as part of its libc. POSIX mandates that _exit() be defined through unistd.h which used to be included together with execinfo.h when backtrace() was detected and therefore it happened to build fine for linux or freebsd (when using libexecinfo from the system or ports). since there was a macro already defined to test for unistd.h use that instead and decouple this dependency, so that the code could be built even when no backtrace() is provided (as expected also in OpenBSD) --- diff --git a/tools/hscollider/sig.cpp b/tools/hscollider/sig.cpp index dc815140..7d580e41 100644 --- a/tools/hscollider/sig.cpp +++ b/tools/hscollider/sig.cpp @@ -42,7 +42,10 @@ #ifdef HAVE_BACKTRACE #include -#include +#endif + +#ifdef HAVE_UNISTD_H +#include // for _exit #endif #define BACKTRACE_BUFFER_SIZE 200