From 1c4776dbc3e7d0a73bd62bae78d509c3c54045d6 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sun, 29 Sep 2024 09:37:16 +0200 Subject: [PATCH] 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. --- include/haproxy/tools.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/haproxy/tools.h b/include/haproxy/tools.h index 2be18e342..8d1afb5d7 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); })