]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
tools: hscollider FTBS in alpine linux
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>
Mon, 3 Jun 2019 22:32:38 +0000 (15:32 -0700)
committerChang, Harry <harry.chang@intel.com>
Tue, 13 Aug 2019 06:49:59 +0000 (14:49 +0800)
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)

tools/hscollider/sig.cpp

index dc8151400625a189c794580aeb7c8811cab6af19..7d580e410f0ab8c628f0674b052f1e0733c074a0 100644 (file)
 
 #ifdef HAVE_BACKTRACE
 #include <execinfo.h>
-#include <unistd.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h> // for _exit
 #endif
 
 #define BACKTRACE_BUFFER_SIZE 200