This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[libstdc++] Tweak symbol versioning stuff,
- From: Phil Edwards <phil at jaj dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 11 Jul 2003 00:08:09 -0400
- Subject: [libstdc++] Tweak symbol versioning stuff,
This hodgepodge of minor tweaks relaxes the syntax on the gnu-style symbol
versioning file, tries to cope with oddball versions of sort(1) which pay
attention to the "wrong" environment variables, changes the port-specific
variable name to be grammatically correct, and adds AC_ warnings for when
the linker cannot correctly do symbol versioning.
There is still debate about what the minimum cutoff should be on the linker
version for symbol versioning in 3.4.
2003-07-11 Phil Edwards <pme@gcc.gnu.org>
* acinclude.m4 (GLIBCC_ENABLE_SYMVERS): Tweak comments. Add
warning messages if the environment cannot support symbol versioning.
(port_specific_symbol_file): It's plural, add an 's' on the end.
* configure.host: Likewise.
* src/Makefile.am: Likewise.
* config/linker-map.gnu: Remove one semicolon, heh.
* scripts/extract_symvers: Don't assume useful 'export' syntax.
Set LANG as well as LC_ALL for possibly-broken sort(1)s.
* aclocal.m4, configure, src/Makefile.in: Regenerated.
Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.255
diff -u -3 -p -r1.255 acinclude.m4
--- acinclude.m4 6 Jul 2003 20:30:55 -0000 1.255
+++ acinclude.m4 11 Jul 2003 04:00:23 -0000
@@ -2259,12 +2259,12 @@ if test $enable_symvers != no; then
AC_MSG_RESULT($glibcxx_shared_libgcc)
fi
-# For GNU ld, we need at least this version. It's 2.14 in the same format
-# as the tested-for version. See GLIBCXX_CHECK_LINKER_FEATURES for more.
+# For GNU ld, we need at least this version. The format is described in
+# GLIBCXX_CHECK_LINKER_FEATURES above.
glibcxx_min_gnu_ld_version=21400
-# Check to see if unspecified "yes" value can win, given results
-# above.
+# Check to see if unspecified "yes" value can win, given results above.
+# Change "yes" into either "no" or a style name.
if test $enable_symvers = yes ; then
if test $with_gnu_ld = yes &&
test $glibcxx_shared_libgcc = yes ;
@@ -2273,10 +2273,19 @@ if test $enable_symvers = yes ; then
enable_symvers=gnu
else
# The right tools, the right setup, but too old. Fallbacks?
+ AC_MSG_WARN(=== Linker version $glibcxx_gnu_ld_version is too old for)
+ AC_MSG_WARN(=== full symbol versioning support in this release of GCC.)
+ AC_MSG_WARN(=== You would need to upgrade your binutils to version)
+ AC_MSG_WARN(=== $glibcxx_min_gnu_ld_version or later and rebuild GCC.)
+ AC_MSG_WARN([=== Symbol versioning will be disabled.])
enable_symvers=no
fi
else
# just fail for now
+ AC_MSG_WARN([=== You have requested some kind of symbol versioning, but])
+ AC_MSG_WARN([=== either you are not using a supported linker, or you are])
+ AC_MSG_WARN([=== not building a shared libgcc_s (which is required).])
+ AC_MSG_WARN([=== Symbol versioning will be disabled.])
enable_symvers=no
fi
fi
@@ -2293,7 +2302,7 @@ case $enable_symvers in
esac
AC_SUBST(SYMVER_MAP)
-AC_SUBST(port_specific_symbol_file)
+AC_SUBST(port_specific_symbol_files)
AM_CONDITIONAL(GLIBCXX_BUILD_VERSIONED_SHLIB, test $enable_symvers != no)
AC_MSG_CHECKING([versioning on shared library symbols])
AC_MSG_RESULT($enable_symvers)
Index: configure.host
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.host,v
retrieving revision 1.13
diff -u -3 -p -r1.13 configure.host
--- configure.host 6 Jul 2003 04:07:31 -0000 1.13
+++ configure.host 11 Jul 2003 04:00:26 -0000
@@ -41,7 +41,7 @@
# the form '-Wl,blah'
# (defaults to empty in acinclude.m4)
#
-# port_specific_symbol_file
+# port_specific_symbol_files
# whitespace-seperated list of files containing
# additional symbols to export from the shared
# library, when symbol versioning is in use
Index: config/linker-map.gnu
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/linker-map.gnu,v
retrieving revision 1.43
diff -u -3 -p -r1.43 linker-map.gnu
--- config/linker-map.gnu 9 Jul 2003 20:58:32 -0000 1.43
+++ config/linker-map.gnu 11 Jul 2003 04:00:26 -0000
@@ -55,7 +55,7 @@ GLIBCXX_3.4 {
std::__num_base::_S_format_int*;
std::__num_base::_S_atoms_in;
std::__num_base::_S_atoms_out;
- std::__numpunct_cache*;
+ std::__numpunct_cache*
};
# Names not in an 'extern' block are mangled names.
Index: scripts/extract_symvers
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/scripts/extract_symvers,v
retrieving revision 1.1
diff -u -3 -p -r1.1 extract_symvers
--- scripts/extract_symvers 18 Jun 2003 01:52:08 -0000 1.1
+++ scripts/extract_symvers 11 Jul 2003 04:00:26 -0000
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of the GNU ISO C++ Library. This library is free
# software; you can redistribute it and/or modify it under the
@@ -45,7 +45,10 @@ if readelf --help | grep -- --wide > /de
fi
# This avoids weird sorting problems later.
-export LC_ALL=C
+LC_ALL=C
+export LC_ALL
+LANG=C
+export LANG
tmp=extract.$$
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/Makefile.am,v
retrieving revision 1.127
diff -u -3 -p -r1.127 Makefile.am
--- src/Makefile.am 9 Jul 2003 20:58:32 -0000 1.127
+++ src/Makefile.am 11 Jul 2003 04:00:26 -0000
@@ -37,14 +37,13 @@ toolexeclib_LTLIBRARIES = libstdc++.la
# Symbol versioning for shared libraries.
if GLIBCXX_BUILD_VERSIONED_SHLIB
-port_specific_symbol_file = @port_specific_symbol_file@
version_arg = -Wl,--version-script=libstdc++-symbol.ver
libstdc++-symbol.ver: ${glibcxx_srcdir}/@SYMVER_MAP@
cp ${glibcxx_srcdir}/@SYMVER_MAP@ ./libstdc++-symbol.ver
- if test "x${port_specific_symbol_file}" != x; then \
+ if test "x@port_specific_symbol_files@" != x; then \
sed -n '1,/DO NOT DELETE/p' $@ > tmp.top; \
sed -n '/DO NOT DELETE/,$$p' $@ > tmp.bottom; \
- cat tmp.top $(port_specific_symbol_file) tmp.bottom > $@; \
+ cat tmp.top @port_specific_symbol_file@ tmp.bottom > $@; \
rm tmp.top tmp.bottom; \
fi
else