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 <randy@rnpnr.xyz>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1207>
This commit is contained in:
Randy Palamar 2023-11-29 05:21:10 -07:00 committed by Marge Bot
parent 143a6a21e1
commit 5677de586f

View File

@ -54,7 +54,7 @@ SOFTWARE.
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif
#ifdef HAVE_BACKTRACE
#if defined(HAVE_BACKTRACE) && defined(HAVE_EXECINFO_H)
#include <execinfo.h>
#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.