This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Support Sun symbol versioning in libstdc++-v3


It had been long on my agenda to support symbol versioning in libstdc++
with the Sun linker (where all this symbol versioning originated back
during the Solaris 2 ABI program in Solaris 2.5).

Upon closer investigation, there proved to be a couple of obstacles:

* Unlike GNU ld's --version-script option, Sun ld uses -M to specify any
  kind of linker map, while GNU ld uses -M (without an argument) to
  print a map file.  That's the trivial part.

* There are several GNU extensions to the versioning part of the mapfile
  syntax, which are used heavily in the libstdc++ mapfile and several
  others throughout the tree:

** GNU ld allows the use of wildcards to put symbols into versions.
   Recently, even the GNU ld maintainers seem to have come to the
   conclusion that this isn't a really smart idea: specifying a stable
   interface doesn't match with wildcards, and a corresponding warning
   shows up in the GNU ld 2.20 manual (3.9 VERSION Command, p.64).  I
   talked to the Sun linker maintainers about this issue, and they
   agreed that they don't really consider adding this feature to their
   implementation for exactly that reason.

** GNU ld supports specifying demangled symbols, currently for C++ and
   Java.  Since the mangling used is different between Sun CC and g++,
   this is unlikely to be supported in Sun ld any time soon, though one
   could envison a GNU demangling plugin for the Sun tools.  Given that
   the libstdc++ mapfiles use a combination of wildcards and mangled
   symbols, this is unlikely to be useful, though.

** Probably as a consequence of the wildcard support, there's an
   important semantic difference between adding a symbol to a version
   between the two linkers: with Sun ld, this is the equivalent of
   running ld -u <symbol>, while GNU ld simply ignores such a symbol if
   it isn't present in the object files.

** Last but not least, Sun ld chokes if the same symbol is present in
   two different versions.  GNU ld simply adds such a symbol into the
   oldest version in an inheritance chain, so I cannot see what the
   point would be listing it twice in the first place.

** The only case where this might make sense is in the presence of
   .symver symbol renaming, where different underlying symbols are bound
   to the same symbol in different versions.  Again, this is a GNU
   extension which we're unlikely to see in Sun ld: the maintainers
   state that so far they have been lucky enough not to need something
   like this, though I'd claim that the Solaris ARC review process sort
   of makes it harder for snafus to creep in.

Fortunately, while this list seems extensive, it didn't prove to be a
serious problem.  On the one hand, there's support for creating an
export map on Darwin, using the scripts/make_exports.pl script which
parses both the version map and the nm -P output of the object files to
be linked and does all the wildcard matching and mangling.  With that
script as a template, I could relatively quickly create a new one
(contrib/make_sunver.pl), which does a similar job, emitting a Sun style
version map which matches the GNU one with all the wildcards expanded
and the mangling undone.  Apart from missing autodetection of an
appropriate c++filt (the GNU one works, the Sun version from their
Studio compilers obviously not), the script allowed me to apply Sun
symbol versioning to all libraries in GCC that already support GNU style
versioning :-)  I had to perform some refinements in the process, but
they are all included in the script below.

With those comments, the patch below should be pretty obvious.

I've tested it with a i386-pc-solaris2.11 bootstrap with Sun ld,
comparing the version information in the resulting libstdc++.so.6 with
the one produced by GNU ld, using gas in both cases.  There were two
groups of differences:

* In the pvs -dsvo output, the library created with Sun ld has those
  symbols bound to the base version:

libstdc++.so -	libstdc++.so.6: _DYNAMIC;
libstdc++.so -	libstdc++.so.6: _GLOBAL_OFFSET_TABLE_;
libstdc++.so -	libstdc++.so.6: _PROCEDURE_LINKAGE_TABLE_;
libstdc++.so -	libstdc++.so.6: _edata;
libstdc++.so -	libstdc++.so.6: _end;
libstdc++.so -	libstdc++.so.6: _etext;

  This is a documented requirement of the Solaris 2 ABI, and I've got a
  binutils patch ready to implement this.

* The only symbols missing from the Sun ld created library are those
  using symbol renaming with gas' .symver directive.  Since this doesn't
  work with Sun ld, there's a configure test to disable it and the
  symbols are thus missing.  I don't yet know how to deal with this:
  having the same version name include different symbols depending on
  the linker used isn't exactly a brilliant idea.

  I think it's best to disable this wholesale, even with GNU ld.  I've
  performed the following little experiment that proves that it doesn't
  work under any circumstances, so it serves no useful purpose, and the
  Sun linker maintainers have stated they have no intention of
  supporting this any time soon, neither in ld nor in ld.so.1.  This has
  the pleasant side effect that there will be no difference in symbol
  versions irrespective of the linker used.

  So here's the experiment:

