From 5677de586fbe3ffff0c0a3bb53ea6ea915a5d70f Mon Sep 17 00:00:00 2001 From: Randy Palamar Date: Wed, 29 Nov 2023 05:21:10 -0700 Subject: [PATCH] os/osinit: fix build when execinfo.h is missing HAVE_BACKTRACE gets set on systems with libunwind however execinfo.h may be missing (on *BSD or musl for example). HAVE_EXECINFO_H has been defined by the build system for a long time but previously not used. Signed-off-by: Randy Palamar Part-of: --- os/osinit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/os/osinit.c b/os/osinit.c index 71c943a38..3e18b51b0 100644 --- a/os/osinit.c +++ b/os/osinit.c @@ -54,7 +54,7 @@ SOFTWARE. #ifdef HAVE_DLFCN_H #include #endif -#ifdef HAVE_BACKTRACE +#if defined(HAVE_BACKTRACE) && defined(HAVE_EXECINFO_H) #include #endif @@ -202,7 +202,7 @@ OsInit(void) if (!server_poll) FatalError("failed to allocate poll structure"); -#ifdef HAVE_BACKTRACE +#if defined(HAVE_BACKTRACE) && defined(HAVE_EXECINFO_H) /* * initialize the backtracer, since the ctor calls dlopen(), which * calls malloc(), which isn't signal-safe.