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>
(cherry picked from commit 5677de586f)
This commit is contained in:
Randy Palamar 2023-11-29 05:21:10 -07:00 committed by Alan Coopersmith
parent 1845111f59
commit 574e0a005f

View file

@ -59,7 +59,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
@ -206,7 +206,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.