1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-23 03:05:48 +03:00
aports/community/cloudi/15-backtrace-fix.patch
2021-05-29 10:37:33 +00:00

57 lines
2.2 KiB
Diff

diff --git a/src/m4/ax_backtrace.m4 b/src/m4/ax_backtrace.m4
index 486889aa..08711da1 100644
--- a/src/m4/ax_backtrace.m4
+++ b/src/m4/ax_backtrace.m4
@@ -12,7 +12,7 @@
#
# MIT License
#
-# Copyright (c) 2013-2020 Michael Truog <mjtruog at protonmail dot com>
+# Copyright (c) 2013-2021 Michael Truog <mjtruog at protonmail dot com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
@@ -80,6 +80,18 @@ backtrace(0, 0);
]])],
[has_execinfo="yes"])
AC_MSG_RESULT($has_execinfo)
+ if test "x$has_execinfo" = "xno"; then
+ dnl libexecinfo may be required at link-time
+ AX_CHECK_PRIVATE_LIB(execinfo, backtrace,
+ [AC_LANG_PROGRAM([[
+#include <execinfo.h>
+ ]], [[
+backtrace(0, 0);
+ ]])],
+ [$has_execinfo="yes"])
+ else
+ EXECINFO_LIB=""
+ fi
dnl backtrace data is required to print backtrace information
if test "x$has_unwind" = "xno" -a "x$has_execinfo" = "xno"; then
@@ -150,13 +162,13 @@ dladdr(0, 0);
fi
if test "x$want_dw" = "xyes"; then
BACKTRACE_LDFLAGS=$DW_LDFLAGS
- BACKTRACE_LIB=$DW_LIB
+ BACKTRACE_LIB="$DW_LIB $EXECINFO_LIB"
AC_DEFINE([BACKWARD_HAS_DW], [1],
[Define if libdw is usable.])
AC_MSG_RESULT([backward-cpp dw $unwind_status])
elif test "x$want_bfd" = "xyes"; then
BACKTRACE_LDFLAGS=$BFD_LDFLAGS
- BACKTRACE_LIB=$BFD_LIB
+ BACKTRACE_LIB="$BFD_LIB $EXECINFO_LIB"
AC_DEFINE([BACKWARD_HAS_BFD], [1],
[Define if libbfd is usable.])
AC_MSG_RESULT([backward-cpp bfd $unwind_status])
@@ -172,7 +184,7 @@ dladdr(0, 0);
elif test "x$backtrace" = "xbooster"; then
BACKTRACE_CPPFLAGS="-I\$(top_srcdir)/external/booster"
BACKTRACE_LDFLAGS=$DL_LDFLAGS
- BACKTRACE_LIB=$DL_LIB
+ BACKTRACE_LIB="$DL_LIB $EXECINFO_LIB"
if test "x$has_unwind" = "xyes"; then
AC_DEFINE([BOOSTER_HAVE_UNWIND_BACKTRACE], [1],
[Define if libgcc has _Unwind_GetIP().])