Skip to content

Commit 55f10c8

Browse files
author
ro
committed
config:
* gc++filt.m4: New file. contrib: * make_sunver.pl: New file. libstdc++v3: * acinclude.m4 (GLIBCXX_ENABLE_SYMVERS): Handle sun style. Require GCC_PROG_GNU_CXXFILT. (_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT): Define unless targetting solaris2*. Include ../config/gc++filt.m4. * configure.host (i?86-*-solaris2*): Set abi_baseline_pair. (sparc-*-solaris2*): Likewise. * src/Makefile.am [ENABLE_SYMVERS_SUN] (version_dep, version_arg): New variables. (libstdc++-symbols.ver-sun): New target. * configure: Regenerate. * config.h.in: Regenerate. * Makefile.in: Likewise. * doc/Makefile.in: Likewise. * include/Makefile.in: Likewise. * libsupc++/Makefile.in: Likewise. * po/Makefile.in: Likewise. * python/Makefile.in: Likewise. * src/Makefile.in: Likewise. * src/atomic.cc: Only define/use _GLIBCXX_ASM_SYMVER if _GLIBCXX_HAVE_SYMVER_RENAMING_RUNTIME_SUPPORT. * src/compatibility.cc: Likewise. * testsuite/Makefile.am (baseline_subdir): Define. (baseline_symbols): Use it. (new-abi-baseline): Likewise. * testsuite/Makefile.in: Regenerate. * config/abi/pre/gnu.ver (GLIBCXX_3.4.5): Enclose duplicates in #ifdef HAVE_SYMVER_RENAMING_RUNTIME_SUPPORT. (GLIBCXX_3.4.6): Likewise. * doc/xml/manual/configure.xml (--enable-symvers): Document sun style. * doc/xml/manual/abi.xml: Fix grammar. (Symbol versioning on the libstdc++.so binary): Fix mapfile path. (Incremental bumping of a library pre-defined macro): Fix c++config path. (Incremental bumping of a library pre-defined macro, _GLIBCPP_VERSION): Likewise. (Matching each specific C++ compiler release to a specific set of C++ include files): Fix acinclude.m4 path. (Prerequisites): Allow for Sun linker on Solaris 2.5+. Use proper link to Configuring. Fix acinclude.m4 path. (Checking Active): Allow for additional symbol versioning styles. Provide Solaris 2 example with pvs -r. (Bibliography): Update Linker and Libraries Guide, C++ Migration Guide entries. gcc: * doc/install.texi (Prerequisites): Document Perl requirement on Solaris 2. (Specific, *-*-solaris2*): Document GNU c++filt requirement. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161696 138bc75d-0d04-0410-961f-82ee72b054a4
1 parent beb5ec5 commit 55f10c8

File tree

23 files changed

+430
-52
lines changed

23 files changed

+430
-52
lines changed

config/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2010-07-02 Rainer Orth <[email protected]>
2+
3+
* gc++filt.m4: New file.
4+
15
2010-06-20 Alexandre Oliva <[email protected]>
26

37
* bootstrap-lto.mk: New.

contrib/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2010-07-02 Rainer Orth <[email protected]>
2+
3+
* make_sunver.pl: New file.
4+
15
2010-07-02 Iain Sandoe <[email protected]>
26

37
* compare-debug (Darwin): Remove '-x' flag from ld-based object

gcc/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2010-07-02 Rainer Orth <[email protected]>
2+
3+
* doc/install.texi (Prerequisites): Document Perl requirement on
4+
Solaris 2.
5+
(Specific, *-*-solaris2*): Document GNU c++filt requirement.
6+
17
2010-07-02 Richard Guenther <[email protected]>
28

39
PR middle-end/44777

gcc/doc/install.texi

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,13 @@ snapshots of the development sources are also available via FTP@.
456456
Necessary when regenerating @file{Makefile} dependencies in libiberty.
457457
Necessary when regenerating @file{libiberty/functions.texi}.
458458
Necessary when generating manpages from Texinfo manuals.
459-
Necessary when targetting Darwin, building libstdc++,
459+
Necessary when targetting Darwin, building @samp{libstdc++},
460460
and not using @option{--disable-symvers}.
461+
Necessary when targetting Solaris 2 with Sun @command{ld}, building
462+
@samp{libstdc++}, and not using @option{--disable-symvers}. A helper
463+
scripts needs @samp{Glob.pm}, which is missing from @command{perl} 5.005
464+
included in Solaris~8. The bundled @command{perl} in Solaris~9 and up
465+
works.
461466
Used by various scripts to generate some files included in SVN (mainly
462467
Unicode-related and rarely changing) from source tables.
463468