$ cat libfunc.c
#include <stdio.h>

void
func_10 (void)
{
  printf ("FUNC_1.0\n");
}

void
func_20 (void)
{
  printf ("FUNC_2.0\n");
}

__asm__ (".symver func_10, func@FUNC_1.0");
__asm__ (".symver func_20, func@@FUNC_2.0");
$ cat libfunc.ver
FUNC_1.0 {
  global:
    func;
  local:
    *;
};

FUNC_2.0 {
  global:
    func;
  local:
    *;
} FUNC_1.0;
# This is a gcc built with both gas and gld
$ gcc -shared -static-libgcc -Wl,--version-script,libfunc.ver -h libfunc.so.1 -o libfunc.so.1 libfunc.c
$ pvs -dsv libfunc.so.1
        libfunc.so.1 [BASE]:
        FUNC_1.0:
                FUNC_1.0;
        FUNC_2.0:               {FUNC_1.0}:
                func;
                FUNC_2.0;
# As you can see, func is *not* present in FUNC_1.0, although it should.
$ cat func.c
extern void func ();

int
main (void)
{
  func ();
  return 0;
}

#ifdef __GNUC__
#ifdef FUNC_10
__asm__ (".symver func, func@FUNC_1.0");
#endif
#ifdef FUNC_20
__asm__ (".symver func, func@FUNC_2.0");
#endif
#endif
$ gcc -L. -R. -DFUNC_10 -o func10-gcc func.c -lfunc
# The binary binds to FUNC_1.0 in libfunc.so.1.
$ pvs -r func10-gcc
        libfunc.so.1 (FUNC_1.0);
        libc.so.1 (SUNWprivate_1.1, SYSVABI_1.3);
# But still runs the default version of func.
$ ./func10-gcc
FUNC_2.0
$ gcc -L. -R. -DFUNC_20 -o func20-gcc func.c -lfunc
$ pvs -r func20-gcc
        libfunc.so.1 (FUNC_2.0);
        libc.so.1 (SUNWprivate_1.1, SYSVABI_1.3);
$ ./func20-gcc
FUNC_2.0
# Try with cc and ld instead, controlling with a linker map which
# version to bind to.
$ cat func10.map
libfunc.so - FUNC_1.0;
$ cc -L. -R. -M func10.map -o func10-cc func.c -lfunc
Undefined                       first referenced
 symbol                             in file
func                                func.o  (symbol belongs to unavailable version ./libfunc.so (FUNC_2.0))
ld: fatal: symbol referencing errors. No output written to func10-cc
$ cat func20.map 
libfunc.so - FUNC_2.0;
$ pvs -r func20-cc
        libfunc.so.1 (FUNC_2.0);
        libc.so.1 (SUNWprivate_1.1, SYSVABI_1.3);
$ ./func20-cc
FUNC_2.0

I'll provide a patch to disable GNU style symbol renaming on Solaris 2
(at least libgomp and libstdc++ use it) in the future, based on this
experiment.

After that manual comparison, I've created a baseline with GNU ld and
run a make check-abi with the Sun ld tree against it, again finding the
expected differences.  I haven't yet included the baseline_symbols.txt
files here, since I don't know what differences to expect between the
various supported Solaris 2 releases.  I'll bootstrap on Solaris 8 to 11
soon and compare what I get there.  While I'm setting abi_baseline_pair
for i?86-*-solaris2* and sparc*-*-solaris2* in configure.host already,
this is expected to change.

Another minor fix included in the patch below is multilib support for
the testsuite new-abi-baseline target.

This is most likely 4.6 material.  Two questions at this point: 

* I've put the make_sunver.pl script into the toplevel contrib
  directory, though one could argue that it belongs into config instead.
  The script will be used in several subsequent patches to add Sun
  symbol versioning support to other target libraries.  Suggestions?

* I think the documentation in abi.xml will need updating.  I'll
  probably tackle this at a later time.

Ok for mainline once 4.5 has branched?

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2010-02-19  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	contrib:
	* make_sunver.pl: New file.

	libstdc++v3:
	* acinclude.m4 (GLIBCXX_ENABLE_SYMVERS): Handle sun style.
	* 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.
	* src/Makefile.in: Likewise.

	* config/abi/pre/gnu.ver (GLIBCXX_3.4.5): Remove duplicates.
	(GLIBCXX_3.4.6): Likewise.

