From c463808992abd450d5469befe9f7e67b4732cb1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 10 Mar 2020 13:35:18 +0100 Subject: [PATCH 1/4] Remove the ability to generate internal symbol table The internal symbol table cannot be generated when libtool is in use, which is going to be a mandatory in the next commit. --- configure | 54 --------------------------- configure.ac | 45 ---------------------- util/copyrights | 1 - util/mksymtbl.pl | 97 ------------------------------------------------ 4 files changed, 197 deletions(-) delete mode 100755 util/mksymtbl.pl diff --git a/configure b/configure index 83c2d0a5c5..9b5b3f4aea 100755 --- a/configure +++ b/configure @@ -718,8 +718,6 @@ LIBTOOL_MKDEP_SED SA A O -ALWAYS_MAKE_SYMTABLE -MKSYMTBL_PROGRAM PURIFY purify_path MKDEPPROG @@ -924,7 +922,6 @@ with_zlib with_purify with_gperftools_profiler enable_backtrace -enable_symtable enable_tcp_fastopen with_readline enable_isc_spnego @@ -1631,8 +1628,6 @@ Optional Features: --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 @@ -12260,7 +12255,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 @@ -18768,50 +18762,6 @@ rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -# Check whether --enable-symtable was given. -if test "${enable_symtable+set}" = set; then : - enableval=$enable_symtable; want_symtable="$enableval" -else - want_symtable="minimal" -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 - - - # # File name extension for static archive files, for those few places # where they are treated differently from dynamic ones. @@ -26040,10 +25990,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)" diff --git a/configure.ac b/configure.ac index 550326bcfe..25bfad04b0 100644 --- a/configure.ac +++ b/configure.ac @@ -94,7 +94,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 @@ -1476,46 +1475,6 @@ AS_IF([test "$enable_backtrace" = "yes"], [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) - # # File name extension for static archive files, for those few places # where they are treated differently from dynamic ones. @@ -2943,10 +2902,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)" diff --git a/util/copyrights b/util/copyrights index bdf10cda34..bff0ea4fc5 100644 --- a/util/copyrights +++ b/util/copyrights @@ -2589,7 +2589,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 diff --git a/util/mksymtbl.pl b/util/mksymtbl.pl deleted file mode 100755 index 1a4891e231..0000000000 --- a/util/mksymtbl.pl +++ /dev/null @@ -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 () { - 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 \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); From 1628f5865acb2d472ce4adf71fc78ac99094fa1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 10 Mar 2020 13:46:42 +0100 Subject: [PATCH 2/4] Remove configure option to compile without libtool libtool is a requirement to use automake (see GL #4), so this commit removes the ability to compile BIND 9 without libtool. --- .gitlab-ci.yml | 24 ------- bin/tests/optional/Makefile.in | 9 +-- config.h.in | 3 - configure | 117 +++++++-------------------------- configure.ac | 88 +++++++------------------ lib/ns/tests/notify_test.c | 6 -- lib/ns/tests/query_test.c | 6 -- make/rules.in | 50 +------------- unit/unittest.sh.in | 31 ++++----- 9 files changed, 59 insertions(+), 275 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dba3520f1c..1ad8a05830 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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: diff --git a/bin/tests/optional/Makefile.in b/bin/tests/optional/Makefile.in index 7533dd9251..ab5536d1d1 100644 --- a/bin/tests/optional/Makefile.in +++ b/bin/tests/optional/Makefile.in @@ -116,19 +116,14 @@ backtrace_test_nosymtbl@EXEEXT@: ${srcdir}/backtrace_test.c ${ISCDEPLIBS} 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 + cp ${top_srcdir}/lib/isc/backtrace-emptytbl.c symtbl.c #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 + cp ${top_srcdir}/lib/isc/backtrace-emptytbl.c symtbl.c #fourth step: build the final binary rm -f $@0 ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${BTTEST_CFLAGS} ${LDFLAGS} \ diff --git a/config.h.in b/config.h.in index ffe84333b7..4d292f2950 100644 --- a/config.h.in +++ b/config.h.in @@ -559,9 +559,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 diff --git a/configure b/configure index 9b5b3f4aea..2f3a2ceb1b 100755 --- a/configure +++ b/configure @@ -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 @@ -745,7 +746,6 @@ PKCS11_TOOLS PKCS11_TEST OPENSSL_LIBS OPENSSL_CFLAGS -INSTALL_LIBRARY ALWAYS_DEFINES LIBUV_LIBS LIBUV_CFLAGS @@ -907,7 +907,6 @@ with_geoip2 enable_geoip with_maxminddb with_locktype -with_libtool enable_pthread_rwlock with_openssl enable_fips_mode @@ -1661,7 +1660,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) @@ -11938,6 +11936,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: @@ -15989,51 +15990,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? # @@ -18766,7 +18722,16 @@ fi # 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}' + @@ -22291,47 +22256,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*) : @@ -22351,20 +22290,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 @@ -25990,7 +25919,6 @@ report() { echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)" test "yes" = "$enable_backtrace" && \ echo " Print backtrace on crash (--enable-backtrace)" - 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)" @@ -26047,7 +25975,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)" diff --git a/configure.ac b/configure.ac index 25bfad04b0..81bcc0ae51 100644 --- a/configure.ac +++ b/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 @@ -680,40 +682,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? # @@ -1479,7 +1447,15 @@ AS_IF([test "$enable_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) @@ -1489,6 +1465,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) @@ -2398,33 +2375,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" @@ -2439,17 +2402,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"], @@ -2902,7 +2860,6 @@ report() { echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)" test "yes" = "$enable_backtrace" && \ echo " Print backtrace on crash (--enable-backtrace)" - 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)" @@ -2959,7 +2916,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)" diff --git a/lib/ns/tests/notify_test.c b/lib/ns/tests/notify_test.c index cac2bd14ac..4e3c5a63d9 100644 --- a/lib/ns/tests/notify_test.c +++ b/lib/ns/tests/notify_test.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__ */ diff --git a/lib/ns/tests/query_test.c b/lib/ns/tests/query_test.c index a82989e2c0..9d4243625e 100644 --- a/lib/ns/tests/query_test.c +++ b/lib/ns/tests/query_test.c @@ -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__ */ diff --git a/make/rules.in b/make/rules.in index e1d17cd8ba..e31653d295 100644 --- a/make/rules.in +++ b/make/rules.in @@ -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 diff --git a/unit/unittest.sh.in b/unit/unittest.sh.in index 60b91274be..95e1b6352e 100755 --- a/unit/unittest.sh.in +++ b/unit/unittest.sh.in @@ -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 ] From ad5250ff9c208cf135cb4e4f700501a907ca8fa2 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Tue, 10 Mar 2020 21:15:43 -0700 Subject: [PATCH 3/4] Remove support for internal symbol table Since we can no longer generate an internal symbol table, there doesn't seem to be much reason to retain the code that reads it. --- bin/check/Makefile.in | 2 - bin/confgen/Makefile.in | 3 - bin/delv/Makefile.in | 2 - bin/dig/Makefile.in | 4 -- bin/dnssec/Makefile.in | 3 - bin/named/Makefile.in | 12 ---- bin/named/main.c | 58 ++----------------- bin/nsupdate/Makefile.in | 4 -- bin/rndc/Makefile.in | 2 - bin/tests/Makefile.in | 2 - bin/tests/optional/.gitignore | 2 - bin/tests/optional/Makefile.in | 22 +------ bin/tests/optional/backtrace_test.c | 38 +----------- bin/tools/Makefile.in | 2 - lib/isc/Makefile.in | 9 ++- lib/isc/assertions.c | 14 +---- lib/isc/backtrace-emptytbl.c | 27 --------- lib/isc/backtrace.c | 77 ------------------------- lib/isc/include/isc/backtrace.h | 55 ------------------ lib/isc/include/isc/types.h | 12 ++-- lib/isc/win32/libisc.def.in | 4 -- lib/isc/win32/libisc.vcxproj.filters.in | 3 - lib/isc/win32/libisc.vcxproj.in | 1 - util/copyrights | 1 - 24 files changed, 18 insertions(+), 341 deletions(-) delete mode 100644 lib/isc/backtrace-emptytbl.c diff --git a/bin/check/Makefile.in b/bin/check/Makefile.in index c7f2f0f26d..9e8334968f 100644 --- a/bin/check/Makefile.in +++ b/bin/check/Makefile.in @@ -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 = diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in index c03183b145..2cd57c17ad 100644 --- a/bin/confgen/Makefile.in +++ b/bin/confgen/Makefile.in @@ -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 diff --git a/bin/delv/Makefile.in b/bin/delv/Makefile.in index 06743061b2..c0c1f4a219 100644 --- a/bin/delv/Makefile.in +++ b/bin/delv/Makefile.in @@ -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 = diff --git a/bin/dig/Makefile.in b/bin/dig/Makefile.in index f5f604c8db..b6c573cd56 100644 --- a/bin/dig/Makefile.in +++ b/bin/dig/Makefile.in @@ -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@ diff --git a/bin/dnssec/Makefile.in b/bin/dnssec/Makefile.in index 05fdb55df7..d26db1902f 100644 --- a/bin/dnssec/Makefile.in +++ b/bin/dnssec/Makefile.in @@ -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@ \ diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in index f66bc9a6e2..4e568e2999 100644 --- a/bin/named/Makefile.in +++ b/bin/named/Makefile.in @@ -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 diff --git a/bin/named/main.c b/bin/named/main.c index 603e8a1b5e..d7150c47bd 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -200,7 +200,6 @@ assertion_failed(const char *file, int line, isc_assertiontype_t type, int i, nframes; isc_result_t result; const char *logsuffix = ""; - const char *fname; /* * Handle assertion failures. @@ -224,27 +223,10 @@ assertion_failed(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) { - 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]); - } + isc_log_write( + named_g_lctx, NAMED_LOGCATEGORY_GENERAL, + NAMED_LOGMODULE_MAIN, ISC_LOG_CRITICAL, + "#%d %p in ??", i, tracebuf[i]); } } isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, @@ -974,36 +956,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 +1143,6 @@ setup(void) { NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE, "----------------------------------------------------"); - dump_symboltable(); - /* * Get the initial resource limits. */ diff --git a/bin/nsupdate/Makefile.in b/bin/nsupdate/Makefile.in index a4b99bddc7..a81ee91938 100644 --- a/bin/nsupdate/Makefile.in +++ b/bin/nsupdate/Makefile.in @@ -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@ diff --git a/bin/rndc/Makefile.in b/bin/rndc/Makefile.in index c5abfa6478..8eef2106d1 100644 --- a/bin/rndc/Makefile.in +++ b/bin/rndc/Makefile.in @@ -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} diff --git a/bin/tests/Makefile.in b/bin/tests/Makefile.in index 63659531cb..49a3d3aecb 100644 --- a/bin/tests/Makefile.in +++ b/bin/tests/Makefile.in @@ -22,12 +22,10 @@ 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@ diff --git a/bin/tests/optional/.gitignore b/bin/tests/optional/.gitignore index 4c0b637f36..0d89a8600c 100644 --- a/bin/tests/optional/.gitignore +++ b/bin/tests/optional/.gitignore @@ -1,5 +1,3 @@ /backtrace_test.dSYM/ /backtrace_test0.dSYM/ -/backtrace_test_nosymtbl -/backtrace_test_nosymtbl.dSYM/ /nsecify diff --git a/bin/tests/optional/Makefile.in b/bin/tests/optional/Makefile.in index ab5536d1d1..593610633a 100644 --- a/bin/tests/optional/Makefile.in +++ b/bin/tests/optional/Makefile.in @@ -24,12 +24,10 @@ 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 +42,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@ \ @@ -109,27 +106,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 - cp ${top_srcdir}/lib/isc/backtrace-emptytbl.c symtbl.c - #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 - cp ${top_srcdir}/lib/isc/backtrace-emptytbl.c symtbl.c - #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} diff --git a/bin/tests/optional/backtrace_test.c b/bin/tests/optional/backtrace_test.c index 728c0ca44b..5527835eee 100644 --- a/bin/tests/optional/backtrace_test.c +++ b/bin/tests/optional/backtrace_test.c @@ -16,16 +16,11 @@ #include #include -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 diff --git a/bin/tools/Makefile.in b/bin/tools/Makefile.in index 4ed360e4ea..adfda90b0d 100644 --- a/bin/tools/Makefile.in +++ b/bin/tools/Makefile.in @@ -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 = diff --git a/lib/isc/Makefile.in b/lib/isc/Makefile.in index 7876c511e2..abbaecb052 100644 --- a/lib/isc/Makefile.in +++ b/lib/isc/Makefile.in @@ -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} \ diff --git a/lib/isc/assertions.c b/lib/isc/assertions.c index 21ca21b638..cd5cda3b5f 100644 --- a/lib/isc/assertions.c +++ b/lib/isc/assertions.c @@ -97,7 +97,6 @@ default_callback(const char *file, int line, isc_assertiontype_t type, void *tracebuf[BACKTRACE_MAXFRAME]; int i, nframes; const char *logsuffix = "."; - const char *fname; isc_result_t result; result = isc_backtrace_gettrace(tracebuf, BACKTRACE_MAXFRAME, &nframes); @@ -110,18 +109,7 @@ default_callback(const char *file, int line, isc_assertiontype_t type, 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]); - } + fprintf(stderr, "#%d %p in ??\n", i, tracebuf[i]); } } fflush(stderr); diff --git a/lib/isc/backtrace-emptytbl.c b/lib/isc/backtrace-emptytbl.c deleted file mode 100644 index 7193666ff2..0000000000 --- a/lib/isc/backtrace-emptytbl.c +++ /dev/null @@ -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 - -LIBISC_EXTERNAL_DATA const int isc__backtrace_nsymbols = 0; -LIBISC_EXTERNAL_DATA const isc_backtrace_symmap_t isc__backtrace_symtable[] = { - { NULL, "" } -}; diff --git a/lib/isc/backtrace.c b/lib/isc/backtrace.c index d0a52ae364..aafff91b6a 100644 --- a/lib/isc/backtrace.c +++ b/lib/isc/backtrace.c @@ -221,80 +221,3 @@ isc_backtrace_gettrace(void **addrs, int maxaddrs, int *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); -} diff --git a/lib/isc/include/isc/backtrace.h b/lib/isc/include/isc/backtrace.h index c68c02a92b..a7a5ff0f7a 100644 --- a/lib/isc/include/isc/backtrace.h +++ b/lib/isc/include/isc/backtrace.h @@ -39,18 +39,6 @@ #include -/*** - *** 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 +65,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 */ diff --git a/lib/isc/include/isc/types.h b/lib/isc/include/isc/types.h index 9d2ad6c718..bcdc872867 100644 --- a/lib/isc/include/isc/types.h +++ b/lib/isc/include/isc/types.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 */ diff --git a/lib/isc/win32/libisc.def.in b/lib/isc/win32/libisc.def.in index 2b590f8a02..cab49519a0 100644 --- a/lib/isc/win32/libisc.def.in +++ b/lib/isc/win32/libisc.def.in @@ -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 diff --git a/lib/isc/win32/libisc.vcxproj.filters.in b/lib/isc/win32/libisc.vcxproj.filters.in index 188f0dbdb4..7a4d86b34e 100644 --- a/lib/isc/win32/libisc.vcxproj.filters.in +++ b/lib/isc/win32/libisc.vcxproj.filters.in @@ -461,9 +461,6 @@ Library Source Files - - Library Source Files - Library Source Files diff --git a/lib/isc/win32/libisc.vcxproj.in b/lib/isc/win32/libisc.vcxproj.in index c45883a5f3..b7079bbf6c 100644 --- a/lib/isc/win32/libisc.vcxproj.in +++ b/lib/isc/win32/libisc.vcxproj.in @@ -414,7 +414,6 @@ copy InstallFiles ..\Build\Release\ - diff --git a/util/copyrights b/util/copyrights index bff0ea4fc5..25d4c852ac 100644 --- a/util/copyrights +++ b/util/copyrights @@ -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 From e847591867cfe542c9e52d6176e0a2bb6e2ca875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Wed, 11 Mar 2020 09:55:48 +0100 Subject: [PATCH 4/4] Improve the backtrace to print symbols when backtrace_symbols() is available The previous commit removed the code related to the internal symbol table. On platforms where available, we can now use backtrace_symbols() to print more verbose symbols table to the output. As there's now general availability of backtrace() and backtrace_symbols() functions (see below), the commit also removes the usage of glibc internals and the custom stack tracing. * backtrace(), backtrace_symbols(), and backtrace_symbols_fd() are provided in glibc since version 2.1. * backtrace(), backtrace_symbols(), and backtrace_symbols_fd() first appeared in Mac OS X 10.5. * The backtrace() library of functions first appeared in NetBSD 7.0 and FreeBSD 10.0. --- bin/named/main.c | 14 ++- bin/tests/Makefile.in | 1 - bin/tests/optional/Makefile.in | 3 +- config.h.in | 15 +-- configure | 96 ++++++++++++----- configure.ac | 21 +--- lib/isc/assertions.c | 11 +- lib/isc/backtrace.c | 183 ++------------------------------ lib/isc/include/isc/backtrace.h | 4 + 9 files changed, 118 insertions(+), 230 deletions(-) diff --git a/bin/named/main.c b/bin/named/main.c index d7150c47bd..19875e2ce8 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -197,7 +197,7 @@ 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 = ""; @@ -222,12 +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++) { +#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, diff --git a/bin/tests/Makefile.in b/bin/tests/Makefile.in index 49a3d3aecb..dd3dddd438 100644 --- a/bin/tests/Makefile.in +++ b/bin/tests/Makefile.in @@ -18,7 +18,6 @@ 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} diff --git a/bin/tests/optional/Makefile.in b/bin/tests/optional/Makefile.in index 593610633a..b01bc5e04d 100644 --- a/bin/tests/optional/Makefile.in +++ b/bin/tests/optional/Makefile.in @@ -19,7 +19,6 @@ 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@ @@ -97,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} diff --git a/config.h.in b/config.h.in index 4d292f2950..463841adbc 100644 --- a/config.h.in +++ b/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 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 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 diff --git a/configure b/configure index 2f3a2ceb1b..063b660622 100755 --- a/configure +++ b/configure @@ -775,7 +775,6 @@ XTARGETS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG -BACKTRACECFLAGS CCNOOPT CCOPT STD_CWARNINGS @@ -920,7 +919,6 @@ with_json_c with_zlib with_purify with_gperftools_profiler -enable_backtrace enable_tcp_fastopen with_readline enable_isc_spnego @@ -1626,7 +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] --disable-tcp-fastopen disable TCP Fast Open support [default=yes] --disable-isc-spnego use SPNEGO from GSSAPI library --disable-chroot disable chroot @@ -12088,7 +12085,6 @@ fi - # # Use pkg-config # @@ -18681,42 +18677,88 @@ $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 + +/* 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 : + +else + 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 + +fi + +done + + +# AM_CONDITIONAL([HAVE_BACKTRACE], [test "$ac_cv_func_backtrace" = "yes"]) # # File name extension for static archive files, for those few places diff --git a/configure.ac b/configure.ac index 81bcc0ae51..0f051587b4 100644 --- a/configure.ac +++ b/configure.ac @@ -56,7 +56,6 @@ AC_SUBST(STD_CDEFINES) AC_SUBST(STD_CWARNINGS) AC_SUBST(CCOPT) AC_SUBST(CCNOOPT) -AC_SUBST(BACKTRACECFLAGS) # # Use pkg-config @@ -1425,23 +1424,13 @@ 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 ]], - [[return (backtrace((void **)0, 0));]] - )], - [AC_DEFINE([HAVE_LIBCTRACE], [1], [define if system have backtrace function])] - )]) +# AM_CONDITIONAL([HAVE_BACKTRACE], [test "$ac_cv_func_backtrace" = "yes"]) # # File name extension for static archive files, for those few places diff --git a/lib/isc/assertions.c b/lib/isc/assertions.c index cd5cda3b5f..c2ca5f46a1 100644 --- a/lib/isc/assertions.c +++ b/lib/isc/assertions.c @@ -95,7 +95,7 @@ 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 = "."; isc_result_t result; @@ -108,9 +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++) { +#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); } diff --git a/lib/isc/backtrace.c b/lib/isc/backtrace.c index aafff91b6a..54699200b6 100644 --- a/lib/isc/backtrace.c +++ b/lib/isc/backtrace.c @@ -13,51 +13,17 @@ #include #include -#ifdef HAVE_LIBCTRACE +#ifdef HAVE_BACKTRACE #include -#endif /* ifdef HAVE_LIBCTRACE */ +#endif /* HAVE_BACKTRACE */ #include #include #include -#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,154 +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 */ +#endif /* HAVE_BACKTRACE */ diff --git a/lib/isc/include/isc/backtrace.h b/lib/isc/include/isc/backtrace.h index a7a5ff0f7a..c59dca87b7 100644 --- a/lib/isc/include/isc/backtrace.h +++ b/lib/isc/include/isc/backtrace.h @@ -37,6 +37,10 @@ *** Imports ***/ +#if HAVE_BACKTRACE_SYMBOLS +#include +#endif /* HAVE_BACKTRACE_SYMBOLS */ + #include /***