From: Willy Tarreau Date: Sun, 29 Sep 2024 07:37:16 +0000 (+0200) Subject: BUILD: tools: only include execinfo.h for the real backtrace() function X-Git-Tag: v3.1-dev9~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c4776dbc3e7d0a73bd62bae78d509c3c54045d6;p=thirdparty%2Fhaproxy.git BUILD: tools: only include execinfo.h for the real backtrace() function No need to include this possibly non-existing file when using our own backtrace() implementation, it's only needed for the libc-provided one. Because of this it's currently not possible to build musl with backtrace enabled. --- diff --git a/include/haproxy/tools.h b/include/haproxy/tools.h index 2be18e3428..8d1afb5d7c 100644 --- a/include/haproxy/tools.h +++ b/include/haproxy/tools.h @@ -23,8 +23,8 @@ #define _HAPROXY_TOOLS_H #ifdef USE_BACKTRACE +// for backtrace() on Linux #define _GNU_SOURCE -#include #endif #include @@ -47,6 +47,10 @@ #include #include +#if defined(USE_BACKTRACE) && defined(HA_HAVE_WORKING_BACKTRACE) +#include +#endif + /****** string-specific macros and functions ******/ /* if a > max, then bound to . The macro returns the new */ #define UBOUND(a, max) ({ typeof(a) b = (max); if ((a) > b) (a) = b; (a); })