diff -r 725b27510017 -r 849c40f2bbfa contrib/make_sunver.pl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/make_sunver.pl	Tue Feb 23 23:26:18 2010 +0100
@@ -0,0 +1,223 @@
+#!/usr/bin/perl -w
+
+# make_sunver.pl
+#
+# This script takes at least two arguments, a GNU style version script and
+# a list of object and archive files, and generates a corresponding Sun
+# style version script as follows:
+#
+# Each glob pattern, C++ mangled pattern or literal in the input script is
+# matched against all global symbols in the input objects, emitting those
+# that matched (or nothing if no match was found).
+# A comment with the original pattern and its type is left in the output
+# file to make it easy to understand the matches.
+#
+# It expects a 'nm' with the POSIX '-P' option, but everyone has one of
+# those, right?
+# It depends on the GNU version of c++filt, since it must understand the
+# GNU mangling style.
+
+use File::Glob ':glob';
+use FileHandle;
+use IPC::Open2;
+
+# Input version script, GNU style.
+my $symvers = shift;
+
+##########
+# Get all the symbols from the library, match them, and add them to a hash.
+
+my %sym_hash = ();
+
+# List of objects and archives to process.
+my @OBJECTS = ();
+
+# List of shared objects to omit from processing.
+my @SHAREDOBJS = ();
+
+# Filter out those input archives that have corresponding shared objects to
+# avoid adding all symbols matched in the archive to the output map.
+foreach $file (@ARGV) {
+    if (($so = $file) =~ s/\.a$/.so/ && -e $so) {
+	printf STDERR "omitted $file -> $so\n";
+	push (@SHAREDOBJS, $so);
+    } else {
+	push (@OBJECTS, $file);
+    }
+}
+
+# The nm command to use.
+my $nm = $ENV{'NM_FOR_TARGET'} || "nm";
+
+# Process each symbol.
+open NM,$nm.' -P '.(join ' ',@OBJECTS).'|' or die $!;
+while (<NM>) {
+    my $i;
+    chomp;
+
+    # nm prints out stuff at the start, ignore it.
+    next if (/^$/);
+    next if (/:$/);
+    # Ignore undefined and local symbols.  The symbol name is optional; Sun
+    # nm emits none for local or .bss symbols.
+    next if (/^([^ ]+)?[ \t]+[Ua-z][ \t]+ /);
+
+    # $sym is the name of the symbol.
+    die "unknown nm output $_" if (! /^([^ ]+)[ \t]+[A-Z][ \t]+/);
+    my $sym = $1;
+
+    # Remember symbol.
+    $sym_hash{$sym}++;
+}
+close NM or die "nm error";
+
+##########
+# The various types of glob patterns.
+#
+# A glob pattern that is to be applied to the demangled name: 'cxx'.
+# A glob patterns that applies directly to the name in the .o files: 'glob'.
+# This pattern is ignored; used for local variables (usually just '*'): 'ign'.
+
+# The type of the current pattern.
+my $glob = 'glob';
+
+# We're currently inside `extern "C++"', which Sun ld doesn't understand.
+my $in_extern = 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.
+# FIXME: Provide autoconf magic to detect the correct command.
+my $cxxfilt = $ENV{'CXXFILT_FOR_TARGET'} || "gc++filt";
+
+open F,$symvers or die $!;
+
+# Print information about generating this file
+print "# This file was generated by make_sunver.pl.  DO NOT EDIT!\n";
+print "# It was generated by:\n";
+printf "# %s %s %s\n", $0, $symvers, (join ' ',@ARGV);
+printf "# Omitted archives with corresponding shared libraries: %s\n",
+    (join ' ', @SHAREDOBJS) if $#SHAREDOBJS >= 0;
+print "#\n\n";
+
+while (<F>) {
+    # Lines of the form '};'
+    if (/^([ \t]*)(\}[ \t]*;[ \t]*)$/) {
+	$glob = 'glob';
+	if ($in_extern) {
+	    $in_extern--;
+	    print "$1##$2";
+	} else {
+	    print;
+	}
+	next;
+    }
+
+    # Lines of the form '} SOME_VERSION_NAME_1.0;'
+    if (/^[ \t]*\}[ \tA-Z0-9_.a-z]+;[ \t]*$/) {
+	$glob = 'glob';
+	print; next;
+    }
+
+    # Comment and blank lines
+    if (/^[ \t]*\#/) { print; next; }
+    if (/^[ \t]*$/) { print; next; }
+
+    # Lines of the form '{'
+    if (/^([ \t]*){$/) {
+	if ($in_extern) {
+	    print "$1##{\n";
+	} else {
+	    print;
+	}
+	next;
+    }
+
+    # Lines of the form 'SOME_VERSION_NAME_1.1 {'
+    if (/^[A-Z0-9_. \t]+{$/) { print; next; }
+
+    # Ignore 'global:'
+    if (/^[ \t]*global:$/) { print; next; }
+
+    # After 'local:', globs should be ignored, they won't be exported.
+    if (/^[ \t]*local:$/) {
+	$glob = 'ign';
+	print;
+	next;
+    }
+
+    # After 'extern "C++"', globs are C++ patterns
+    if (/^([ \t]*)(extern \"C\+\+\"[ \t]*)$/) {
+	$in_extern++;
+	$glob = 'cxx';
+	# Need to comment, Sun ld cannot handle this.
+	print "$1##$2\n"; next;
+    }
+
+    # Chomp newline now we're done with passing through the input file.
+    chomp;
+
+    # Catch globs.  Note that '{}' is not allowed in globs by this script,
+    # so only '*' and '[]' are available.
+    if (/^([ \t]*)([^ \t;{}#]+);?[ \t]*$/) {
+	my $ws = $1;
+	my $ptn = $2;
+	# Turn the glob into a regex by replacing '*' with '.*'.
+	# Keep $ptn so we can still print the original form.
+	($pattern = $ptn) =~ s/\*/\.\*/g;
+
+	if ($glob eq 'ign') {
+	    # We're in a local: * section; just continue.
+	    print "$_\n";
+	    next;
+	}
+
+	# Print the glob commented for human readers.
+	print "$ws##$ptn ($glob)\n";
+
+	# Talk to c++filt through a pair of file descriptors.
+	# Need to start a fresh instance per pattern, otherwise the
+	# process grows to 500+ MB.
+	my $pid = open2(*FILTIN, *FILTOUT, $cxxfilt) or die $!;
+
+	my %ptn_syms = ();
+	my %dem_syms = ();
+
+	# Match ptn against symbols in %sym_hash.
+	foreach my $sym (keys %sym_hash) {
+	    if ($glob eq 'glob') {
+		# Maybe it matches one of the patterns based on the symbol in
+		# the .o file.
+		$ptn_syms{$sym}++ if ($sym =~ /^$pattern$/);
+	    }
+
+	    if ($glob eq 'cxx') {
+		# No?  Well, maybe its demangled form matches one of those
+		# patterns.
+		printf FILTOUT "%s\n",$sym;
+		my $dem = <FILTIN>;
+		chomp $dem;
+		$dem_syms{$sym}++ if ($dem =~ /^$pattern$/);
+
+	    }
+	    # No?  Well, then ignore it.
+	}
+
+	foreach my $sym (sort keys(%ptn_syms)) {
+	    print "$ws$sym;\n";
+	}
+	foreach my $sym (sort keys(%dem_syms)) {
+	    print "$ws$sym;\n";
+	}
+
+	close FILTOUT or die "c++filt error";
+	close FILTIN or die "c++filt error";
+	# Need to wait for the c++filt process to avoid lots of zombies.
+	waitpid $pid, 0;
+
+	next;
+    }
+    # Important sanity check.  This script can't handle lots of formats
+    # that GNU ld can, so be sure to error out if one is seen!
+    die "strange line `$_'";
+}
+close F;
diff -r 725b27510017 -r 849c40f2bbfa libstdc++-v3/acinclude.m4
--- a/libstdc++-v3/acinclude.m4	Fri Feb 19 10:00:04 2010 +0100
+++ b/libstdc++-v3/acinclude.m4	Tue Feb 23 23:26:18 2010 +0100
@@ -2834,7 +2834,7 @@
 
 GLIBCXX_ENABLE(symvers,$1,[=STYLE],
   [enables symbol versioning of the shared library],
-  [permit yes|no|gnu|gnu-versioned-namespace|darwin|darwin-export])
+  [permit yes|no|gnu|gnu-versioned-namespace|darwin|darwin-export|sun])
 
 # If we never went through the GLIBCXX_CHECK_LINKER_FEATURES macro, then we
 # don't know enough about $LD to do tricks...
@@ -2856,6 +2856,10 @@
       case ${target_os} in
         darwin*)
 	  enable_symvers=darwin ;;
+	solaris2*)
+	  # Sun symbol versioning exists since at least Solaris 2.5, so for
+	  # our purposes, for all supported Solaris 2 releases.
+	  enable_symvers=sun ;;
         *)
           enable_symvers=no ;;
       esac
@@ -2868,8 +2872,26 @@
     enable_symvers=darwin
 fi
 
+# Check if 'sun' was requested on non-Solaris 2 platforms.
+if test x$enable_symvers = xsun ; then
+  case ${target_os} in
+    solaris2*)
+      # All fine.
+      ;;
+    *)
+      # Unlikely to work.
+      AC_MSG_WARN([=== You have requested Sun symbol versioning, but])
+      AC_MSG_WARN([=== you are not targetting Solaris 2.])
+      AC_MSG_WARN([=== Symbol versioning will be disabled.])
+      enable_symvers=no
+      ;;
+  esac
+fi
+
 # Check to see if 'gnu' can win.