@@ -4109,6 +4114,12 @@ Solaris 10 cannot be used due to several bugs. Again, the current
41094114
version (2.20.1) is known to work, but generally lacks platform specific
41104115
features, so better stay with Sun @command{ld}.
41114116

4117+
To enable symbol versioning in @samp{libstdc++} with Sun @command{ld},
4118+
you need to have any version of GNU @command{c++filt}, which is part of
4119+
GNU binutils. @samp{libstdc++} symbol versioning will be disabled if no
4120+
appropriate version is found. Sun @command{c++filt} from the Sun Studio
4121+
compilers does @emph{not} work.
4122+
41124123
Sun bug 4296832 turns up when compiling X11 headers with GCC 2.95 or
41134124
newer: @command{g++} will complain that types are missing. These headers
41144125
assume that omitting the type means @code{int}; this assumption worked for

libstdc++-v3/ChangeLog

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,55 @@
1+
2010-07-02 Rainer Orth <[email protected]>
2+
3+
* acinclude.m4 (GLIBCXX_ENABLE_SYMVERS): Handle sun style.
4+
Require GCC_PROG_GNU_CXXFILT.
5+
(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT): Define
6+
unless targetting solaris2*.
7+
Include ../config/gc++filt.m4.
8+
* configure.host (i?86-*-solaris2*): Set abi_baseline_pair.
9+
(sparc-*-solaris2*): Likewise.
10+
* src/Makefile.am [ENABLE_SYMVERS_SUN] (version_dep, version_arg):
11+
New variables.
12+
(libstdc++-symbols.ver-sun): New target.
13+
* configure: Regenerate.
14+
* config.h.in: Regenerate.
15+
* Makefile.in: Likewise.
16+
* doc/Makefile.in: Likewise.
17+
* include/Makefile.in: Likewise.
18+
* libsupc++/Makefile.in: Likewise.
19+
* po/Makefile.in: Likewise.
20+
* python/Makefile.in: Likewise.
21+
* src/Makefile.in: Likewise.
22+
* src/atomic.cc: Only define/use _GLIBCXX_ASM_SYMVER if
23+
_GLIBCXX_HAVE_SYMVER_RENAMING_RUNTIME_SUPPORT.
24+
* src/compatibility.cc: Likewise.
25+
* testsuite/Makefile.am (baseline_subdir): Define.
26+
(baseline_symbols): Use it.
27+
(new-abi-baseline): Likewise.
28+
* testsuite/Makefile.in: Regenerate.
29+
30+
* config/abi/pre/gnu.ver (GLIBCXX_3.4.5): Enclose duplicates in
31+
#ifdef HAVE_SYMVER_RENAMING_RUNTIME_SUPPORT.
32+
(GLIBCXX_3.4.6): Likewise.
33+
34+
* doc/xml/manual/configure.xml (--enable-symvers): Document sun
35+
style.
36+
37+
* doc/xml/manual/abi.xml: Fix grammar.
38+
(Symbol versioning on the libstdc++.so binary): Fix mapfile path.
39+
(Incremental bumping of a library pre-defined macro): Fix
40+
c++config path.
41+
(Incremental bumping of a library pre-defined macro,
42+
_GLIBCPP_VERSION): Likewise.
43+
(Matching each specific C++ compiler release to a specific set of
44+
C++ include files): Fix acinclude.m4 path.
45+
(Prerequisites): Allow for Sun linker on Solaris 2.5+.
46+
Use proper link to Configuring.
47+
Fix acinclude.m4 path.
48+
(Checking Active): Allow for additional symbol versioning styles.
49+
Provide Solaris 2 example with pvs -r.
50+
(Bibliography): Update Linker and Libraries Guide, C++ Migration
51+
Guide entries.
52+
153
2010-06-29 Jason Merrill <[email protected]>
254

355
Enable implicitly declared move constructor/operator= (N3053).

