meson: Search for execinfo.h
Rather than checking __GLIBC__/__UCLIBC__ macros as a proxy for execinfo.h presence, just check directly. This allows the build to work on musl. Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
This commit is contained in:
@@ -1036,7 +1036,7 @@ elif cc.has_header_symbol('sys/mkdev.h', 'major')
|
|||||||
pre_args += '-DMAJOR_IN_MKDEV'
|
pre_args += '-DMAJOR_IN_MKDEV'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 'dlfcn.h']
|
foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 'dlfcn.h', 'execinfo.h']
|
||||||
if cc.compiles('#include <@0@>'.format(h), name : '@0@'.format(h))
|
if cc.compiles('#include <@0@>'.format(h), name : '@0@'.format(h))
|
||||||
pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
|
pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
|
||||||
endif
|
endif
|
||||||
|
@@ -219,7 +219,7 @@ debug_symbol_name_dbghelp(const void *addr, char* buf, unsigned size)
|
|||||||
#endif /* PIPE_OS_WINDOWS */
|
#endif /* PIPE_OS_WINDOWS */
|
||||||
|
|
||||||
|
|
||||||
#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
#if defined(HAVE_EXECINFO_H)
|
||||||
|
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
|
|
||||||
@@ -240,7 +240,7 @@ debug_symbol_name_glibc(const void *addr, char* buf, unsigned size)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* defined(__GLIBC__) && !defined(__UCLIBC__) */
|
#endif /* defined(HAVE_EXECINFO_H) */
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -252,11 +252,11 @@ debug_symbol_name(const void *addr, char* buf, unsigned size)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
#if defined(HAVE_EXECINFO_H)
|
||||||
if (debug_symbol_name_glibc(addr, buf, size)) {
|
if (debug_symbol_name_glibc(addr, buf, size)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* defined(HAVE_EXECINFO_H) */
|
||||||
|
|
||||||
util_snprintf(buf, size, "%p", addr);
|
util_snprintf(buf, size, "%p", addr);
|
||||||
buf[size - 1] = 0;
|
buf[size - 1] = 0;
|
||||||
|
@@ -45,7 +45,7 @@ header = """/* GLXEXT is the define used in the xserver when the GLX extension i
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \\
|
#if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \\
|
||||||
|| (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__))
|
|| (!defined(GLXEXT) && defined(DEBUG) && defined(HAVE_EXECINFO_H))
|
||||||
#define USE_BACKTRACE
|
#define USE_BACKTRACE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@
|
|||||||
*/
|
*/
|
||||||
#define DEBUG_BACKTRACE_SIZE 0
|
#define DEBUG_BACKTRACE_SIZE 0
|
||||||
|
|
||||||
#if DEBUG_BACKTRACE_SIZE == 0
|
#if DEBUG_BACKTRACE_SIZE == 0 || !defined(HAVE_EXECINFO_H)
|
||||||
/* Use the standard debug output */
|
/* Use the standard debug output */
|
||||||
#define _DBG(...) DBG(__VA_ARGS__)
|
#define _DBG(...) DBG(__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user