2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-03 16:15:27 +00:00

Define platform.h ISC_PLATFORM_USEBACKTRACE with config.h USE_BACKTRACE

This commit is contained in:
Ondřej Surý
2018-09-04 10:09:24 +02:00
parent 3949450fbd
commit 510bb376e1
8 changed files with 40 additions and 48 deletions

View File

@@ -272,7 +272,7 @@
/* Define to 1 if you have the <krb5/krb5.h> header file. */
#undef HAVE_KRB5_KRB5_H
/* if system have backtrace function */
/* define if system have backtrace function */
#undef HAVE_LIBCTRACE
/* Define if libidn2 was found */
@@ -539,6 +539,9 @@
/* Define to use large-system tuning. */
#undef TUNE_LARGE
/* define if we can use backtrace */
#undef USE_BACKTRACE
/* Enable DNS Response Policy Service API */
#undef USE_DNSRPS

View File

@@ -367,6 +367,9 @@ typedef __int64 off_t;
/* Large system tuning */
@TUNE_LARGE@
/* define if we can use backtrace */
@USE_BACKTRACE@
/* the default value of dnssec-validation option */
@VALIDATION_DEFAULT@

24
configure vendored
View File

@@ -734,7 +734,6 @@ A
O
ALWAYS_MAKE_SYMTABLE
MKSYMTBL_PROGRAM
ISC_PLATFORM_USEBACKTRACE
PURIFY
purify_path
MKDEPPROG
@@ -17511,14 +17510,16 @@ esac
#
# Check whether --enable-backtrace was given.
if test "${enable_backtrace+set}" = set; then :
enableval=$enable_backtrace; want_backtrace="$enableval"
enableval=$enable_backtrace;
else
want_backtrace="yes"
enable_backtrace="yes"
fi
case $want_backtrace in
yes)
ISC_PLATFORM_USEBACKTRACE="#define ISC_PLATFORM_USEBACKTRACE 1"
if test "$enable_backtrace" = "yes"; then :
$as_echo "#define USE_BACKTRACE 1" >>confdefs.h
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <execinfo.h>
@@ -17526,23 +17527,20 @@ int
main ()
{
return (backtrace((void **)0, 0));
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
$as_echo "#define HAVE_LIBCTRACE /**/" >>confdefs.h
$as_echo "#define HAVE_LIBCTRACE 1" >>confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
;;
*)
ISC_PLATFORM_USEBACKTRACE="#undef ISC_PLATFORM_USEBACKTRACE"
;;
esac
fi
# Check whether --enable-symtable was given.
if test "${enable_symtable+set}" = set; then :

View File

@@ -1811,22 +1811,20 @@ esac
# enable/disable dumping stack backtrace. Also check if the system supports
# glibc-compatible backtrace() function.
#
AC_ARG_ENABLE(backtrace,
AS_HELP_STRING([--enable-backtrace],
[log stack backtrace on abort [default=yes]]),
want_backtrace="$enableval", want_backtrace="yes")
case $want_backtrace in
yes)
ISC_PLATFORM_USEBACKTRACE="#define ISC_PLATFORM_USEBACKTRACE 1"
AC_TRY_LINK([#include <execinfo.h>],
[return (backtrace((void **)0, 0));],
[AC_DEFINE([HAVE_LIBCTRACE], [], [if system have backtrace function])],)
;;
*)
ISC_PLATFORM_USEBACKTRACE="#undef ISC_PLATFORM_USEBACKTRACE"
;;
esac
AC_SUBST(ISC_PLATFORM_USEBACKTRACE)
AC_ARG_ENABLE([backtrace],
[AS_HELP_STRING([--enable-backtrace],
[log stack backtrace on abort [default=yes]])],
[], [enable_backtrace="yes"])
AS_IF([test "$enable_backtrace" = "yes"],
[AC_DEFINE([USE_BACKTRACE], [1], [define if we can use backtrace])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <execinfo.h>]],
[[return (backtrace((void **)0, 0));]]
)],
[AC_DEFINE([HAVE_LIBCTRACE], [1], [define if system have backtrace function])]
)])
AC_ARG_ENABLE(symtable,
AS_HELP_STRING([--enable-symtable],

View File

@@ -24,7 +24,7 @@
#include <isc/result.h>
#include <isc/util.h>
#ifdef ISC_PLATFORM_USEBACKTRACE
#ifdef USE_BACKTRACE
/*
* Getting a back trace of a running process is tricky and highly platform
* dependent. Our current approach is as follows:
@@ -52,9 +52,9 @@
#else
#define BACKTRACE_DISABLED
#endif /* HAVE_LIBCTRACE */
#else /* !ISC_PLATFORM_USEBACKTRACE */
#else /* USE_BACKTRACE */
#define BACKTRACE_DISABLED
#endif /* ISC_PLATFORM_USEBACKTRACE */
#endif /* USE_BACKTRACE */
#ifdef BACKTRACE_LIBC
isc_result_t

View File

@@ -78,11 +78,6 @@
*/
@ISC_PLATFORM_HAVEDEVPOLL@
/*! \brief
* Define if we want to log backtrace
*/
@ISC_PLATFORM_USEBACKTRACE@
/*
*** Printing.
***/

View File

@@ -67,11 +67,6 @@
*/
#undef ISC_PLATFORM_HAVESYSUNH
/*
* Define if we want to log backtrace
*/
@ISC_PLATFORM_USEBACKTRACE@
/*
* Defines for the noreturn attribute.
*/

View File

@@ -207,6 +207,7 @@ my @substdefh = ("AES_CC",
"HAVE_DSA_GET0_PQG",
"HAVE_ECDSA_SIG_GET0",
"HAVE_RSA_SET0_KEY",
"USE_BACKTRACE",
"USE_OPENSSL",
"USE_PKCS11",
"HAVE_PKCS11_ED25519",
@@ -231,8 +232,7 @@ my @substdefp = ("ISC_PLATFORM_BUSYWAITNOP",
"ISC_PLATFORM_HAVECMPXCHG",
"ISC_PLATFORM_HAVEXADD",
"ISC_PLATFORM_HAVEXADDQ",
"ISC_PLATFORM_NEEDSTRCASESTR",
"ISC_PLATFORM_USEBACKTRACE");
"ISC_PLATFORM_NEEDSTRCASESTR");
# for conf.sh
@@ -1160,7 +1160,7 @@ if ($msc_ver < 1400) {
# backtrace for >= VS 2012
if ($msc_ver >= 1700) {
$configdefp{"ISC_PLATFORM_USEBACKTRACE"} = 1;
$configdefh{"USE_BACKTRACE"} = 1;
}
# no version of MSVS supports strcasestr() yet