mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Merge branch '4-make-libtool-mandatory' into 'master'
Remove no-libtool and internal symtable configure options See merge request isc-projects/bind9!3207
This commit is contained in:
commit
7db8b25b63
33 changed files with 187 additions and 1035 deletions
|
|
@ -1143,30 +1143,6 @@ system:clang:openbsd6.6:amd64:
|
|||
- schedules
|
||||
- web
|
||||
|
||||
# Jobs with libtool disabled
|
||||
|
||||
nolibtool:sid:amd64:
|
||||
variables:
|
||||
CC: gcc
|
||||
CFLAGS: "${CFLAGS_COMMON}"
|
||||
EXTRA_CONFIGURE: "--with-libidn2 --without-libtool --with-dlopen"
|
||||
<<: *debian_sid_amd64_image
|
||||
<<: *build_job
|
||||
|
||||
system:nolibtool:sid:amd64:
|
||||
<<: *debian_sid_amd64_image
|
||||
<<: *system_test_job
|
||||
dependencies:
|
||||
- nolibtool:sid:amd64
|
||||
needs: ["nolibtool:sid:amd64"]
|
||||
|
||||
unit:nolibtool:sid:amd64:
|
||||
<<: *debian_sid_amd64_image
|
||||
<<: *unit_test_job
|
||||
dependencies:
|
||||
- nolibtool:sid:amd64
|
||||
needs: ["nolibtool:sid:amd64"]
|
||||
|
||||
# Jobs for Visual Studio 2017 builds on Windows (amd64)
|
||||
|
||||
msvc:windows:amd64:
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ CWARNINGS =
|
|||
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
|
||||
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
|
||||
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
BIND9LIBS = ../../lib/bind9/libbind9.@A@
|
||||
NSLIBS = ../../lib/ns/libns.@A@
|
||||
|
||||
|
|
@ -36,7 +35,6 @@ BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@
|
|||
NSDEPENDLIBS = ../../lib/ns/libns.@A@
|
||||
|
||||
LIBS = ${ISCLIBS} @LIBS@
|
||||
NOSYMLIBS = ${ISCNOSYMLIBS} @LIBS@
|
||||
|
||||
SUBDIRS =
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ CWARNINGS =
|
|||
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
|
||||
ISCCCLIBS = ../../lib/isccc/libisccc.@A@
|
||||
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
|
||||
BIND9LIBS = ../../lib/bind9/libbind9.@A@
|
||||
|
||||
|
|
@ -43,8 +42,6 @@ RNDCDEPLIBS = ${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${BIND9DEPLIBS} ${DNSDEPLIBS} ${I
|
|||
|
||||
LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@
|
||||
|
||||
NOSYMLIBS = ${DNSLIBS} ${ISCNOSYMLIBS} @LIBS@
|
||||
|
||||
CONFDEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS}
|
||||
|
||||
SRCS= rndc-confgen.c ddns-confgen.c
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ CWARNINGS =
|
|||
|
||||
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
|
||||
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
|
||||
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
IRSLIBS = ../../lib/irs/libirs.@A@
|
||||
|
||||
|
|
@ -37,7 +36,6 @@ IRSDEPLIBS = ../../lib/irs/libirs.@A@
|
|||
DEPLIBS = ${DNSDEPLIBS} ${IRSDEPLIBS} ${ISCCFGDEPLIBS} ${ISCDEPLIBS}
|
||||
|
||||
LIBS = ${DNSLIBS} ${IRSLIBS} ${ISCCFGLIBS} ${ISCLIBS} @LIBS@
|
||||
NOSYMLIBS = ${DNSLIBS} ${IRSLIBS} ${ISCCFGLIBS} ${ISCNOSYMLIBS} @LIBS@
|
||||
|
||||
SUBDIRS =
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
|
|||
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
|
||||
BIND9LIBS = ../../lib/bind9/libbind9.@A@
|
||||
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
IRSLIBS = ../../lib/irs/libirs.@A@
|
||||
|
||||
ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
|
||||
|
|
@ -44,9 +43,6 @@ DEPLIBS = ${DNSDEPLIBS} ${IRSDEPLIBS} ${BIND9DEPLIBS} \
|
|||
LIBS = ${DNSLIBS} ${IRSLIBS} ${BIND9LIBS} ${ISCCFGLIBS} \
|
||||
${ISCLIBS} @LIBIDN2_LIBS@ @LIBS@
|
||||
|
||||
NOSYMLIBS = ${DNSLIBS} ${IRSLIBS} ${BIND9LIBS} ${ISCCFGLIBS} \
|
||||
${ISCNOSYMLIBS} @LIBIDN2_LIBS@ @LIBS@
|
||||
|
||||
SUBDIRS =
|
||||
|
||||
TARGETS = dig@EXEEXT@ host@EXEEXT@ nslookup@EXEEXT@
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ CWARNINGS =
|
|||
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
|
||||
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
|
||||
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
|
||||
DNSDEPLIBS = ../../lib/dns/libdns.@A@
|
||||
ISCDEPLIBS = ../../lib/isc/libisc.@A@
|
||||
|
|
@ -34,8 +33,6 @@ DEPLIBS = ${DNSDEPLIBS} ${ISCCFGDEPLIBS} ${ISCDEPLIBS}
|
|||
|
||||
LIBS = ${DNSLIBS} ${ISCCFGLIBS} ${ISCLIBS} @LIBS@
|
||||
|
||||
NOSYMLIBS = ${DNSLIBS} ${ISCCFGLIBS} ${ISCNOSYMLIBS} @LIBS@
|
||||
|
||||
# Alphabetically
|
||||
TARGETS = dnssec-cds@EXEEXT@ dnssec-dsfromkey@EXEEXT@ \
|
||||
dnssec-importkey@EXEEXT@ dnssec-keyfromlabel@EXEEXT@ \
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
|
|||
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
|
||||
ISCCCLIBS = ../../lib/isccc/libisccc.@A@
|
||||
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
BIND9LIBS = ../../lib/bind9/libbind9.@A@
|
||||
NSLIBS = ../../lib/ns/libns.@A@
|
||||
|
||||
|
|
@ -80,11 +79,6 @@ LIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \
|
|||
${DLZDRIVER_LIBS} ${DBDRIVER_LIBS} @LIBCAP_LIBS@ \
|
||||
@LIBS@
|
||||
|
||||
NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \
|
||||
${ISCCFGLIBS} ${ISCCCLIBS} ${ISCNOSYMLIBS} \
|
||||
${DLZDRIVER_LIBS} ${DBDRIVER_LIBS} @LIBCAP_LIBS@ \
|
||||
@LIBS@
|
||||
|
||||
SUBDIRS = unix
|
||||
|
||||
TARGETS = named@EXEEXT@
|
||||
|
|
@ -101,8 +95,6 @@ OBJS = builtin.@O@ config.@O@ control.@O@ \
|
|||
|
||||
UOBJS = unix/os.@O@ unix/dlz_dlopen_driver.@O@
|
||||
|
||||
SYMOBJS = symtbl.@O@
|
||||
|
||||
GEOIP2LINKSRCS = geoip.c
|
||||
|
||||
SRCS = builtin.c config.c control.c \
|
||||
|
|
@ -148,7 +140,6 @@ server.@O@: server.c
|
|||
-DVERSION=\"${VERSION}\" -c ${srcdir}/server.c
|
||||
|
||||
named@EXEEXT@: ${OBJS} ${DEPLIBS}
|
||||
export MAKE_SYMTABLE="yes"; \
|
||||
export BASEOBJS="${OBJS} ${UOBJS}"; \
|
||||
${FINALBUILDCMD}
|
||||
|
||||
|
|
@ -184,6 +175,3 @@ uninstall::
|
|||
${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/named@EXEEXT@
|
||||
|
||||
@DLZ_DRIVER_RULES@
|
||||
|
||||
named-symtbl.@O@: named-symtbl.c
|
||||
${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -c named-symtbl.c
|
||||
|
|
|
|||
|
|
@ -197,10 +197,9 @@ static void
|
|||
assertion_failed(const char *file, int line, isc_assertiontype_t type,
|
||||
const char *cond) {
|
||||
void *tracebuf[BACKTRACE_MAXFRAME];
|
||||
int i, nframes;
|
||||
int nframes;
|
||||
isc_result_t result;
|
||||
const char *logsuffix = "";
|
||||
const char *fname;
|
||||
|
||||
/*
|
||||
* Handle assertion failures.
|
||||
|
|
@ -223,29 +222,22 @@ assertion_failed(const char *file, int line, isc_assertiontype_t type,
|
|||
"%s:%d: %s(%s) failed%s", file, line,
|
||||
isc_assertion_typetotext(type), cond, logsuffix);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
for (i = 0; i < nframes; i++) {
|
||||
unsigned long offset;
|
||||
|
||||
fname = NULL;
|
||||
result = isc_backtrace_getsymbol(
|
||||
tracebuf[i], &fname, &offset);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
isc_log_write(named_g_lctx,
|
||||
NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL,
|
||||
"#%d %p in %s()+0x%lx", i,
|
||||
tracebuf[i], fname,
|
||||
offset);
|
||||
} else {
|
||||
isc_log_write(named_g_lctx,
|
||||
NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL,
|
||||
"#%d %p in ??", i,
|
||||
tracebuf[i]);
|
||||
}
|
||||
#if HAVE_BACKTRACE_SYMBOLS
|
||||
char **strs = backtrace_symbols(tracebuf, nframes);
|
||||
for (int i = 0; i < nframes; i++) {
|
||||
isc_log_write(named_g_lctx,
|
||||
NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_MAIN,
|
||||
ISC_LOG_CRITICAL, "%s", strs[i]);
|
||||
}
|
||||
#else /* HAVE_BACKTRACE_SYMBOLS */
|
||||
for (int i = 0; i < nframes; i++) {
|
||||
isc_log_write(
|
||||
named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL,
|
||||
"#%d %p in ??", i, tracebuf[i]);
|
||||
}
|
||||
#endif /* HAVE_BACKTRACE_SYMBOLS */
|
||||
}
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL,
|
||||
|
|
@ -974,36 +966,6 @@ destroy_managers(void) {
|
|||
isc_nm_destroy(&named_g_nm);
|
||||
}
|
||||
|
||||
static void
|
||||
dump_symboltable(void) {
|
||||
int i;
|
||||
isc_result_t result;
|
||||
const char *fname;
|
||||
const void *addr;
|
||||
|
||||
if (isc__backtrace_nsymbols == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isc_log_wouldlog(named_g_lctx, ISC_LOG_DEBUG(99))) {
|
||||
return;
|
||||
}
|
||||
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_MAIN, ISC_LOG_DEBUG(99), "Symbol table:");
|
||||
|
||||
for (i = 0, result = ISC_R_SUCCESS; result == ISC_R_SUCCESS; i++) {
|
||||
addr = NULL;
|
||||
fname = NULL;
|
||||
result = isc_backtrace_getsymbolfromindex(i, &addr, &fname);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_MAIN, ISC_LOG_DEBUG(99),
|
||||
"[%d] %p %s", i, addr, fname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
setup(void) {
|
||||
isc_result_t result;
|
||||
|
|
@ -1191,8 +1153,6 @@ setup(void) {
|
|||
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
|
||||
"----------------------------------------------------");
|
||||
|
||||
dump_symboltable();
|
||||
|
||||
/*
|
||||
* Get the initial resource limits.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ CWARNINGS =
|
|||
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
|
||||
BIND9LIBS = ../../lib/bind9/libbind9.@A@
|
||||
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
|
||||
IRSLIBS = ../../lib/irs/libirs.@A@
|
||||
|
||||
|
|
@ -45,9 +44,6 @@ DEPLIBS = ${DNSDEPLIBS} ${IRSDEPLIBS} ${BIND9DEPLIBS} \
|
|||
LIBS = ${DNSLIBS} ${IRSLIBS} ${BIND9LIBS} \
|
||||
${ISCCFGLIBS} ${ISCLIBS} @LIBS@
|
||||
|
||||
NOSYMLIBS = ${DNSLIBS} ${IRSLIBS} ${BIND9LIBS} \
|
||||
${ISCCFGLIBS} ${ISCNOSYMLIBS} @LIBS@
|
||||
|
||||
SUBDIRS =
|
||||
|
||||
TARGETS = nsupdate@EXEEXT@
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ CWARNINGS =
|
|||
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
|
||||
ISCCCLIBS = ../../lib/isccc/libisccc.@A@
|
||||
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
|
||||
BIND9LIBS = ../../lib/bind9/libbind9.@A@
|
||||
|
||||
|
|
@ -35,7 +34,6 @@ DNSDEPLIBS = ../../lib/dns/libdns.@A@
|
|||
BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@
|
||||
|
||||
LIBS = ${ISCLIBS} @LIBS@
|
||||
NOSYMLIBS = ${ISCNOSYMLIBS} @LIBS@
|
||||
|
||||
RNDCDEPLIBS = ${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${BIND9DEPLIBS} ${DNSDEPLIBS} ${ISCDEPLIBS}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,16 +18,13 @@ CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} ${ISCCFG_INCLUDES} \
|
|||
|
||||
CDEFINES =
|
||||
CWARNINGS =
|
||||
BACKTRACECFLAGS = @BACKTRACECFLAGS@
|
||||
|
||||
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
|
||||
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
|
||||
|
||||
DNSDEPLIBS = ../../lib/dns/libdns.@A@
|
||||
ISCDEPLIBS = ../../lib/isc/libisc.@A@
|
||||
ISCDEPNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@
|
||||
ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
|
||||
|
||||
LIBS = @LIBS@
|
||||
|
|
|
|||
2
bin/tests/optional/.gitignore
vendored
2
bin/tests/optional/.gitignore
vendored
|
|
@ -1,5 +1,3 @@
|
|||
/backtrace_test.dSYM/
|
||||
/backtrace_test0.dSYM/
|
||||
/backtrace_test_nosymtbl
|
||||
/backtrace_test_nosymtbl.dSYM/
|
||||
/nsecify
|
||||
|
|
|
|||
|
|
@ -19,17 +19,14 @@ CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} ${ISCCFG_INCLUDES} \
|
|||
CDEFINES = @USE_GSSAPI@
|
||||
|
||||
CWARNINGS =
|
||||
BACKTRACECFLAGS = @BACKTRACECFLAGS@
|
||||
PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
|
||||
|
||||
DNSLIBS = ../../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
|
||||
ISCLIBS = ../../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
ISCNOSYMLIBS = ../../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
ISCCFGLIBS = ../../../lib/isccfg/libisccfg.@A@
|
||||
|
||||
DNSDEPLIBS = ../../../lib/dns/libdns.@A@
|
||||
ISCDEPLIBS = ../../../lib/isc/libisc.@A@
|
||||
ISCDEPNOSYMLIBS = ../../../lib/isc/libisc-nosymtbl.@A@
|
||||
ISCCFGDEPLIBS = ../../../lib/isccfg/libisccfg.@A@
|
||||
|
||||
LIBS = @LIBS@
|
||||
|
|
@ -44,7 +41,6 @@ TARGETS = @XTARGETS@
|
|||
XTARGETS = adb_test@EXEEXT@ \
|
||||
byaddr_test@EXEEXT@ \
|
||||
backtrace_test@EXEEXT@ \
|
||||
backtrace_test_nosymtbl@EXEEXT@ \
|
||||
byname_test@EXEEXT@ \
|
||||
db_test@EXEEXT@ \
|
||||
gsstest@EXEEXT@ \
|
||||
|
|
@ -100,7 +96,7 @@ XSRCS = adb_test.c \
|
|||
@BIND9_MAKE_RULES@
|
||||
|
||||
# disable optimization for backtrace test to get the expected result
|
||||
BTTEST_CFLAGS = ${BACKTRACECFLAGS} ${EXT_CFLAGS} ${ALL_CPPFLAGS} -g \
|
||||
BTTEST_CFLAGS = ${EXT_CFLAGS} ${ALL_CPPFLAGS} -g \
|
||||
${ALWAYS_WARNINGS} ${STD_CWARNINGS} ${CWARNINGS} ${PTHREAD_CFLAGS}
|
||||
|
||||
all_tests: ${XTARGETS}
|
||||
|
|
@ -109,32 +105,10 @@ adb_test@EXEEXT@: adb_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
|
|||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ adb_test.@O@ \
|
||||
${DNSLIBS} ${ISCLIBS} ${LIBS}
|
||||
|
||||
backtrace_test_nosymtbl@EXEEXT@: ${srcdir}/backtrace_test.c ${ISCDEPLIBS}
|
||||
backtrace_test@EXEEXT@: ${srcdir}/backtrace_test.c ${ISCDEPLIBS}
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${BTTEST_CFLAGS} ${LDFLAGS} -o $@ \
|
||||
${srcdir}/backtrace_test.c ${ISCLIBS} ${LIBS}
|
||||
|
||||
backtrace_test@EXEEXT@: ${srcdir}/backtrace_test.c backtrace_test_nosymtbl@EXEEXT@
|
||||
#first step: create a first symbol table
|
||||
rm -f symtbl.c
|
||||
if test X${MKSYMTBL_PROGRAM} != X; then \
|
||||
${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl \
|
||||
backtrace_test_nosymtbl@EXEEXT@; else \
|
||||
cp ${top_srcdir}/lib/isc/backtrace-emptytbl.c symtbl.c; fi
|
||||
#second step: build a binary with the first symbol table
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${BTTEST_CFLAGS} ${LDFLAGS} \
|
||||
-o $@0 ${srcdir}/backtrace_test.c symtbl.c \
|
||||
${ISCNOSYMLIBS} ${LIBS}
|
||||
rm -f symtbl.c
|
||||
#third step: create a second symbol table
|
||||
if test X${MKSYMTBL_PROGRAM} != X; then \
|
||||
${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl $@0; else \
|
||||
cp ${top_srcdir}/lib/isc/backtrace-emptytbl.c symtbl.c; fi
|
||||
#fourth step: build the final binary
|
||||
rm -f $@0
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${BTTEST_CFLAGS} ${LDFLAGS} \
|
||||
-o $@ ${srcdir}/backtrace_test.c symtbl.c ${ISCNOSYMLIBS} ${LIBS}
|
||||
rm -f symtbl.c
|
||||
|
||||
nsecify@EXEEXT@: nsecify.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS}
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ nsecify.@O@ \
|
||||
${DNSLIBS} ${ISCLIBS} ${LIBS}
|
||||
|
|
|
|||
|
|
@ -16,16 +16,11 @@
|
|||
#include <isc/print.h>
|
||||
#include <isc/result.h>
|
||||
|
||||
const char *expected_symbols[] = { "func3", "func2", "func1", "main" };
|
||||
|
||||
static int
|
||||
func3() {
|
||||
void *tracebuf[16];
|
||||
int i, nframes;
|
||||
int error = 0;
|
||||
const char *fname;
|
||||
int nframes;
|
||||
isc_result_t result;
|
||||
unsigned long offset;
|
||||
|
||||
result = isc_backtrace_gettrace(tracebuf, 16, &nframes);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
|
|
@ -35,39 +30,12 @@ func3() {
|
|||
}
|
||||
|
||||
if (nframes < 4) {
|
||||
error++;
|
||||
}
|
||||
|
||||
for (i = 0; i < 4 && i < nframes; i++) {
|
||||
fname = NULL;
|
||||
result = isc_backtrace_getsymbol(tracebuf[i], &fname, &offset);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
error++;
|
||||
continue;
|
||||
}
|
||||
if (strcmp(fname, expected_symbols[i]) != 0) {
|
||||
error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (error) {
|
||||
printf("Unexpected result:\n");
|
||||
printf(" # of frames: %d (expected: at least 4)\n", nframes);
|
||||
printf(" symbols:\n");
|
||||
for (i = 0; i < nframes; i++) {
|
||||
fname = NULL;
|
||||
result = isc_backtrace_getsymbol(tracebuf[i], &fname,
|
||||
&offset);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
printf(" [%d] %s\n", i, fname);
|
||||
} else {
|
||||
printf(" [%d] %p getsymbol failed: %s\n", i,
|
||||
tracebuf[i], isc_result_totext(result));
|
||||
}
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
|
||||
return (error);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ CWARNINGS =
|
|||
DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@
|
||||
BIND9LIBS = ../../lib/bind9/libbind9.@A@
|
||||
ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS}
|
||||
ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@
|
||||
|
||||
DNSDEPLIBS = ../../lib/dns/libdns.@A@
|
||||
|
|
@ -35,7 +34,6 @@ ISCDEPLIBS = ../../lib/isc/libisc.@A@
|
|||
ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@
|
||||
|
||||
LIBS = ${ISCLIBS} @LIBS@
|
||||
NOSYMLIBS = ${ISCNOSYMLIBS} @LIBS@
|
||||
|
||||
SUBDIRS =
|
||||
|
||||
|
|
|
|||
18
config.h.in
18
config.h.in
|
|
@ -45,6 +45,12 @@
|
|||
/* define if the ARM yield instruction is available */
|
||||
#undef HAVE_ARM_YIELD
|
||||
|
||||
/* Define to 1 if you have the `backtrace' function. */
|
||||
#undef HAVE_BACKTRACE
|
||||
|
||||
/* Define to 1 if you have the `backtrace_symbols' function. */
|
||||
#undef HAVE_BACKTRACE_SYMBOLS
|
||||
|
||||
/* Define to 1 if the compiler supports __builtin_clz. */
|
||||
#undef HAVE_BUILTIN_CLZ
|
||||
|
||||
|
|
@ -150,6 +156,9 @@
|
|||
/* Define to 1 if you have the `EVP_sha512' function. */
|
||||
#undef HAVE_EVP_SHA512
|
||||
|
||||
/* Define to 1 if you have the <execinfo.h> header file. */
|
||||
#undef HAVE_EXECINFO_H
|
||||
|
||||
/* Define to 1 if you have the `explicit_bzero' function. */
|
||||
#undef HAVE_EXPLICIT_BZERO
|
||||
|
||||
|
|
@ -231,9 +240,6 @@
|
|||
/* Define to 1 if you have the <krb5/krb5.h> header file. */
|
||||
#undef HAVE_KRB5_KRB5_H
|
||||
|
||||
/* define if system have backtrace function */
|
||||
#undef HAVE_LIBCTRACE
|
||||
|
||||
/* Define if libidn2 was found */
|
||||
#undef HAVE_LIBIDN2
|
||||
|
||||
|
|
@ -549,9 +555,6 @@
|
|||
/* Define to use default system tuning. */
|
||||
#undef TUNE_LARGE
|
||||
|
||||
/* define if we can use backtrace */
|
||||
#undef USE_BACKTRACE
|
||||
|
||||
/* Enable DNS Response Policy Service API */
|
||||
#undef USE_DNSRPS
|
||||
|
||||
|
|
@ -559,9 +562,6 @@
|
|||
non-blocking. */
|
||||
#undef USE_FIONBIO_IOCTL
|
||||
|
||||
/* Define if libtool is used for compilation */
|
||||
#undef USE_LIBTOOL
|
||||
|
||||
/* define if OpenSSL is used for Public-Key Cryptography */
|
||||
#undef USE_OPENSSL
|
||||
|
||||
|
|
|
|||
255
configure
vendored
255
configure
vendored
|
|
@ -710,6 +710,7 @@ DST_EXTRA_OBJS
|
|||
USE_ISC_SPNEGO
|
||||
READLINE_LIB
|
||||
BIND9_CO_RULE
|
||||
INSTALL_LIBRARY
|
||||
LIBTOOL_MODE_UNINSTALL
|
||||
LIBTOOL_MODE_LINK
|
||||
LIBTOOL_MODE_INSTALL
|
||||
|
|
@ -718,8 +719,6 @@ LIBTOOL_MKDEP_SED
|
|||
SA
|
||||
A
|
||||
O
|
||||
ALWAYS_MAKE_SYMTABLE
|
||||
MKSYMTBL_PROGRAM
|
||||
PURIFY
|
||||
purify_path
|
||||
MKDEPPROG
|
||||
|
|
@ -747,7 +746,6 @@ PKCS11_TOOLS
|
|||
PKCS11_TEST
|
||||
OPENSSL_LIBS
|
||||
OPENSSL_CFLAGS
|
||||
INSTALL_LIBRARY
|
||||
ALWAYS_DEFINES
|
||||
LIBUV_LIBS
|
||||
LIBUV_CFLAGS
|
||||
|
|
@ -777,7 +775,6 @@ XTARGETS
|
|||
PKG_CONFIG_LIBDIR
|
||||
PKG_CONFIG_PATH
|
||||
PKG_CONFIG
|
||||
BACKTRACECFLAGS
|
||||
CCNOOPT
|
||||
CCOPT
|
||||
STD_CWARNINGS
|
||||
|
|
@ -909,7 +906,6 @@ with_geoip2
|
|||
enable_geoip
|
||||
with_maxminddb
|
||||
with_locktype
|
||||
with_libtool
|
||||
enable_pthread_rwlock
|
||||
with_openssl
|
||||
enable_fips_mode
|
||||
|
|
@ -923,8 +919,6 @@ with_json_c
|
|||
with_zlib
|
||||
with_purify
|
||||
with_gperftools_profiler
|
||||
enable_backtrace
|
||||
enable_symtable
|
||||
enable_tcp_fastopen
|
||||
with_readline
|
||||
enable_isc_spnego
|
||||
|
|
@ -1630,9 +1624,6 @@ Optional Features:
|
|||
pthread rwlock
|
||||
--enable-fips-mode enable FIPS mode in OpenSSL library [default=no]
|
||||
--enable-native-pkcs11 use native PKCS11 for public-key crypto [default=no]
|
||||
--enable-backtrace log stack backtrace on abort [default=yes]
|
||||
--enable-symtable use internal symbol table for backtrace
|
||||
[all|minimal(default)|none]
|
||||
--disable-tcp-fastopen disable TCP Fast Open support [default=yes]
|
||||
--disable-isc-spnego use SPNEGO from GSSAPI library
|
||||
--disable-chroot disable chroot
|
||||
|
|
@ -1666,7 +1657,6 @@ Optional Packages:
|
|||
--with-maxminddb=PATH Build with MaxMind GeoIP2 support (auto|yes|no|path)
|
||||
[default=auto]
|
||||
--with-locktype=ARG Specify mutex lock type (adaptive or standard)
|
||||
--with-libtool use GNU libtool
|
||||
--with-openssl=DIR root of the OpenSSL directory
|
||||
--with-pkcs11=PATH Build with PKCS11 support [no|path] (PATH is for the
|
||||
PKCS11 provider)
|
||||
|
|
@ -11943,6 +11933,9 @@ CC=$lt_save_CC
|
|||
# Only expand once:
|
||||
|
||||
|
||||
if test -z "$LIBTOOL"; then :
|
||||
as_fn_error $? "The libtool script could not be found." "$LINENO" 5
|
||||
fi
|
||||
# Find a good install program. We prefer a C program (faster),
|
||||
# so one script is as good as another. But avoid the broken or
|
||||
# incompatible versions:
|
||||
|
|
@ -12092,7 +12085,6 @@ fi
|
|||
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Use pkg-config
|
||||
#
|
||||
|
|
@ -12260,7 +12252,6 @@ if test "$enable_developer" = "yes"; then :
|
|||
test "${enable_querytrace+set}" = set || enable_querytrace=yes
|
||||
test "${with_cmocka+set}" = set || with_cmocka=yes
|
||||
test "${with_dlz_filesystem+set}" = set || with_dlz_filesystem=yes
|
||||
test "${enable_symtable+set}" = set || enable_symtable=all
|
||||
test "${enable_warn_error+set}" = set || enable_warn_error=yes
|
||||
test "${enable_warn_shadow+set}" = set || enable_warn_shadow=yes
|
||||
test "${with_zlib+set}" = set || with_zlib=yes
|
||||
|
|
@ -15995,51 +15986,6 @@ done
|
|||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libtool" >&5
|
||||
$as_echo_n "checking for libtool... " >&6; }
|
||||
|
||||
# Check whether --with-libtool was given.
|
||||
if test "${with_libtool+set}" = set; then :
|
||||
withval=$with_libtool; use_libtool="$withval"
|
||||
else
|
||||
use_libtool="no"
|
||||
fi
|
||||
|
||||
|
||||
case $use_libtool in
|
||||
yes)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
|
||||
O=lo
|
||||
A=la
|
||||
LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
|
||||
LIBTOOL_MODE_COMPILE='--mode=compile'
|
||||
LIBTOOL_MODE_INSTALL='--mode=install'
|
||||
LIBTOOL_MODE_LINK='--mode=link'
|
||||
LIBTOOL_MODE_UNINSTALL='--mode=uninstall'
|
||||
INSTALL_LIBRARY='${INSTALL_PROGRAM}'
|
||||
|
||||
$as_echo "#define USE_LIBTOOL 1" >>confdefs.h
|
||||
|
||||
;;
|
||||
*)
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
O=o
|
||||
A=a
|
||||
LIBTOOL=
|
||||
|
||||
LIBTOOL_MKDEP_SED=
|
||||
LIBTOOL_MODE_COMPILE=
|
||||
LIBTOOL_MODE_INSTALL=
|
||||
LIBTOOL_MODE_LINK=
|
||||
LIBTOOL_MODE_UNINSTALL=
|
||||
INSTALL_LIBRARY='${INSTALL_DATA}'
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
#
|
||||
# Do we want to use pthread rwlock?
|
||||
#
|
||||
|
|
@ -18731,92 +18677,103 @@ $as_echo "no" >&6; }
|
|||
esac
|
||||
|
||||
#
|
||||
# enable/disable dumping stack backtrace. Also check if the system supports
|
||||
# glibc-compatible backtrace() function.
|
||||
# Check if the system supports glibc-compatible backtrace() function.
|
||||
#
|
||||
# Check whether --enable-backtrace was given.
|
||||
if test "${enable_backtrace+set}" = set; then :
|
||||
enableval=$enable_backtrace;
|
||||
for ac_header in execinfo.h
|
||||
do :
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_execinfo_h" = xyes; then :
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_EXECINFO_H 1
|
||||
_ACEOF
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing backtrace" >&5
|
||||
$as_echo_n "checking for library containing backtrace... " >&6; }
|
||||
if ${ac_cv_search_backtrace+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
enable_backtrace="yes"
|
||||
fi
|
||||
|
||||
|
||||
if test "$enable_backtrace" = "yes"; then :
|
||||
|
||||
$as_echo "#define USE_BACKTRACE 1" >>confdefs.h
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
ac_func_search_save_LIBS=$LIBS
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <execinfo.h>
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char backtrace ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return (backtrace((void **)0, 0));
|
||||
|
||||
return backtrace ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
|
||||
$as_echo "#define HAVE_LIBCTRACE 1" >>confdefs.h
|
||||
|
||||
|
||||
for ac_lib in '' execinfo; do
|
||||
if test -z "$ac_lib"; then
|
||||
ac_res="none required"
|
||||
else
|
||||
ac_res=-l$ac_lib
|
||||
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
|
||||
fi
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
ac_cv_search_backtrace=$ac_res
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
conftest$ac_exeext
|
||||
if ${ac_cv_search_backtrace+:} false; then :
|
||||
break
|
||||
fi
|
||||
done
|
||||
if ${ac_cv_search_backtrace+:} false; then :
|
||||
|
||||
# Check whether --enable-symtable was given.
|
||||
if test "${enable_symtable+set}" = set; then :
|
||||
enableval=$enable_symtable; want_symtable="$enableval"
|
||||
else
|
||||
want_symtable="minimal"
|
||||
ac_cv_search_backtrace=no
|
||||
fi
|
||||
rm conftest.$ac_ext
|
||||
LIBS=$ac_func_search_save_LIBS
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_backtrace" >&5
|
||||
$as_echo "$ac_cv_search_backtrace" >&6; }
|
||||
ac_res=$ac_cv_search_backtrace
|
||||
if test "$ac_res" != no; then :
|
||||
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
|
||||
for ac_func in backtrace backtrace_symbols
|
||||
do :
|
||||
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
|
||||
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
case $want_symtable in
|
||||
yes|all|minimal) # "yes" is a hidden value equivalent to "minimal"
|
||||
if test "" = "$PERL"
|
||||
then
|
||||
as_fn_error $? "Internal symbol table requires perl but no perl is found.
|
||||
Install perl or explicitly disable the feature by --disable-symtable." "$LINENO" 5
|
||||
fi
|
||||
if test "yes" = "$use_libtool"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Internal symbol table does not work with libtool. Disabling symbol table." >&5
|
||||
$as_echo "$as_me: WARNING: Internal symbol table does not work with libtool. Disabling symbol table." >&2;}
|
||||
else
|
||||
# we generate the internal symbol table only for those systems
|
||||
# known to work to avoid unexpected build failure. Also, warn
|
||||
# about unsupported systems when the feature is enabled
|
||||
# manually.
|
||||
case $host_os in
|
||||
freebsd*|netbsd*|openbsd*|linux*|solaris*|darwin*)
|
||||
MKSYMTBL_PROGRAM="$PERL"
|
||||
if test "all" = "$want_symtable"; then
|
||||
ALWAYS_MAKE_SYMTABLE="yes"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if test "yes" = "$want_symtable" -o "all" = "$want_symtable"
|
||||
then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: this system is not known to generate internal symbol table safely; disabling it" >&5
|
||||
$as_echo "$as_me: WARNING: this system is not known to generate internal symbol table safely; disabling it" >&2;}
|
||||
fi
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
|
||||
# AM_CONDITIONAL([HAVE_BACKTRACE], [test "$ac_cv_func_backtrace" = "yes"])
|
||||
|
||||
#
|
||||
# File name extension for static archive files, for those few places
|
||||
# where they are treated differently from dynamic ones.
|
||||
#
|
||||
O=lo
|
||||
A=la
|
||||
SA=a
|
||||
LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
|
||||
LIBTOOL_MODE_COMPILE='--mode=compile'
|
||||
LIBTOOL_MODE_INSTALL='--mode=install'
|
||||
LIBTOOL_MODE_LINK='--mode=link'
|
||||
LIBTOOL_MODE_UNINSTALL='--mode=uninstall'
|
||||
INSTALL_LIBRARY='${INSTALL_PROGRAM}'
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -22341,47 +22298,21 @@ if test "$with_dlopen" = "yes"; then :
|
|||
LDFLAGS="${LDFLAGS} -Wl,--export-dynamic"
|
||||
SO_CFLAGS="-fPIC"
|
||||
SO_LDFLAGS=""
|
||||
if test "$use_libtool" = "yes"; then :
|
||||
|
||||
SO_LDFLAGS="-Xcompiler -shared"
|
||||
SO_LD="${CC}"
|
||||
|
||||
else
|
||||
|
||||
SO_LDFLAGS="-shared"
|
||||
SO_LD="${CC}"
|
||||
|
||||
fi
|
||||
SO_LDFLAGS="-Xcompiler -shared"
|
||||
SO_LD="${CC}"
|
||||
;; #(
|
||||
*-freebsd*|*-openbsd*|*-netbsd*) :
|
||||
|
||||
LDFLAGS="${LDFLAGS} -Wl,-E"
|
||||
SO_CFLAGS="-fpic"
|
||||
if test "$use_libtool" = "yes"; then :
|
||||
|
||||
SO_LDFLAGS="-Xcompiler -shared"
|
||||
SO_LD="${CC}"
|
||||
|
||||
else
|
||||
|
||||
SO_LDFLAGS="-shared"
|
||||
SO_LD="${CC}"
|
||||
|
||||
fi
|
||||
SO_LDFLAGS="-Xcompiler -shared"
|
||||
SO_LD="${CC}"
|
||||
;; #(
|
||||
*-darwin*) :
|
||||
|
||||
SO_CFLAGS="-fPIC"
|
||||
SO_LD="${CC}"
|
||||
if test "$use_libtool" = "yes"; then :
|
||||
|
||||
SO_LDFLAGS="-Xcompiler -dynamiclib -undefined dynamic_lookup"
|
||||
|
||||
else
|
||||
|
||||
SO_LDFLAGS="-dynamiclib -undefined dynamic_lookup"
|
||||
|
||||
fi
|
||||
SO_LDFLAGS="-Xcompiler -dynamiclib -undefined dynamic_lookup"
|
||||
;; #(
|
||||
*-solaris*) :
|
||||
|
||||
|
|
@ -22401,20 +22332,10 @@ fi
|
|||
;;
|
||||
esac
|
||||
if test "$GCC" = "yes"; then :
|
||||
|
||||
SO_CFLAGS="-fPIC"
|
||||
if test -z "$SO_LD"; then :
|
||||
if test "$use_libtool" = "yes"; then :
|
||||
|
||||
SO_LDFLAGS="-Xcompiler -shared"
|
||||
SO_LD="${CC}"
|
||||
|
||||
else
|
||||
|
||||
SO_LDFLAGS="-shared"
|
||||
SO_LD="${CC}"
|
||||
|
||||
fi
|
||||
SO_CFLAGS="-fPIC"
|
||||
if test -z "$SO_LD"; then :
|
||||
SO_LDFLAGS="-Xcompiler -shared"
|
||||
SO_LD="${CC}"
|
||||
|
||||
fi
|
||||
|
||||
|
|
@ -26040,11 +25961,6 @@ report() {
|
|||
echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
|
||||
test "yes" = "$enable_backtrace" && \
|
||||
echo " Print backtrace on crash (--enable-backtrace)"
|
||||
test "minimal" = "$want_symtable" && \
|
||||
echo " Use symbol table for backtrace, named only (--enable-symtable)"
|
||||
test "yes" = "$want_symtable" -o "all" = "$want_symtable" && \
|
||||
echo " Use symbol table for backtrace, all binaries (--enable-symtable=all)"
|
||||
test "no" = "$use_libtool" || echo " Use GNU libtool (--with-libtool)"
|
||||
test "yes" = "$want_querytrace" && \
|
||||
echo " Very verbose query trace logging (--enable-querytrace)"
|
||||
test "no" = "$with_cmocka" || echo " CMocka Unit Testing Framework (--with-cmocka)"
|
||||
|
|
@ -26101,7 +26017,6 @@ report() {
|
|||
test "yes" = "$want_querytrace" || \
|
||||
echo " Very verbose query trace logging (--enable-querytrace)"
|
||||
|
||||
test "yes" = "$use_libtool" || echo " Use GNU libtool (--with-libtool)"
|
||||
test "no" = "$with_cmocka" && echo " CMocka Unit Testing Framework (--with-cmocka)"
|
||||
|
||||
test "X$PYTHON" = "X" && echo " Python tools (--with-python)"
|
||||
|
|
|
|||
154
configure.ac
154
configure.ac
|
|
@ -45,6 +45,8 @@ AC_DEFINE([__APPLE_USE_RFC_3542], [1], [Select RFC3542 IPv6 API on macOS])
|
|||
AC_PROG_MAKE_SET
|
||||
|
||||
AC_PROG_LIBTOOL
|
||||
AS_IF([test -z "$LIBTOOL"],
|
||||
[AC_MSG_ERROR([The libtool script could not be found.])])
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AX_POSIX_SHELL
|
||||
|
|
@ -54,7 +56,6 @@ AC_SUBST(STD_CDEFINES)
|
|||
AC_SUBST(STD_CWARNINGS)
|
||||
AC_SUBST(CCOPT)
|
||||
AC_SUBST(CCNOOPT)
|
||||
AC_SUBST(BACKTRACECFLAGS)
|
||||
|
||||
#
|
||||
# Use pkg-config
|
||||
|
|
@ -94,7 +95,6 @@ AS_IF([test "$enable_developer" = "yes"],
|
|||
test "${enable_querytrace+set}" = set || enable_querytrace=yes
|
||||
test "${with_cmocka+set}" = set || with_cmocka=yes
|
||||
test "${with_dlz_filesystem+set}" = set || with_dlz_filesystem=yes
|
||||
test "${enable_symtable+set}" = set || enable_symtable=all
|
||||
test "${enable_warn_error+set}" = set || enable_warn_error=yes
|
||||
test "${enable_warn_shadow+set}" = set || enable_warn_shadow=yes
|
||||
test "${with_zlib+set}" = set || with_zlib=yes
|
||||
|
|
@ -681,40 +681,6 @@ AC_CHECK_FUNCS([sysconf])
|
|||
|
||||
AC_SUBST(ALWAYS_DEFINES)
|
||||
|
||||
AC_MSG_CHECKING(for libtool)
|
||||
AC_ARG_WITH(libtool, AS_HELP_STRING([--with-libtool], [use GNU libtool]),
|
||||
use_libtool="$withval", use_libtool="no")
|
||||
|
||||
case $use_libtool in
|
||||
yes)
|
||||
AC_MSG_RESULT(yes)
|
||||
AM_PROG_LIBTOOL
|
||||
O=lo
|
||||
A=la
|
||||
LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
|
||||
LIBTOOL_MODE_COMPILE='--mode=compile'
|
||||
LIBTOOL_MODE_INSTALL='--mode=install'
|
||||
LIBTOOL_MODE_LINK='--mode=link'
|
||||
LIBTOOL_MODE_UNINSTALL='--mode=uninstall'
|
||||
INSTALL_LIBRARY='${INSTALL_PROGRAM}'
|
||||
AC_DEFINE([USE_LIBTOOL],[1],[Define if libtool is used for compilation])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(no)
|
||||
O=o
|
||||
A=a
|
||||
LIBTOOL=
|
||||
AC_SUBST(LIBTOOL)
|
||||
LIBTOOL_MKDEP_SED=
|
||||
LIBTOOL_MODE_COMPILE=
|
||||
LIBTOOL_MODE_INSTALL=
|
||||
LIBTOOL_MODE_LINK=
|
||||
LIBTOOL_MODE_UNINSTALL=
|
||||
INSTALL_LIBRARY='${INSTALL_DATA}'
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(INSTALL_LIBRARY)
|
||||
|
||||
#
|
||||
# Do we want to use pthread rwlock?
|
||||
#
|
||||
|
|
@ -1458,69 +1424,27 @@ case $use_profiler in
|
|||
esac
|
||||
|
||||
#
|
||||
# enable/disable dumping stack backtrace. Also check if the system supports
|
||||
# glibc-compatible backtrace() function.
|
||||
# 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]])],
|
||||
[], [enable_backtrace="yes"])
|
||||
AC_CHECK_HEADERS([execinfo.h],
|
||||
[AC_SEARCH_LIBS([backtrace], [execinfo],
|
||||
[AC_CHECK_FUNCS([backtrace backtrace_symbols])])])
|
||||
|
||||
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],
|
||||
[use internal symbol table for backtrace
|
||||
[all|minimal(default)|none]]),
|
||||
want_symtable="$enableval", want_symtable="minimal")
|
||||
case $want_symtable in
|
||||
yes|all|minimal) # "yes" is a hidden value equivalent to "minimal"
|
||||
if test "" = "$PERL"
|
||||
then
|
||||
AC_MSG_ERROR([Internal symbol table requires perl but no perl is found.
|
||||
Install perl or explicitly disable the feature by --disable-symtable.])
|
||||
fi
|
||||
if test "yes" = "$use_libtool"; then
|
||||
AC_MSG_WARN([Internal symbol table does not work with libtool. Disabling symbol table.])
|
||||
else
|
||||
# we generate the internal symbol table only for those systems
|
||||
# known to work to avoid unexpected build failure. Also, warn
|
||||
# about unsupported systems when the feature is enabled
|
||||
# manually.
|
||||
case $host_os in
|
||||
freebsd*|netbsd*|openbsd*|linux*|solaris*|darwin*)
|
||||
MKSYMTBL_PROGRAM="$PERL"
|
||||
if test "all" = "$want_symtable"; then
|
||||
ALWAYS_MAKE_SYMTABLE="yes"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if test "yes" = "$want_symtable" -o "all" = "$want_symtable"
|
||||
then
|
||||
AC_MSG_WARN([this system is not known to generate internal symbol table safely; disabling it])
|
||||
fi
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(MKSYMTBL_PROGRAM)
|
||||
AC_SUBST(ALWAYS_MAKE_SYMTABLE)
|
||||
# AM_CONDITIONAL([HAVE_BACKTRACE], [test "$ac_cv_func_backtrace" = "yes"])
|
||||
|
||||
#
|
||||
# File name extension for static archive files, for those few places
|
||||
# where they are treated differently from dynamic ones.
|
||||
#
|
||||
O=lo
|
||||
A=la
|
||||
SA=a
|
||||
LIBTOOL_MKDEP_SED='s;\.o;\.lo;'
|
||||
LIBTOOL_MODE_COMPILE='--mode=compile'
|
||||
LIBTOOL_MODE_INSTALL='--mode=install'
|
||||
LIBTOOL_MODE_LINK='--mode=link'
|
||||
LIBTOOL_MODE_UNINSTALL='--mode=uninstall'
|
||||
INSTALL_LIBRARY='${INSTALL_PROGRAM}'
|
||||
|
||||
AC_SUBST(O)
|
||||
AC_SUBST(A)
|
||||
|
|
@ -1530,6 +1454,7 @@ AC_SUBST(LIBTOOL_MODE_COMPILE)
|
|||
AC_SUBST(LIBTOOL_MODE_INSTALL)
|
||||
AC_SUBST(LIBTOOL_MODE_LINK)
|
||||
AC_SUBST(LIBTOOL_MODE_UNINSTALL)
|
||||
AC_SUBST(INSTALL_LIBRARY)
|
||||
|
||||
BIND9_CO_RULE=".c.$O:"
|
||||
AC_SUBST(BIND9_CO_RULE)
|
||||
|
|
@ -2439,33 +2364,19 @@ AS_IF([test "$with_dlopen" = "yes"],
|
|||
LDFLAGS="${LDFLAGS} -Wl,--export-dynamic"
|
||||
SO_CFLAGS="-fPIC"
|
||||
SO_LDFLAGS=""
|
||||
AS_IF([test "$use_libtool" = "yes"],[
|
||||
SO_LDFLAGS="-Xcompiler -shared"
|
||||
SO_LD="${CC}"
|
||||
],[
|
||||
SO_LDFLAGS="-shared"
|
||||
SO_LD="${CC}"
|
||||
])
|
||||
SO_LDFLAGS="-Xcompiler -shared"
|
||||
SO_LD="${CC}"
|
||||
],
|
||||
[*-freebsd*|*-openbsd*|*-netbsd*],[
|
||||
LDFLAGS="${LDFLAGS} -Wl,-E"
|
||||
SO_CFLAGS="-fpic"
|
||||
AS_IF([test "$use_libtool" = "yes"],[
|
||||
SO_LDFLAGS="-Xcompiler -shared"
|
||||
SO_LD="${CC}"
|
||||
],[
|
||||
SO_LDFLAGS="-shared"
|
||||
SO_LD="${CC}"
|
||||
])
|
||||
SO_LDFLAGS="-Xcompiler -shared"
|
||||
SO_LD="${CC}"
|
||||
],
|
||||
[*-darwin*],[
|
||||
SO_CFLAGS="-fPIC"
|
||||
SO_LD="${CC}"
|
||||
AS_IF([test "$use_libtool" = "yes"],[
|
||||
SO_LDFLAGS="-Xcompiler -dynamiclib -undefined dynamic_lookup"
|
||||
],[
|
||||
SO_LDFLAGS="-dynamiclib -undefined dynamic_lookup"
|
||||
])
|
||||
SO_LDFLAGS="-Xcompiler -dynamiclib -undefined dynamic_lookup"
|
||||
],
|
||||
[*-solaris*],[
|
||||
SO_CFLAGS="-KPIC"
|
||||
|
|
@ -2480,17 +2391,12 @@ AS_IF([test "$with_dlopen" = "yes"],
|
|||
[
|
||||
SO_CFLAGS="-fPIC"
|
||||
])
|
||||
AS_IF([test "$GCC" = "yes"],[
|
||||
SO_CFLAGS="-fPIC"
|
||||
AS_IF([test -z "$SO_LD"],
|
||||
[AS_IF([test "$use_libtool" = "yes"],[
|
||||
SO_LDFLAGS="-Xcompiler -shared"
|
||||
SO_LD="${CC}"
|
||||
],[
|
||||
SO_LDFLAGS="-shared"
|
||||
SO_LD="${CC}"
|
||||
])
|
||||
])
|
||||
AS_IF([test "$GCC" = "yes"],
|
||||
[SO_CFLAGS="-fPIC"
|
||||
AS_IF([test -z "$SO_LD"],
|
||||
[SO_LDFLAGS="-Xcompiler -shared"
|
||||
SO_LD="${CC}"
|
||||
])
|
||||
])
|
||||
# If we still don't know how to make shared objects, don't make any.
|
||||
AS_IF([test -n "$SO_LD"],
|
||||
|
|
@ -2943,11 +2849,6 @@ report() {
|
|||
echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
|
||||
test "yes" = "$enable_backtrace" && \
|
||||
echo " Print backtrace on crash (--enable-backtrace)"
|
||||
test "minimal" = "$want_symtable" && \
|
||||
echo " Use symbol table for backtrace, named only (--enable-symtable)"
|
||||
test "yes" = "$want_symtable" -o "all" = "$want_symtable" && \
|
||||
echo " Use symbol table for backtrace, all binaries (--enable-symtable=all)"
|
||||
test "no" = "$use_libtool" || echo " Use GNU libtool (--with-libtool)"
|
||||
test "yes" = "$want_querytrace" && \
|
||||
echo " Very verbose query trace logging (--enable-querytrace)"
|
||||
test "no" = "$with_cmocka" || echo " CMocka Unit Testing Framework (--with-cmocka)"
|
||||
|
|
@ -3004,7 +2905,6 @@ report() {
|
|||
test "yes" = "$want_querytrace" || \
|
||||
echo " Very verbose query trace logging (--enable-querytrace)"
|
||||
|
||||
test "yes" = "$use_libtool" || echo " Use GNU libtool (--with-libtool)"
|
||||
test "no" = "$with_cmocka" && echo " CMocka Unit Testing Framework (--with-cmocka)"
|
||||
|
||||
test "X$PYTHON" = "X" && echo " Python tools (--with-python)"
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ OBJS = pk11.@O@ pk11_result.@O@ \
|
|||
string.@O@ symtab.@O@ task.@O@ taskpool.@O@ \
|
||||
tm.@O@ timer.@O@ version.@O@ \
|
||||
${UNIXOBJS} ${THREADOBJS}
|
||||
SYMTBLOBJS = backtrace-emptytbl.@O@
|
||||
|
||||
# Alphabetically
|
||||
SRCS = pk11.c pk11_result.c \
|
||||
|
|
@ -102,19 +101,19 @@ version.@O@: version.c
|
|||
-DLIBAGE=${LIBAGE} \
|
||||
-c ${srcdir}/version.c
|
||||
|
||||
libisc.@SA@: ${OBJS} ${SYMTBLOBJS}
|
||||
${AR} ${ARFLAGS} $@ ${OBJS} ${SYMTBLOBJS}
|
||||
libisc.@SA@: ${OBJS}
|
||||
${AR} ${ARFLAGS} $@ ${OBJS}
|
||||
${RANLIB} $@
|
||||
|
||||
libisc-nosymtbl.@SA@: ${OBJS}
|
||||
${AR} ${ARFLAGS} $@ ${OBJS}
|
||||
${RANLIB} $@
|
||||
|
||||
libisc.la: ${OBJS} ${SYMTBLOBJS}
|
||||
libisc.la: ${OBJS}
|
||||
${LIBTOOL_MODE_LINK} \
|
||||
${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libisc.la -rpath ${libdir} \
|
||||
-version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \
|
||||
${OBJS} ${SYMTBLOBJS} ${LIBS}
|
||||
${OBJS} ${LIBS}
|
||||
|
||||
libisc-nosymtbl.la: ${OBJS}
|
||||
${LIBTOOL_MODE_LINK} \
|
||||
|
|
|
|||
|
|
@ -95,9 +95,8 @@ static void
|
|||
default_callback(const char *file, int line, isc_assertiontype_t type,
|
||||
const char *cond) {
|
||||
void *tracebuf[BACKTRACE_MAXFRAME];
|
||||
int i, nframes;
|
||||
int nframes;
|
||||
const char *logsuffix = ".";
|
||||
const char *fname;
|
||||
isc_result_t result;
|
||||
|
||||
result = isc_backtrace_gettrace(tracebuf, BACKTRACE_MAXFRAME, &nframes);
|
||||
|
|
@ -109,20 +108,16 @@ default_callback(const char *file, int line, isc_assertiontype_t type,
|
|||
isc_assertion_typetotext(type), cond, logsuffix);
|
||||
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
for (i = 0; i < nframes; i++) {
|
||||
unsigned long offset;
|
||||
|
||||
fname = NULL;
|
||||
result = isc_backtrace_getsymbol(tracebuf[i], &fname,
|
||||
&offset);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
fprintf(stderr, "#%d %p in %s()+0x%lx\n", i,
|
||||
tracebuf[i], fname, offset);
|
||||
} else {
|
||||
fprintf(stderr, "#%d %p in ??\n", i,
|
||||
tracebuf[i]);
|
||||
}
|
||||
#if HAVE_BACKTRACE_SYMBOLS
|
||||
char **strs = backtrace_symbols(tracebuf, nframes);
|
||||
for (int i = 0; i < nframes; i++) {
|
||||
fprintf(stderr, "%s\n", strs[i]);
|
||||
}
|
||||
#else /* HAVE_BACKTRACE_SYMBOLS */
|
||||
for (int i = 0; i < nframes; i++) {
|
||||
fprintf(stderr, "#%d %p in ??\n", i, tracebuf[i]);
|
||||
}
|
||||
#endif /* HAVE_BACKTRACE_SYMBOLS */
|
||||
}
|
||||
fflush(stderr);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* See the COPYRIGHT file distributed with this work for additional
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
/*! \file */
|
||||
|
||||
/*
|
||||
* This file defines an empty (default) symbol table used in backtrace.c
|
||||
* If the application wants to have a complete symbol table, it should redefine
|
||||
* isc__backtrace_symtable with the complete table in some way, and link the
|
||||
* version of the library not including this definition
|
||||
* (e.g. libisc-nosymbol.a).
|
||||
*/
|
||||
|
||||
#include <isc/backtrace.h>
|
||||
|
||||
LIBISC_EXTERNAL_DATA const int isc__backtrace_nsymbols = 0;
|
||||
LIBISC_EXTERNAL_DATA const isc_backtrace_symmap_t isc__backtrace_symtable[] = {
|
||||
{ NULL, "" }
|
||||
};
|
||||
|
|
@ -13,51 +13,17 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_LIBCTRACE
|
||||
#ifdef HAVE_BACKTRACE
|
||||
#include <execinfo.h>
|
||||
#endif /* ifdef HAVE_LIBCTRACE */
|
||||
#endif /* HAVE_BACKTRACE */
|
||||
|
||||
#include <isc/backtrace.h>
|
||||
#include <isc/result.h>
|
||||
#include <isc/util.h>
|
||||
|
||||
#ifdef USE_BACKTRACE
|
||||
/*
|
||||
* Getting a back trace of a running process is tricky and highly platform
|
||||
* dependent. Our current approach is as follows:
|
||||
* 1. If the system library supports the "backtrace()" function, use it.
|
||||
* 2. Otherwise, if the compiler is gcc and the architecture is x86_64 or IA64,
|
||||
* then use gcc's (hidden) Unwind_Backtrace() function. Note that this
|
||||
* function doesn't work for C programs on many other architectures.
|
||||
* 3. Otherwise, if the architecture x86 or x86_64, try to unwind the stack
|
||||
* frame following frame pointers. This assumes the executable binary
|
||||
* compiled with frame pointers; this is not always true for x86_64 (rather,
|
||||
* compiler optimizations often disable frame pointers). The validation
|
||||
* checks in getnextframeptr() hopefully rejects bogus values stored in
|
||||
* the RBP register in such a case. If the backtrace function itself crashes
|
||||
* due to this problem, the whole package should be rebuilt with
|
||||
* --disable-backtrace.
|
||||
*/
|
||||
#ifdef HAVE_LIBCTRACE
|
||||
#define BACKTRACE_LIBC
|
||||
#elif defined(__GNUC__) && (defined(__x86_64__) || defined(__ia64__))
|
||||
#define BACKTRACE_GCC
|
||||
#elif defined(WIN32)
|
||||
#define BACKTRACE_WIN32
|
||||
#elif defined(__x86_64__) || defined(__i386__)
|
||||
#define BACKTRACE_X86STACK
|
||||
#else /* ifdef HAVE_LIBCTRACE */
|
||||
#define BACKTRACE_DISABLED
|
||||
#endif /* HAVE_LIBCTRACE */
|
||||
#else /* USE_BACKTRACE */
|
||||
#define BACKTRACE_DISABLED
|
||||
#endif /* USE_BACKTRACE */
|
||||
|
||||
#ifdef BACKTRACE_LIBC
|
||||
#ifdef HAVE_BACKTRACE
|
||||
isc_result_t
|
||||
isc_backtrace_gettrace(void **addrs, int maxaddrs, int *nframes) {
|
||||
int n;
|
||||
|
||||
/*
|
||||
* Validate the arguments: intentionally avoid using REQUIRE().
|
||||
* See notes in backtrace.h.
|
||||
|
|
@ -70,231 +36,23 @@ isc_backtrace_gettrace(void **addrs, int maxaddrs, int *nframes) {
|
|||
* backtrace(3) includes this function itself in the address array,
|
||||
* which should be eliminated from the returned sequence.
|
||||
*/
|
||||
n = backtrace(addrs, maxaddrs);
|
||||
int n = backtrace(addrs, maxaddrs);
|
||||
if (n < 2) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
}
|
||||
n--;
|
||||
memmove(addrs, &addrs[1], sizeof(void *) * n);
|
||||
memmove(addrs, &addrs[1], sizeof(addrs[0]) * n);
|
||||
*nframes = n;
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
#elif defined(BACKTRACE_GCC)
|
||||
extern int
|
||||
_Unwind_Backtrace(void *fn, void *a);
|
||||
extern void *
|
||||
_Unwind_GetIP(void *ctx);
|
||||
|
||||
typedef struct {
|
||||
void **result;
|
||||
int max_depth;
|
||||
int skip_count;
|
||||
int count;
|
||||
} trace_arg_t;
|
||||
|
||||
static int
|
||||
btcallback(void *uc, void *opq) {
|
||||
trace_arg_t *arg = (trace_arg_t *)opq;
|
||||
|
||||
if (arg->skip_count > 0) {
|
||||
arg->skip_count--;
|
||||
} else {
|
||||
arg->result[arg->count++] = (void *)_Unwind_GetIP(uc);
|
||||
}
|
||||
if (arg->count == arg->max_depth) {
|
||||
return (5); /* _URC_END_OF_STACK */
|
||||
}
|
||||
return (0); /* _URC_NO_REASON */
|
||||
}
|
||||
|
||||
#else /* HAVE_BACKTRACE */
|
||||
isc_result_t
|
||||
isc_backtrace_gettrace(void **addrs, int maxaddrs, int *nframes) {
|
||||
trace_arg_t arg;
|
||||
|
||||
/* Argument validation: see above. */
|
||||
if (addrs == NULL || nframes == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
arg.skip_count = 1;
|
||||
arg.result = addrs;
|
||||
arg.max_depth = maxaddrs;
|
||||
arg.count = 0;
|
||||
_Unwind_Backtrace(btcallback, &arg);
|
||||
|
||||
*nframes = arg.count;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
#elif defined(BACKTRACE_WIN32)
|
||||
isc_result_t
|
||||
isc_backtrace_gettrace(void **addrs, int maxaddrs, int *nframes) {
|
||||
unsigned long ftc = (unsigned long)maxaddrs;
|
||||
|
||||
*nframes = (int)CaptureStackBackTrace(1, ftc, addrs, NULL);
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
#elif defined(BACKTRACE_X86STACK)
|
||||
#ifdef __x86_64__
|
||||
static unsigned long
|
||||
getrbp(void) {
|
||||
__asm("movq %rbp, %rax\n");
|
||||
}
|
||||
#endif /* ifdef __x86_64__ */
|
||||
|
||||
static void **
|
||||
getnextframeptr(void **sp) {
|
||||
void **newsp = (void **)*sp;
|
||||
|
||||
/*
|
||||
* Perform sanity check for the new frame pointer, derived from
|
||||
* google glog. This can actually be bogus depending on compiler.
|
||||
*/
|
||||
|
||||
/* prohibit the stack frames from growing downwards */
|
||||
if (newsp <= sp) {
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* A heuristics to reject "too large" frame: this actually happened. */
|
||||
if ((char *)newsp - (char *)sp > 100000) {
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Not sure if other checks used in glog are needed at this moment.
|
||||
* For our purposes we don't have to consider non-contiguous frames,
|
||||
* for example.
|
||||
*/
|
||||
|
||||
return (newsp);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
isc_backtrace_gettrace(void **addrs, int maxaddrs, int *nframes) {
|
||||
int i = 0;
|
||||
void **sp;
|
||||
|
||||
/* Argument validation: see above. */
|
||||
if (addrs == NULL || nframes == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
sp = (void **)getrbp();
|
||||
if (sp == NULL) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
}
|
||||
/*
|
||||
* sp is the frame ptr of this function itself due to the call to
|
||||
* getrbp(), so need to unwind one frame for consistency.
|
||||
*/
|
||||
sp = getnextframeptr(sp);
|
||||
#else /* ifdef __x86_64__ */
|
||||
/*
|
||||
* i386: the frame pointer is stored 2 words below the address for the
|
||||
* first argument. Note that the body of this function cannot be
|
||||
* inlined since it depends on the address of the function argument.
|
||||
*/
|
||||
sp = (void **)&addrs - 2;
|
||||
#endif /* ifdef __x86_64__ */
|
||||
|
||||
while (sp != NULL && i < maxaddrs) {
|
||||
addrs[i++] = *(sp + 1);
|
||||
sp = getnextframeptr(sp);
|
||||
}
|
||||
|
||||
*nframes = i;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
#elif defined(BACKTRACE_DISABLED)
|
||||
isc_result_t
|
||||
isc_backtrace_gettrace(void **addrs, int maxaddrs, int *nframes) {
|
||||
/* Argument validation: see above. */
|
||||
if (addrs == NULL || nframes == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
UNUSED(addrs);
|
||||
UNUSED(maxaddrs);
|
||||
UNUSED(nframes);
|
||||
|
||||
return (ISC_R_NOTIMPLEMENTED);
|
||||
}
|
||||
#endif /* ifdef BACKTRACE_LIBC */
|
||||
|
||||
isc_result_t
|
||||
isc_backtrace_getsymbolfromindex(int idx, const void **addrp,
|
||||
const char **symbolp) {
|
||||
REQUIRE(addrp != NULL && *addrp == NULL);
|
||||
REQUIRE(symbolp != NULL && *symbolp == NULL);
|
||||
|
||||
if (idx < 0 || idx >= isc__backtrace_nsymbols) {
|
||||
return (ISC_R_RANGE);
|
||||
}
|
||||
|
||||
*addrp = isc__backtrace_symtable[idx].addr;
|
||||
*symbolp = isc__backtrace_symtable[idx].symbol;
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
static int
|
||||
symtbl_compare(const void *addr, const void *entryarg) {
|
||||
const isc_backtrace_symmap_t *entry = entryarg;
|
||||
const isc_backtrace_symmap_t *end =
|
||||
&isc__backtrace_symtable[isc__backtrace_nsymbols - 1];
|
||||
|
||||
if (isc__backtrace_nsymbols == 1 || entry == end) {
|
||||
if (addr >= entry->addr) {
|
||||
/*
|
||||
* If addr is equal to or larger than that of the last
|
||||
* entry of the table, we cannot be sure if this is
|
||||
* within a valid range so we consider it valid.
|
||||
*/
|
||||
return (0);
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* entry + 1 is a valid entry from now on. */
|
||||
if (addr < entry->addr) {
|
||||
return (-1);
|
||||
} else if (addr >= (entry + 1)->addr) {
|
||||
return (1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
isc_backtrace_getsymbol(const void *addr, const char **symbolp,
|
||||
unsigned long *offsetp) {
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
isc_backtrace_symmap_t *found;
|
||||
|
||||
/*
|
||||
* Validate the arguments: intentionally avoid using REQUIRE().
|
||||
* See notes in backtrace.h.
|
||||
*/
|
||||
if (symbolp == NULL || *symbolp != NULL || offsetp == NULL) {
|
||||
return (ISC_R_FAILURE);
|
||||
}
|
||||
|
||||
if (isc__backtrace_nsymbols < 1) {
|
||||
return (ISC_R_NOTFOUND);
|
||||
}
|
||||
|
||||
/*
|
||||
* Search the table for the entry that meets:
|
||||
* entry.addr <= addr < next_entry.addr.
|
||||
*/
|
||||
found = bsearch(addr, isc__backtrace_symtable, isc__backtrace_nsymbols,
|
||||
sizeof(isc__backtrace_symtable[0]), symtbl_compare);
|
||||
if (found == NULL) {
|
||||
result = ISC_R_NOTFOUND;
|
||||
} else {
|
||||
*symbolp = found->symbol;
|
||||
*offsetp = (unsigned long)((const char *)addr -
|
||||
(char *)found->addr);
|
||||
}
|
||||
|
||||
return (result);
|
||||
}
|
||||
#endif /* HAVE_BACKTRACE */
|
||||
|
|
|
|||
|
|
@ -37,20 +37,12 @@
|
|||
*** Imports
|
||||
***/
|
||||
|
||||
#if HAVE_BACKTRACE_SYMBOLS
|
||||
#include <execinfo.h>
|
||||
#endif /* HAVE_BACKTRACE_SYMBOLS */
|
||||
|
||||
#include <isc/types.h>
|
||||
|
||||
/***
|
||||
*** Types
|
||||
***/
|
||||
struct isc_backtrace_symmap {
|
||||
void * addr;
|
||||
const char *symbol;
|
||||
};
|
||||
|
||||
LIBISC_EXTERNAL_DATA extern const int isc__backtrace_nsymbols;
|
||||
LIBISC_EXTERNAL_DATA extern const isc_backtrace_symmap_t
|
||||
isc__backtrace_symtable[];
|
||||
|
||||
/***
|
||||
*** Functions
|
||||
***/
|
||||
|
|
@ -77,49 +69,6 @@ isc_backtrace_gettrace(void **addrs, int maxaddrs, int *nframes);
|
|||
*\li #ISC_R_NOTFOUND
|
||||
*\li #ISC_R_NOTIMPLEMENTED
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
isc_backtrace_getsymbolfromindex(int index, const void **addrp,
|
||||
const char **symbolp);
|
||||
/*%<
|
||||
* Returns the content of the internal symbol table of the given index.
|
||||
* On success, *addrsp and *symbolp point to the address and the symbol of
|
||||
* the 'index'th entry of the table, respectively. If 'index' is not in the
|
||||
* range of the symbol table, ISC_R_RANGE will be returned.
|
||||
*
|
||||
* Requires
|
||||
*
|
||||
*\li 'addrp' must be non NULL && '*addrp' == NULL.
|
||||
*
|
||||
*\li 'symbolp' must be non NULL && '*symbolp' == NULL.
|
||||
*
|
||||
* Returns:
|
||||
*
|
||||
*\li #ISC_R_SUCCESS
|
||||
*\li #ISC_R_RANGE
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
isc_backtrace_getsymbol(const void *addr, const char **symbolp,
|
||||
unsigned long *offsetp);
|
||||
/*%<
|
||||
* Searches the internal symbol table for the symbol that most matches the
|
||||
* given 'addr'. On success, '*symbolp' will point to the name of function
|
||||
* to which the address 'addr' belong, and '*offsetp' will store the offset
|
||||
* from the function's entry address to 'addr'.
|
||||
*
|
||||
* Requires (note that these are not ensured by assertion checks, see above):
|
||||
*
|
||||
*\li 'symbolp' must be non NULL && '*symbolp' == NULL.
|
||||
*
|
||||
*\li 'offsetp' must be non NULL.
|
||||
*
|
||||
* Returns:
|
||||
*
|
||||
*\li #ISC_R_SUCCESS
|
||||
*\li #ISC_R_FAILURE
|
||||
*\li #ISC_R_NOTFOUND
|
||||
*/
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
#endif /* ISC_BACKTRACE_H */
|
||||
|
|
|
|||
|
|
@ -31,13 +31,11 @@
|
|||
|
||||
/* Core Types. Alphabetized by defined type. */
|
||||
|
||||
typedef struct isc_astack isc_astack_t; /*%< Array-based fast stack */
|
||||
typedef struct isc_appctx isc_appctx_t; /*%< Application context */
|
||||
typedef struct isc_backtrace_symmap isc_backtrace_symmap_t; /*%< Symbol Table
|
||||
* Entry */
|
||||
typedef struct isc_buffer isc_buffer_t; /*%< Buffer */
|
||||
typedef ISC_LIST(isc_buffer_t) isc_bufferlist_t; /*%< Buffer List */
|
||||
typedef struct isc_constregion isc_constregion_t; /*%< Const region */
|
||||
typedef struct isc_astack isc_astack_t; /*%< Array-based fast stack */
|
||||
typedef struct isc_appctx isc_appctx_t; /*%< Application context */
|
||||
typedef struct isc_buffer isc_buffer_t; /*%< Buffer */
|
||||
typedef ISC_LIST(isc_buffer_t) isc_bufferlist_t; /*%< Buffer List */
|
||||
typedef struct isc_constregion isc_constregion_t; /*%< Const region */
|
||||
typedef struct isc_consttextregion isc_consttextregion_t; /*%< Const Text Region
|
||||
*/
|
||||
typedef struct isc_counter isc_counter_t; /*%< Counter */
|
||||
|
|
|
|||
|
|
@ -125,8 +125,6 @@ isc_appctx_destroy
|
|||
isc_assertion_failed
|
||||
isc_assertion_setcallback
|
||||
isc_assertion_typetotext
|
||||
isc_backtrace_getsymbol
|
||||
isc_backtrace_getsymbolfromindex
|
||||
isc_backtrace_gettrace
|
||||
isc_base32_decoderegion
|
||||
isc_base32_decodestring
|
||||
|
|
@ -755,8 +753,6 @@ syslog
|
|||
|
||||
EXPORTS
|
||||
|
||||
isc__backtrace_nsymbols DATA
|
||||
isc__backtrace_symtable DATA
|
||||
isc_bind9 DATA
|
||||
isc_commandline_argument DATA
|
||||
isc_commandline_errprint DATA
|
||||
|
|
|
|||
|
|
@ -461,9 +461,6 @@
|
|||
<ClCompile Include="..\backtrace.c">
|
||||
<Filter>Library Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\backtrace-emptytbl.c">
|
||||
<Filter>Library Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\base32.c">
|
||||
<Filter>Library Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
|
|
|||
|
|
@ -414,7 +414,6 @@ copy InstallFiles ..\Build\Release\
|
|||
<ClCompile Include="..\app.c" />
|
||||
<ClCompile Include="..\assertions.c" />
|
||||
<ClCompile Include="..\astack.c" />
|
||||
<ClCompile Include="..\backtrace-emptytbl.c" />
|
||||
<ClCompile Include="..\backtrace.c" />
|
||||
<ClCompile Include="..\base32.c" />
|
||||
<ClCompile Include="..\base64.c" />
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@
|
|||
|
||||
#include "nstest.h"
|
||||
|
||||
#if defined(USE_LIBTOOL) || LD_WRAP
|
||||
static int
|
||||
_setup(void **state) {
|
||||
isc_result_t result;
|
||||
|
|
@ -139,20 +138,15 @@ notify_start(void **state) {
|
|||
ns_test_cleanup_zone();
|
||||
isc_nmhandle_unref(client->handle);
|
||||
}
|
||||
#endif /* if defined(USE_LIBTOOL) || LD_WRAP */
|
||||
|
||||
int
|
||||
main(void) {
|
||||
#if defined(USE_LIBTOOL) || LD_WRAP
|
||||
const struct CMUnitTest tests[] = {
|
||||
cmocka_unit_test_setup_teardown(notify_start, _setup,
|
||||
_teardown),
|
||||
};
|
||||
|
||||
return (cmocka_run_group_tests(tests, NULL, NULL));
|
||||
#else /* if defined(USE_LIBTOOL) || LD_WRAP */
|
||||
print_message("1..0 # Skip notify_test requires libtool or LD_WRAP\n");
|
||||
#endif /* if defined(USE_LIBTOOL) || LD_WRAP */
|
||||
}
|
||||
#else /* HAVE_CMOCKA && !__SANITIZE_ADDRESS__ */
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
|
||||
#include "nstest.h"
|
||||
|
||||
#if defined(USE_LIBTOOL) || LD_WRAP
|
||||
static int
|
||||
_setup(void **state) {
|
||||
isc_result_t result;
|
||||
|
|
@ -600,11 +599,9 @@ ns__query_start_test(void **state) {
|
|||
run_start_test(&tests[i]);
|
||||
}
|
||||
}
|
||||
#endif /* if defined(USE_LIBTOOL) || LD_WRAP */
|
||||
|
||||
int
|
||||
main(void) {
|
||||
#if defined(USE_LIBTOOL) || LD_WRAP
|
||||
const struct CMUnitTest tests[] = {
|
||||
cmocka_unit_test_setup_teardown(ns__query_sfcache_test, _setup,
|
||||
_teardown),
|
||||
|
|
@ -613,9 +610,6 @@ main(void) {
|
|||
};
|
||||
|
||||
return (cmocka_run_group_tests(tests, NULL, NULL));
|
||||
#else /* if defined(USE_LIBTOOL) || LD_WRAP */
|
||||
print_message("1..0 # Skip query_test requires libtool or LD_WRAP\n");
|
||||
#endif /* if defined(USE_LIBTOOL) || LD_WRAP */
|
||||
}
|
||||
|
||||
#else /* HAVE_CMOCKA && !__SANITIZE_ADDRESS__ */
|
||||
|
|
|
|||
|
|
@ -206,46 +206,8 @@ MKDEP = ${SHELL} ${top_builddir}/make/mkdep
|
|||
### ${FINALBUILDCMD}
|
||||
### See bin/check/Makefile.in for a complete example of the use of LIBS0.
|
||||
###
|
||||
FINALBUILDCMD = if [ X"${MKSYMTBL_PROGRAM}" = X -o X"$${MAKE_SYMTABLE:-${ALWAYS_MAKE_SYMTABLE}}" = X ] ; then \
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} \
|
||||
FINALBUILDCMD = ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} \
|
||||
-o $@ $${BASEOBJS} $${LIBS0} ${LIBS}; \
|
||||
else \
|
||||
rm -f $@tmp0; \
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} \
|
||||
-o $@tmp0 $${BASEOBJS} $${LIBS0} ${LIBS} || exit 1; \
|
||||
rm -f $@-symtbl.c $@-symtbl.@O@; \
|
||||
${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl \
|
||||
-o $@-symtbl.c $@tmp0 || exit 1; \
|
||||
$(MAKE) $@-symtbl.@O@ || exit 1; \
|
||||
rm -f $@tmp1; \
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} \
|
||||
-o $@tmp1 $${BASEOBJS} $@-symtbl.@O@ $${LIBS0} ${NOSYMLIBS} || exit 1; \
|
||||
rm -f $@-symtbl.c $@-symtbl.@O@; \
|
||||
${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl \
|
||||
-o $@-symtbl.c $@tmp1 || exit 1; \
|
||||
$(MAKE) $@-symtbl.@O@ || exit 1; \
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} \
|
||||
-o $@tmp2 $${BASEOBJS} $@-symtbl.@O@ $${LIBS0} ${NOSYMLIBS}; \
|
||||
${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl \
|
||||
-o $@-symtbl2.c $@tmp2; \
|
||||
count=0; \
|
||||
until diff $@-symtbl.c $@-symtbl2.c > /dev/null ; \
|
||||
do \
|
||||
count=`expr $$count + 1` ; \
|
||||
test $$count = 42 && exit 1 ; \
|
||||
rm -f $@-symtbl.c $@-symtbl.@O@; \
|
||||
${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl \
|
||||
-o $@-symtbl.c $@tmp2 || exit 1; \
|
||||
$(MAKE) $@-symtbl.@O@ || exit 1; \
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} \
|
||||
${LDFLAGS} -o $@tmp2 $${BASEOBJS} $@-symtbl.@O@ \
|
||||
$${LIBS0} ${NOSYMLIBS}; \
|
||||
${MKSYMTBL_PROGRAM} ${top_srcdir}/util/mksymtbl.pl \
|
||||
-o $@-symtbl2.c $@tmp2; \
|
||||
done ; \
|
||||
mv $@tmp2 $@; \
|
||||
rm -f $@tmp0 $@tmp1 $@tmp2 $@-symtbl2.c; \
|
||||
fi
|
||||
|
||||
cleandir: distclean
|
||||
superclean: maintainer-clean
|
||||
|
|
@ -333,16 +295,6 @@ DBLATEX = @DBLATEX@
|
|||
W3M = @W3M@
|
||||
PANDOC = @PANDOC@
|
||||
|
||||
###
|
||||
### Script language program used to create internal symbol tables
|
||||
###
|
||||
MKSYMTBL_PROGRAM = @MKSYMTBL_PROGRAM@
|
||||
|
||||
###
|
||||
### Switch to create internal symbol table selectively
|
||||
###
|
||||
ALWAYS_MAKE_SYMTABLE = @ALWAYS_MAKE_SYMTABLE@
|
||||
|
||||
###
|
||||
### DocBook -> HTML
|
||||
### DocBook -> man page
|
||||
|
|
|
|||
|
|
@ -38,25 +38,18 @@ then
|
|||
# show backtrace via gdb(1).
|
||||
broken_tests=$(kyua_report | awk '$2 == "->" && ( $3 == "broken:" || $3 == "failed:" ) { print $1 }')
|
||||
if [ -n "${CI}" ] && [ "$(id -u)" -eq 0 ] && [ -n "${broken_tests}" ] && [ -n "${GDB}" ]; then
|
||||
if grep '^#define USE_LIBTOOL 1$' "${TOP}/config.h" >/dev/null; then
|
||||
# kyua debug command misidentifies broken binary when libtool is used
|
||||
# to configure BIND (see https://github.com/jmmv/kyua/issues/207).
|
||||
# Here we try "trick" kyua use our custom gdb script instead
|
||||
# of using gdb(1) directly. That's why this part needs to be run as root
|
||||
# and, for safety reasons, only in the CI.
|
||||
mv "${GDB}" "${GDB}.orig"
|
||||
cp "${TOP}/unit/gdb" "${GDB}"
|
||||
for test in ${broken_tests}; do
|
||||
echo
|
||||
${KYUA} debug "${test}"
|
||||
done
|
||||
mv "${GDB}.orig" "${GDB}"
|
||||
else
|
||||
for test in ${broken_tests}; do
|
||||
echo
|
||||
${KYUA} debug "${test}"
|
||||
done
|
||||
fi
|
||||
# kyua debug command misidentifies broken binary when libtool is used
|
||||
# to configure BIND (see https://github.com/jmmv/kyua/issues/207).
|
||||
# Here we try "trick" kyua use our custom gdb script instead
|
||||
# of using gdb(1) directly. That's why this part needs to be run as root
|
||||
# and, for safety reasons, only in the CI.
|
||||
mv "${GDB}" "${GDB}.orig"
|
||||
cp "${TOP}/unit/gdb" "${GDB}"
|
||||
for test in ${broken_tests}; do
|
||||
echo
|
||||
${KYUA} debug "${test}"
|
||||
done
|
||||
mv "${GDB}.orig" "${GDB}"
|
||||
fi
|
||||
|
||||
if [ "${status}" -eq 0 ]
|
||||
|
|
|
|||
|
|
@ -2123,7 +2123,6 @@
|
|||
./lib/isc/app.c C 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2013,2014,2015,2016,2017,2018,2019,2020
|
||||
./lib/isc/assertions.c C 1997,1998,1999,2000,2001,2004,2005,2007,2008,2009,2015,2016,2018,2019,2020
|
||||
./lib/isc/astack.c C 2019,2020
|
||||
./lib/isc/backtrace-emptytbl.c C 2009,2016,2018,2019,2020
|
||||
./lib/isc/backtrace.c C 2009,2013,2014,2015,2016,2018,2019,2020
|
||||
./lib/isc/base32.c C 2008,2009,2013,2014,2015,2016,2018,2019,2020
|
||||
./lib/isc/base64.c C 1998,1999,2000,2001,2003,2004,2005,2007,2009,2013,2014,2015,2016,2018,2019,2020
|
||||
|
|
@ -2589,7 +2588,6 @@
|
|||
./util/mdnbuildtest.sh SH 2000,2001,2004,2007,2012,2016,2018,2019,2020
|
||||
./util/memleak.pl PERL 1999,2000,2001,2004,2007,2012,2016,2018,2019,2020
|
||||
./util/merge_copyrights PERL 1998,1999,2000,2001,2003,2004,2005,2006,2007,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020
|
||||
./util/mksymtbl.pl PERL 2009,2012,2016,2018,2019,2020
|
||||
./util/models.c C 2015,2016,2017,2018,2019,2020
|
||||
./util/nanny.pl PERL 2000,2001,2004,2007,2012,2016,2018,2019,2020
|
||||
./util/new-func PERL 2005,2007,2012,2016,2018,2019,2020
|
||||
|
|
|
|||
|
|
@ -1,97 +0,0 @@
|
|||
#!/usr/bin/env perl
|
||||
#
|
||||
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
# See the COPYRIGHT file distributed with this work for additional
|
||||
# information regarding copyright ownership.
|
||||
|
||||
use strict;
|
||||
use diagnostics;
|
||||
$^W = 1;
|
||||
|
||||
my $rev = '$Id$';
|
||||
$rev =~ s/\$//g;
|
||||
$rev =~ s/,v//g;
|
||||
$rev =~ s/Id: //;
|
||||
|
||||
use Getopt::Std;
|
||||
my %options;
|
||||
getopts('i:o:', \%options);
|
||||
|
||||
my ($binname, $need_uscorefix, $outputfile, $nsyms, $ostype, $nm_prog);
|
||||
my %symmap;
|
||||
|
||||
$binname = $ARGV[0];
|
||||
$need_uscorefix = 0;
|
||||
if ($options{'o'}) {
|
||||
$outputfile = $options{'o'};
|
||||
} else {
|
||||
$outputfile = "symtbl.c";
|
||||
}
|
||||
|
||||
# OS-depending configuration
|
||||
$nm_prog = "nm";
|
||||
$ostype = `uname -s`;
|
||||
chop($ostype);
|
||||
|
||||
if ($options{'i'}) {
|
||||
open(SYMBOLS, $options{'i'}) || die "failed to open $options{'i'}";
|
||||
} else {
|
||||
open(SYMBOLS, "$nm_prog $binname |") ||
|
||||
die "failed to invoke utility to get symbols";
|
||||
}
|
||||
open(TBLFILE, ">$outputfile") || die "failed to open output file: $outputfile";
|
||||
|
||||
$nsyms = 0;
|
||||
while (<SYMBOLS>) {
|
||||
my ($addr, $symbol) = (0, "");
|
||||
# *BSDs, Linux, etc.
|
||||
if (/([0-9a-f]*)\s[tT]\s(.*)/) {
|
||||
($addr, $symbol) = ($1, $2);
|
||||
# heuristics: some compilers add a "_" to all program
|
||||
# defined symbols. Detect and fix it for a well known
|
||||
# symbol of "main".
|
||||
$need_uscorefix = 1 if ($symbol eq "_main");
|
||||
}
|
||||
if ($symbol ne "") {
|
||||
next if ($symmap{$addr});
|
||||
|
||||
$symmap{$addr} = $symbol;
|
||||
$nsyms++;
|
||||
}
|
||||
}
|
||||
|
||||
sub lhex {
|
||||
my $la = substr($a, -8);
|
||||
my $lb = substr($b, -8);
|
||||
my $ha = substr($a, 0, length($a) - length($la));
|
||||
my $hb = substr($b, 0, length($b) - length($lb));
|
||||
$ha = "0" if ($ha eq "");
|
||||
$ha = "0" if ($hb eq "");
|
||||
if (hex($ha) != hex($hb)) {
|
||||
$la = $ha;
|
||||
$lb = $hb;
|
||||
}
|
||||
hex($la) <=> hex($lb)
|
||||
}
|
||||
|
||||
print TBLFILE "/*\n * Generated by $rev \n */\n";
|
||||
print TBLFILE "#include <isc/backtrace.h>\n";
|
||||
print TBLFILE "const int isc__backtrace_nsymbols = $nsyms;\n";
|
||||
print TBLFILE "const isc_backtrace_symmap_t isc__backtrace_symtable[] = {\n";
|
||||
foreach (sort lhex keys(%symmap)) {
|
||||
my ($addr, $symbol) = ($_, $symmap{$_});
|
||||
if ($need_uscorefix && $symbol =~ /^_(.*)/) {
|
||||
$symbol = $1;
|
||||
}
|
||||
print TBLFILE "\t{ (void *)0x$addr, \"$symbol\" },\n";
|
||||
}
|
||||
print TBLFILE "\t{ (void *)0x0, \"\" },\n";
|
||||
print TBLFILE "};\n";
|
||||
|
||||
close(TBLFILE);
|
||||
close(SYMBOLS);
|
||||
Loading…
Reference in a new issue