-if test $enable_symvers = gnu || test $enable_symvers = gnu-versioned-namespace; then
+if test $enable_symvers = gnu || 
+  test $enable_symvers = gnu-versioned-namespace || 
+  test $enabled_symves = sun; then
   # Check to see if libgcc_s exists, indicating that shared libgcc is possible.
   AC_MSG_CHECKING([for shared libgcc])
   ac_save_CFLAGS="$CFLAGS"
@@ -2905,6 +2927,8 @@
       AC_MSG_WARN([=== you are not building a shared libgcc_s.])
       AC_MSG_WARN([=== Symbol versioning will be disabled.])
       enable_symvers=no
+  elif test $with_gnu_ld != yes && test $enable_symvers = sun; then
+    : All interesting versions of Sun ld support sun style symbol versioning.
   elif test $with_gnu_ld != yes ; then
     # just fail for now
     AC_MSG_WARN([=== You have requested GNU symbol versioning, but])
@@ -2944,6 +2968,11 @@
     AC_DEFINE(_GLIBCXX_SYMVER_DARWIN, 1, 
               [Define to use darwin versioning in the shared library.])
     ;;
+  sun)
+    SYMVER_FILE=config/abi/pre/gnu.ver
+    AC_DEFINE(_GLIBCXX_SYMVER_SUN, 1, 
+              [Define to use Sun versioning in the shared library.])
+    ;;
 esac
 
 if test x$enable_symvers != xno ; then