libstdc++-v3/Makefile.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \
5757
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
5858
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/crossconfig.m4 \
5959
$(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \
60+
$(top_srcdir)/../config/gc++filt.m4 \
6061
$(top_srcdir)/../config/tls.m4 $(top_srcdir)/configure.ac
6162
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
6263
$(ACLOCAL_M4)
@@ -124,6 +125,7 @@ CTIME_CC = @CTIME_CC@
124125
CTIME_H = @CTIME_H@
125126
CXX = @CXX@
126127
CXXCPP = @CXXCPP@
128+
CXXFILT = @CXXFILT@
127129
CXXFLAGS = @CXXFLAGS@
128130
CYGPATH_W = @CYGPATH_W@
129131
C_INCLUDE_DIR = @C_INCLUDE_DIR@

libstdc++-v3/acinclude.m4

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,11 +2812,14 @@ AC_DEFUN([GLIBCXX_ENABLE_SYMVERS], [
28122812
28132813
GLIBCXX_ENABLE(symvers,$1,[=STYLE],
28142814
[enables symbol versioning of the shared library],
2815-
[permit yes|no|gnu|gnu-versioned-namespace|darwin|darwin-export])
2815+
[permit yes|no|gnu|gnu-versioned-namespace|darwin|darwin-export|sun])
28162816
28172817
# If we never went through the GLIBCXX_CHECK_LINKER_FEATURES macro, then we
28182818
# don't know enough about $LD to do tricks...
28192819
AC_REQUIRE([GLIBCXX_CHECK_LINKER_FEATURES])
2820+
# Sun style symbol versions needs GNU c++filt for make_sunver.pl to work
2821+
# with extern "C++" in version scripts.
2822+
AC_REQUIRE([GCC_PROG_GNU_CXXFILT])
28202823
28212824
# Turn a 'yes' into a suitable default.
28222825
if test x$enable_symvers = xyes ; then
@@ -2834,6 +2837,20 @@ if test x$enable_symvers = xyes ; then
28342837
case ${target_os} in
28352838
darwin*)
28362839
enable_symvers=darwin ;;
2840+
# Sun symbol versioning exists since Solaris 2.5.
2841+
solaris2.[[5-9]]* | solaris2.1[[0-9]]*)
2842+
# make_sunver.pl needs GNU c++filt to support extern "C++" in
2843+
# version scripts, so disable symbol versioning if none can be
2844+
# found.
2845+
if test -z "$ac_cv_path_CXXFILT"; then
2846+
AC_MSG_WARN([=== You have requested Sun symbol versioning, but])
2847+
AC_MSG_WARN([=== no GNU c++filt could be found.])
2848+
AC_MSG_WARN([=== Symbol versioning will be disabled.])
2849+
enable_symvers=no
2850+
else
2851+
enable_symvers=sun
2852+
fi
2853+
;;
28372854
*)
28382855
enable_symvers=no ;;
28392856
esac
@@ -2846,8 +2863,26 @@ if test x$enable_symvers = xdarwin-export ; then
28462863
enable_symvers=darwin
28472864
fi
28482865
2866+
# Check if 'sun' was requested on non-Solaris 2 platforms.
2867+
if test x$enable_symvers = xsun ; then
2868+
case ${target_os} in
2869+
solaris2*)
2870+
# All fine.
2871+
;;
2872+
*)
2873+
# Unlikely to work.
2874+
AC_MSG_WARN([=== You have requested Sun symbol versioning, but])
2875+
AC_MSG_WARN([=== you are not targetting Solaris 2.])
2876+
AC_MSG_WARN([=== Symbol versioning will be disabled.])
2877+
enable_symvers=no
2878+
;;
2879+
esac
2880+
fi
2881+
28492882
# Check to see if 'gnu' can win.
2850-
if test $enable_symvers = gnu || test $enable_symvers = gnu-versioned-namespace; then
2883+
if test $enable_symvers = gnu ||
2884+
test $enable_symvers = gnu-versioned-namespace ||
2885+
test $enable_symvers = sun; then
28512886
# Check to see if libgcc_s exists, indicating that shared libgcc is possible.
28522887
AC_MSG_CHECKING([for shared libgcc])
28532888
ac_save_CFLAGS="$CFLAGS"
@@ -2883,6 +2918,8 @@ changequote([,])dnl
28832918
AC_MSG_WARN([=== you are not building a shared libgcc_s.])
28842919
AC_MSG_WARN([=== Symbol versioning will be disabled.])
28852920
enable_symvers=no
2921+
elif test $with_gnu_ld != yes && test $enable_symvers = sun; then
2922+
: All interesting versions of Sun ld support sun style symbol versioning.
28862923
elif test $with_gnu_ld != yes ; then
28872924
# just fail for now
28882925
AC_MSG_WARN([=== You have requested GNU symbol versioning, but])
@@ -2922,6 +2959,11 @@ case $enable_symvers in
29222959
AC_DEFINE(_GLIBCXX_SYMVER_DARWIN, 1,
29232960
[Define to use darwin versioning in the shared library.])
29242961
;;
2962+
sun)
2963+
SYMVER_FILE=config/abi/pre/gnu.ver
2964+
AC_DEFINE(_GLIBCXX_SYMVER_SUN, 1,
2965+
[Define to use Sun versioning in the shared library.])
2966+
;;
29252967
esac
29262968
29272969
if test x$enable_symvers != xno ; then
@@ -2945,8 +2987,24 @@ GLIBCXX_CONDITIONAL(ENABLE_SYMVERS, test $enable_symvers != no)
29452987
GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_GNU, test $enable_symvers = gnu)
29462988
GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_GNU_NAMESPACE, test $enable_symvers = gnu-versioned-namespace)
29472989
GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_DARWIN, test $enable_symvers = darwin)
2990+
GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_SUN, test $enable_symvers = sun)
29482991
AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers)
29492992
2993+
if test $enable_symvers != no ; then
2994+
case ${target_os} in
2995+
# The Solaris 2 runtime linker doesn't support the GNU extension of
2996+
# binding the same symbol to different versions
2997+
solaris2*)
2998+
symvers_renaming=no ;;
2999+
# Other platforms with GNU symbol versioning (GNU/Linux, more?) do.
3000+
*)
3001+
AC_DEFINE(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT, 1,
3002+
[Define to 1 if the target runtime linker supports binding the same symbol to different versions.])
3003+
symvers_renaming=yes
3004+
esac
3005+
fi
3006+
GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_SOL2, test $symvers_renaming = no)
3007+
29503008
# Now, set up compatibility support, if any.
29513009
# In addition, need this to deal with std::size_t mangling in
29523010
# src/compatibility.cc. In a perfect world, could use
@@ -3083,5 +3141,6 @@ AC_DEFUN([AC_LC_MESSAGES], [
30833141
])
30843142

30853143
# Macros from the top-level gcc directory.
3144+
m4_include([../config/gc++filt.m4])
30863145
m4_include([../config/tls.m4])
30873146

libstdc++-v3/config.h.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,10 @@
691691
/* Define if gthreads library is available. */
692692
#undef _GLIBCXX_HAS_GTHREADS
693693

694+
/* Define to 1 if the target runtime linker supports binding the same symbol
695+
to different versions. */
696+
#undef _GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
697+
694698
/* Define to 1 if a full hosted library is built, or 0 if freestanding. */
695699
#undef _GLIBCXX_HOSTED
696700

@@ -724,6 +728,9 @@
724728
/* Define to use GNU namespace versioning in the shared library. */
725729
#undef _GLIBCXX_SYMVER_GNU_NAMESPACE
726730

731+
/* Define to use Sun versioning in the shared library. */
732+
#undef _GLIBCXX_SYMVER_SUN
733+
727734
/* Define if C99 functions or macros from <wchar.h>, <math.h>, <complex.h>,
728735
<stdio.h>, and <stdlib.h> can be used or exposed. */
729736
#undef _GLIBCXX_USE_C99

libstdc++-v3/config/abi/pre/gnu.ver

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,7 @@ GLIBCXX_3.4 {
740740
sqrtl;
741741
copysignf;
742742

743+
#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
743744
# GLIBCXX_ABI compatibility only.
744745
# std::string
745746
_ZNKSs11_M_disjunctEPKc;
@@ -767,6 +768,7 @@ GLIBCXX_3.4 {
767768
_ZNSt11char_traitsI[cw]E2eqERK[cw]S2_;
768769

769770
_ZNSt19istreambuf_iteratorI[cw]St11char_traitsI[cw]EEppEv;
771+
#endif
770772

771773
# std::locale::Impl _M_ members
772774
_ZNSt6locale5_Impl16_M_install_facetEPKNS_2idEPKNS_5facetE;
@@ -875,7 +877,9 @@ GLIBCXX_3.4.6 {
875877

876878
_ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE9showmanycEv;
877879

880+
#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT
878881
_ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv;
882+
#endif
879883

880884
_ZN9__gnu_cxx6__poolILb1EE13_M_initializeEv;
881885

0 commit comments

Comments
 (0)