# HG changeset patch
# Parent a310ee31985e25bd0e53f4eaddd686e1cb21c5fd
Fix Solaris symbol versioning (PR libstdc++/52188, libstdc++/52189)
@@ -156,9 +156,6 @@ my $glob = 'glob';
# 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";
@@ -183,15 +180,6 @@ printf "# Omitted archives with correspo
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';
@@ -216,15 +204,6 @@ while (<F>) {
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; }
@@ -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'` \
@@ -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)
])
@@ -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
@@ -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
@@ -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
+ # 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 {
@@ -102,34 +102,29 @@ CXXLINK = $(LIBTOOL) --tag CXX $(AM_LIBT
if ENABLE_SYMVERS
libstdc++-symbols.ver: ${glibcxx_srcdir}/$(SYMVER_FILE) \
$(port_specific_symbol_files)
- cp ${glibcxx_srcdir}/$(SYMVER_FILE) ./libstdc++-symbols.ver
- chmod +w ./libstdc++-symbols.ver
+ cp ${glibcxx_srcdir}/$(SYMVER_FILE) $@.tmp
+ chmod +w $@.tmp
if test "x$(port_specific_symbol_files)" != x; then \
if grep '^# Appended to version file.' \
$(port_specific_symbol_files) /dev/null > /dev/null 2>&1; then \
- cat $(port_specific_symbol_files) >> $@; \
+ cat $(port_specific_symbol_files) >> $@.tmp; \
else \
- sed -n '1,/DO NOT DELETE/p' $@ > tmp.top; \
- sed -n '/DO NOT DELETE/,$$p' $@ > tmp.bottom; \
- cat tmp.top $(port_specific_symbol_files) tmp.bottom > $@; \
+ sed -n '1,/DO NOT DELETE/p' $@.tmp > tmp.top; \
+ sed -n '/DO NOT DELETE/,$$p' $@.tmp > tmp.bottom; \
+ cat tmp.top $(port_specific_symbol_files) tmp.bottom > $@.tmp; \
rm tmp.top tmp.bottom; \
fi; \
fi
+ $(EGREP) -v '#(#| |$$)' $@.tmp | \
+ $(COMPILE) -E -P -include config.h - > $@ || (rm -f $@ ; exit 1)
+ rm -f $@.tmp
CLEANFILES = libstdc++-symbols.ver
if ENABLE_SYMVERS_GNU
-if ENABLE_SYMVERS_SOL2
-version_arg = -Wl,--version-script,libstdc++-symbols.ver-sol2
-version_dep = libstdc++-symbols.ver-sol2
-libstdc++-symbols.ver-sol2 : libstdc++-symbols.ver
- sed -e '/^#ifdef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT/,/^#endif/d' $< \
- > $@ || (rm -f $@ ; exit 1)
-else
version_arg = -Wl,--version-script=libstdc++-symbols.ver
version_dep = libstdc++-symbols.ver
endif
-endif
if ENABLE_SYMVERS_GNU_NAMESPACE
version_arg = -Wl,--version-script=libstdc++-symbols.ver
version_dep = libstdc++-symbols.ver