@@ -2967,6 +2996,7 @@
 GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_GNU, test $enable_symvers = gnu)
 GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_GNU_NAMESPACE, test $enable_symvers = gnu-versioned-namespace)
 GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_DARWIN, test $enable_symvers = darwin)
+GLIBCXX_CONDITIONAL(ENABLE_SYMVERS_SUN, test $enable_symvers = sun)
 AC_MSG_NOTICE(versioning on shared library symbols is $enable_symvers)
 
 # Now, set up compatibility support, if any.
diff -r 725b27510017 -r 849c40f2bbfa libstdc++-v3/config/abi/pre/gnu.ver
--- a/libstdc++-v3/config/abi/pre/gnu.ver	Fri Feb 19 10:00:04 2010 +0100
+++ b/libstdc++-v3/config/abi/pre/gnu.ver	Tue Feb 23 23:26:18 2010 +0100
@@ -721,33 +721,6 @@
     copysignf;
 
    # GLIBCXX_ABI compatibility only.
-    # std::string
-    _ZNKSs11_M_disjunctEPKc;
-    _ZNKSs15_M_check_lengthE[jmy][jmy]PKc;
-    _ZNSs4_Rep26_M_set_length_and_sharableE*;
-    _ZNSs7_M_copyEPcPKc[jmy];
-    _ZNSs7_M_moveEPcPKc[jmy];
-    _ZNSs9_M_assignEPc[jmy]c;
-
-    # std::wstring
-    _ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw;
-    _ZNKSbIwSt11char_traitsIwESaIwEE15_M_check_lengthE[jmy][jmy]PKc;
-    _ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableE*;
-    _ZNSbIwSt11char_traitsIwESaIwEE7_M_copyEPwPKw[jmy];
-    _ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKw[jmy];
-    _ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPw[jmy]w;
-
-    _ZNKSt13basic_fstreamI[cw]St11char_traitsI[cw]EE7is_openEv;
-    _ZNKSt14basic_ifstreamI[cw]St11char_traitsI[cw]EE7is_openEv;
-    _ZNKSt14basic_ofstreamI[cw]St11char_traitsI[cw]EE7is_openEv;
-
-    _ZNSi6ignoreE[ilvx];
-    _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreE[ilvx];
-
-    _ZNSt11char_traitsI[cw]E2eqERK[cw]S2_;
-
-    _ZNSt19istreambuf_iteratorI[cw]St11char_traitsI[cw]EEppEv;
-
     # std::locale::Impl _M_ members
     _ZNSt6locale5_Impl16_M_install_facetEPKNS_2idEPKNS_5facetE;
     _ZNSt6locale5_Impl16_M_replace_facetEPKS0_PKNS_2idE;
@@ -855,8 +828,6 @@
 
     _ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE9showmanycEv;
 
-    _ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv;
-
     _ZN9__gnu_cxx6__poolILb1EE13_M_initializeEv;
 
 } GLIBCXX_3.4.5;
diff -r 725b27510017 -r 849c40f2bbfa libstdc++-v3/configure.host
--- a/libstdc++-v3/configure.host	Fri Feb 19 10:00:04 2010 +0100
+++ b/libstdc++-v3/configure.host	Tue Feb 23 23:26:18 2010 +0100
@@ -323,7 +323,13 @@
 	;;
     esac
     ;;
+  i?86-*-solaris2*)
+    abi_baseline_pair=i386-solaris2
+    ;;
   powerpc*-*-darwin*)
     port_specific_symbol_files="\$(srcdir)/../config/os/bsd/darwin/ppc-extra.ver"
     ;;
+  sparc*-*-solaris2*)
+    abi_baseline_pair=sparc-solaris2
+    ;;
 esac
diff -r 725b27510017 -r 849c40f2bbfa libstdc++-v3/src/Makefile.am
--- a/libstdc++-v3/src/Makefile.am	Fri Feb 19 10:00:04 2010 +0100
+++ b/libstdc++-v3/src/Makefile.am	Tue Feb 23 23:26:18 2010 +0100
@@ -53,6 +53,19 @@
 version_arg = -Wl,--version-script=libstdc++-symbols.ver
 version_dep = libstdc++-symbols.ver
 endif
+if ENABLE_SYMVERS_SUN
+version_arg = -Wl,-M,libstdc++-symbols.ver-sun
+version_dep = libstdc++-symbols.ver-sun
+libstdc++-symbols.ver-sun : libstdc++-symbols.ver \
+		$(toplevel_srcdir)/contrib/make_sunver.pl \
+		$(libstdc___la_OBJECTS) $(libstdc___la_LIBADD)
+	perl $(toplevel_srcdir)/contrib/make_sunver.pl \
+	  libstdc++-symbols.ver \
+	  $(libstdc___la_OBJECTS:%.lo=.libs/%.o) \
+	 `echo $(libstdc___la_LIBADD) | \
+	    sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+	 > $@ || (rm -f $@ ; exit 1)
+endif
 if ENABLE_SYMVERS_DARWIN
 version_arg = -Wl,-exported_symbols_list,libstdc++-symbols.explist
 version_dep = libstdc++-symbols.explist
diff -r 725b27510017 -r 849c40f2bbfa libstdc++-v3/testsuite/Makefile.am
--- a/libstdc++-v3/testsuite/Makefile.am	Fri Feb 19 10:00:04 2010 +0100
+++ b/libstdc++-v3/testsuite/Makefile.am	Tue Feb 23 23:26:18 2010 +0100
@@ -69,8 +69,10 @@
 
 extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
 
+baseline_subdir := $(shell $(CXX) --print-multi-dir)
+
 baseline_symbols:
-	-@(output=${baseline_dir}/baseline_symbols.txt; \
+	-@(output=${baseline_dir}/${baseline_subdir}/baseline_symbols.txt; \
 	  if test ! -f $${output}; then \
 	    echo "Baseline file doesn't exist."; \
 	    echo "Try 'make new-abi-baseline' to create it."; \
@@ -78,8 +80,8 @@
 	  fi; true)
 
 new-abi-baseline:
-	-@$(mkinstalldirs) ${baseline_dir}
-	-@(output=${baseline_dir}/baseline_symbols.txt; \
+	-@$(mkinstalldirs) ${baseline_dir}${baseline_subdir}
+	-@(output=${baseline_dir}/${baseline_subdir}/baseline_symbols.txt; \
 	  if test -f $${output}; then \
 	    output=$${output}.new; \
 	    t=`echo $${output} | sed 's=.*config/abi/=='`; \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]