Commit c4638089 authored by Ondřej Surý's avatar Ondřej Surý

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.
parent e19117b5
......@@ -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)"
......
......@@ -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)"
......
......@@ -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
......
#!/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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment