Skip to content

Commit

Permalink
Fix Solaris symbol versioning (PR libstdc++/52188)
Browse files Browse the repository at this point in the history
	contrib:
	PR libstdc++/52188
	* make_sunver.pl: Remove #ifdef handling.

	libgomp:
	PR libstdc++/52188
	* acinclude.m4 (LIBGOMP_ENABLE_SYMVERS): Remove	symvers_renaming.
	Remove ENABLE_SYMVERS_SOL2.
	* configure: Regenerate.
	* Makefile.am [LIBGOMP_BUILD_VERSIONED_SHLIB] (comma): New variable.
	(PREPROCESS): New variable.
	(libgomp.ver): New target.
	[LIBGOMP_BUILD_VERSIONED_SHLIB &&
	LIBGOMP_BUILD_VERSIONED_SHLIB_GNU]: Remove
	LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2 handling.
	Use libgomp.ver.
	[LIBGOMP_BUILD_VERSIONED_SHLIB_SUN]: Use libgomp.ver, libgomp.ver-sun.
	* Makefile.in: Regenerate.

	libstdc++-v3:
	PR libstdc++/52188
	* acinclude.m4 (GLIBCXX_ENABLE_SYMVERS): Remove symvers_renaming.
	Remove ENABLE_SYMVERS_SOL2.
	* configure: Regenerate.
	* src/Makefile.am [ENABLE_SYMVERS] (libstdc++-symbols.ver):
	Postprocess mapfile.
	[ENABLE_SYMVERS_GNU]: Remove ENABLE_SYMVERS_SOL2 handling.
	* src/Makefile.in: Regenerate.

	* config/abi/pre/gnu.ver (GLIBCXX_3.4.5) [!__sun__ && !__svr4__]:
	Don't export
	_ZNSt19istreambuf_iteratorI[cw]St11char_traitsI[cw]EEppEv.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184598 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
ro committed Feb 27, 2012
1 parent becba2b commit fb6822c
Show file tree
Hide file tree
Showing 13 changed files with 111 additions and 136 deletions.
5 changes: 5 additions & 0 deletions contrib/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2012-02-27 Rainer Orth <[email protected]>

PR libstdc++/52188
* make_sunver.pl: Remove #ifdef handling.

2012-02-17 Doug Kwan <[email protected]>

* contrib/testsuite-management/validate_failures.py
Expand Down
21 changes: 0 additions & 21 deletions contrib/make_sunver.pl
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@
# We're currently inside `extern "C++"', which Sun ld doesn't understand.
my $in_extern = 0;

# We're currently inside a conditional section: just skip it.
my $in_ifdef = 0;

# The c++filt command to use. This *must* be GNU c++filt; the Sun Studio
# c++filt doesn't handle the GNU mangling style.
my $cxxfilt = $ENV{'CXXFILT'} || "c++filt";
Expand All @@ -183,15 +180,6 @@
print "#\n\n";

while (<F>) {
# End of skipped section.
if (/^[ \t]*\#endif/) {
$in_ifdef = 0;
next;
}

# Just skip a conditional section.
if ($in_ifdef) { next; }

# Lines of the form '};'
if (/^([ \t]*)(\}[ \t]*;[ \t]*)$/) {
$glob = 'glob';
Expand All @@ -216,15 +204,6 @@
print; next;
}

# Special comments that look like C preprocessor conditionals.
# Just skip the contents for now.
# FIXME: Allow passing in conditionals from the command line to really
# control the skipping.
if (/^[ \t]*\#ifdef/) {
$in_ifdef = 1;
next;
}

# Comment and blank lines
if (/^[ \t]*\#/) { print; next; }
if (/^[ \t]*$/) { print; next; }
Expand Down
16 changes: 16 additions & 0 deletions libgomp/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
2012-02-27 Rainer Orth <[email protected]>

PR libstdc++/52188
* acinclude.m4 (LIBGOMP_ENABLE_SYMVERS): Remove symvers_renaming.
Remove ENABLE_SYMVERS_SOL2.
* configure: Regenerate.
* Makefile.am [LIBGOMP_BUILD_VERSIONED_SHLIB] (comma): New variable.
(PREPROCESS): New variable.
(libgomp.ver): New target.
[LIBGOMP_BUILD_VERSIONED_SHLIB &&
LIBGOMP_BUILD_VERSIONED_SHLIB_GNU]: Remove
LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2 handling.
Use libgomp.ver.
[LIBGOMP_BUILD_VERSIONED_SHLIB_SUN]: Use libgomp.ver, libgomp.ver-sun.
* Makefile.in: Regenerate.

2012-02-14 Walter Lee <[email protected]>

* configure.tgt: Handle tilegx and tilepro.
Expand Down
28 changes: 14 additions & 14 deletions libgomp/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ toolexeclib_LTLIBRARIES = libgomp.la
nodist_toolexeclib_HEADERS = libgomp.spec

if LIBGOMP_BUILD_VERSIONED_SHLIB
# -Wc is only a libtool option.
comma = ,
PREPROCESS = $(subst -Wc$(comma), , $(COMPILE)) -E

libgomp.ver: $(top_srcdir)/libgomp.map
$(EGREP) -v '#(#| |$$)' $< | \
$(PREPROCESS) -P -include config.h - > $@ || (rm -f $@ ; exit 1)

if LIBGOMP_BUILD_VERSIONED_SHLIB_GNU
if LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2
libgomp_version_script = -Wl,--version-script,libgomp.map-sol2
libgomp_version_dep = libgomp.map-sol2
libgomp.map-sol2 : $(top_srcdir)/libgomp.map
sed -e '/^#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT/,/^#endif/d' $< \
> $@ || (rm -f $@ ; exit 1)
else
libgomp_version_script = -Wl,--version-script,$(top_srcdir)/libgomp.map
libgomp_version_dep = $(top_srcdir)/libgomp.map
endif
libgomp_version_script = -Wl,--version-script,libgomp.ver
libgomp_version_dep = libgomp.ver
endif
if LIBGOMP_BUILD_VERSIONED_SHLIB_SUN
libgomp_version_script = -Wl,-M,libgomp.map-sun
libgomp_version_dep = libgomp.map-sun
libgomp.map-sun : $(top_srcdir)/libgomp.map \
libgomp_version_script = -Wl,-M,libgomp.ver-sun
libgomp_version_dep = libgomp.ver-sun
libgomp.ver-sun : libgomp.ver \
$(top_srcdir)/../contrib/make_sunver.pl \
$(libgomp_la_OBJECTS) $(libgomp_la_LIBADD)
perl $(top_srcdir)/../contrib/make_sunver.pl \
$(top_srcdir)/libgomp.map \
libgomp.ver \
$(libgomp_la_OBJECTS:%.lo=.libs/%.o) \
`echo $(libgomp_la_LIBADD) | \
sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
Expand Down
25 changes: 14 additions & 11 deletions libgomp/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,16 @@ AM_CFLAGS = $(XCFLAGS)
AM_LDFLAGS = $(XLDFLAGS) $(SECTION_LDFLAGS) $(OPT_LDFLAGS)
toolexeclib_LTLIBRARIES = libgomp.la
nodist_toolexeclib_HEADERS = libgomp.spec

# -Wc is only a libtool option.
@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@comma = ,
@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@PREPROCESS = $(subst -Wc$(comma), , $(COMPILE)) -E
@LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE@libgomp_version_script =
@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_FALSE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_script = -Wl,--version-script,$(top_srcdir)/libgomp.map
@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_script = -Wl,--version-script,libgomp.map-sol2
@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_script = -Wl,-M,libgomp.map-sun
@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_script = -Wl,--version-script,libgomp.ver
@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_script = -Wl,-M,libgomp.ver-sun
@LIBGOMP_BUILD_VERSIONED_SHLIB_FALSE@libgomp_version_dep =
@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_FALSE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_dep = $(top_srcdir)/libgomp.map
@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_dep = libgomp.map-sol2
@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_dep = libgomp.map-sun
@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_dep = libgomp.ver
@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@libgomp_version_dep = libgomp.ver-sun
libgomp_version_info = -version-info $(libtool_VERSION)
libgomp_la_LDFLAGS = $(libgomp_version_info) $(libgomp_version_script) \
$(lt_host_flags)
Expand Down Expand Up @@ -1066,14 +1068,15 @@ uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \


vpath % $(strip $(search_path))
@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE@@[email protected] : $(top_srcdir)/libgomp.map
@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ sed -e '/^#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT/,/^#endif/d' $< \
@LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ > $@ || (rm -f $@ ; exit 1)
@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@[email protected] : $(top_srcdir)/libgomp.map \

@[email protected]: $(top_srcdir)/libgomp.map
@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ $(EGREP) -v '#(#| |$$)' $< | \
@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ $(PREPROCESS) -P -include config.h - > $@ || (rm -f $@ ; exit 1)
@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@[email protected] : libgomp.ver \
@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ $(top_srcdir)/../contrib/make_sunver.pl \
@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ $(libgomp_la_OBJECTS) $(libgomp_la_LIBADD)
@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ perl $(top_srcdir)/../contrib/make_sunver.pl \
@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ $(top_srcdir)/libgomp.map \
@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ libgomp.ver \
@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ $(libgomp_la_OBJECTS:%.lo=.libs/%.o) \
@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ `echo $(libgomp_la_LIBADD) | \
@LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBGOMP_BUILD_VERSIONED_SHLIB_TRUE@ sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
Expand Down
7 changes: 2 additions & 5 deletions libgomp/acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,12 @@ if test $enable_symvers != no ; then
# The Solaris 2 runtime linker doesn't support the GNU extension of
# binding the same symbol to different versions
solaris2*)
symvers_renaming=no ;;
;;
# Other platforms with GNU symbol versioning (GNU/Linux, more?) do.
*)
AC_DEFINE(HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT, 1,
[Define to 1 if the target runtime linker supports binding the same symbol to different versions.])
symvers_renaming=yes ;;
;;
esac
else
symvers_renaming=no
fi
AM_CONDITIONAL(LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2, test $symvers_renaming = no)
])
24 changes: 4 additions & 20 deletions libgomp/configure
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,6 @@ link_gomp
XLDFLAGS
XCFLAGS
config_path
LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_FALSE
LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE
LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_FALSE
LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE
LIBGOMP_BUILD_VERSIONED_SHLIB_GNU_FALSE
Expand Down Expand Up @@ -11082,7 +11080,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11085 "configure"
#line 11083 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
Expand Down Expand Up @@ -11188,7 +11186,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11191 "configure"
#line 11189 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
Expand Down Expand Up @@ -15994,27 +15992,17 @@ if test $enable_symvers != no ; then
# The Solaris 2 runtime linker doesn't support the GNU extension of
# binding the same symbol to different versions
solaris2*)
symvers_renaming=no ;;
;;
# Other platforms with GNU symbol versioning (GNU/Linux, more?) do.
*)

$as_echo "#define HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT 1" >>confdefs.h

symvers_renaming=yes ;;
;;
esac
else
symvers_renaming=no
fi
if test $symvers_renaming = no; then
LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE=
LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_FALSE='#'
else
LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE='#'
LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_FALSE=
fi



if test $enable_symvers = gnu; then

$as_echo "#define LIBGOMP_GNU_SYMBOL_VERSIONING 1" >>confdefs.h
Expand Down Expand Up @@ -16404,10 +16392,6 @@ if test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_SUN_TRUE}" && test -z "${LIBGOMP_BUI
as_fn_error "conditional \"LIBGOMP_BUILD_VERSIONED_SHLIB_SUN\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_TRUE}" && test -z "${LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2_FALSE}"; then
as_fn_error "conditional \"LIBGOMP_BUILD_VERSIONED_SHLIB_SOL2\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${USE_FORTRAN_TRUE}" && test -z "${USE_FORTRAN_FALSE}"; then
as_fn_error "conditional \"USE_FORTRAN\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
Expand Down
15 changes: 15 additions & 0 deletions libstdc++-v3/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
2012-02-27 Rainer Orth <[email protected]>

PR libstdc++/52188
* acinclude.m4 (GLIBCXX_ENABLE_SYMVERS): Remove symvers_renaming.
Remove ENABLE_SYMVERS_SOL2.
* configure: Regenerate.
* src/Makefile.am [ENABLE_SYMVERS] (libstdc++-symbols.ver):
Postprocess mapfile.
[ENABLE_SYMVERS_GNU]: Remove ENABLE_SYMVERS_SOL2 handling.
* src/Makefile.in: Regenerate.

* config/abi/pre/gnu.ver (GLIBCXX_3.4.5) [!__sun__ && !__svr4__]:
Don't export
_ZNSt19istreambuf_iteratorI[cw]St11char_traitsI[cw]EEppEv.

2012-02-25 John David Anglin <[email protected]>

PR testsuite/52201
Expand Down
7 changes: 2 additions & 5 deletions libstdc++-v3/acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3264,17 +3264,14 @@ if test $enable_symvers != no ; then
# The Solaris 2 runtime linker doesn't support the GNU extension of
# binding the same symbol to different versions
solaris2*)
symvers_renaming=no ;;
;;
# Other platforms with GNU symbol versioning (GNU/Linux, more?) do.
*)
AC_DEFINE(HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT, 1,
[Define to 1 if the target runtime linker supports binding the same symbol to different versions.])
symvers_renaming=yes ;;
;;
esac
else
symvers_renaming=no
fi
GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_SOL2, test $symvers_renaming = no)
# Now, set up compatibility support, if any.
# In addition, need this to deal with std::size_t mangling in
Expand Down
10 changes: 7 additions & 3 deletions libstdc++-v3/config/abi/pre/gnu.ver
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Linker script for GNU versioning (GNU ld 2.13.91+ only.)
##
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
## Free Software Foundation, Inc.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
## 2011, 2012 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
Expand Down Expand Up @@ -890,8 +890,12 @@ GLIBCXX_3.4.5 {

_ZNSt11char_traitsI[cw]E2eqERK[cw]S2_;

# Those template instantiations weren't exported on Solaris in GCC 4.6
# and aren't necessary for correct operation, so don't emit them now
# (PR libstdc++/52188).
#if !defined(__sun__) && !defined(__svr4__)
_ZNSt19istreambuf_iteratorI[cw]St11char_traitsI[cw]EEppEv;

#endif
} GLIBCXX_3.4.4;

GLIBCXX_3.4.6 {
Expand Down
Loading

0 comments on commit fb6822c

Please sign in to comment.