Patchwork [v3] Correctly determine baseline_subdir for 64-bit default Solaris gcc

login
register
mail settings
Submitter Rainer Orth
Date July 6, 2011, 4:40 p.m.
Message ID <yddmxgrgy6n.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Download mbox | patch
Permalink /patch/103530/
State New
Headers show

Comments

Rainer Orth - July 6, 2011, 4:40 p.m.
As alluded to in

	Provide 64-bit default Solaris/x86 configuration (PR target/39150)
        http://gcc.gnu.org/ml/gcc-patches/2011-07/msg00327.html

(which was meant to be Cc'ed to libstdc++, but bounced due to a stupid
typo), there are now to variant bi-arch gcc configurations for Solaris:

       i386-pc-solaris2.*
       sparc-sun-solaris2.*

which default to 32-bit code generation, and

	x86_64-pc-solaris2.*
        sparc64-sun-solaris2.*

which default to 64-bit code generation.

Unfortunately, libstdc++-abi/abi_check fails for the latter two for the
64-bit (default) multilib.  The problem is that testsuite/Makefile.am
and testsuite/libstdc++-abi/abi.exp use g++ --print-multi-directory to
determine the subdirectory of config/abi/post/<baseline_dir> to use for
the multilib at hand.

For the 32-bit configurations, all is fine, while there's a mismatch for
the 64-bit ones:

	      			32-bit default	64-bit default

--print-multi-directory		.	amd64	.	32
--print-multi-os-directory	.	amd64	amd64	.

For the 32-bit case, everything works (sort of by chance): if abi.exp
cannot fine the baseline in the subdir, it defaults to the baseline dir,
which is exactly right.  In the 64-bit case, the 32-bit baseline is
used instead, which breaks completely.

Unfortunately, one cannot simply use --print-multi-os-directory instead
everywhere: while this is fine on Solaris, it would break Linux/x86_64:

						.	 32
						../lib64 ../lib

So it seems the whole thing needs to be made configurable, which is what
this patch does.  It allows setting a non-default switch in
configure.host, but defaults to --print-multi-directory otherwise.

Tested on sparc-sun-solaris2.11 and sparcv9-sun-solaris2.11 by
rebuilding libstdc++-v3 and running make RUNTESTFLAGS=abi.exp check.

As expected, libstdc++-abi/abi_check now succeeds for both multilibs.

I'll also test on x86_64-unknown-linux-gnu to make sure nothing breaks
there.

Ok for mainline if that passes?

Thanks.
	Rainer


2011-07-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* configure.host (abi_baseline_subdir_switch): Describe.
	Provide default.
	(*-*-solaris2.[89], *-*-solaris2.1[0-9]): Override.
	* acinclude.m4 (GLIBCXX_CONFIGURE_TESTSUITE): Substitute
	baseline_subdir_switch.
	* testsuite/Makefile.am (site.exp): Emit it.
	(baseline_subdir): Use it.
	* testsuite/libstdc++-abi/abi.exp: Use it.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* python/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
Paolo Carlini - July 7, 2011, 9:10 a.m.
Hi,
> Ok for mainline if that passes?
I'm going to trust you Rainer on this and it seems very safe on 
x86_64-linux anyway. Please wait just one more day or so and then check 
it in.

Thanks,
Paolo.
Rainer Orth - July 7, 2011, 9:16 a.m.
Hi Paolo,

>> Ok for mainline if that passes?
> I'm going to trust you Rainer on this and it seems very safe on
> x86_64-linux anyway. Please wait just one more day or so and then check it
> in.

ok, will do.  The x86_64-unknown-linux-gnu bootstrap has completed
without regressions and the correct baselines were used for both
multilibs.

	Rainer

Patch

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -590,6 +590,7 @@  dnl  GLIBCXX_TEST_WCHAR_T
 dnl  GLIBCXX_TEST_THREAD
 dnl Substs:
 dnl  baseline_dir
+dnl  baseline_subdir_switch
 dnl
 AC_DEFUN([GLIBCXX_CONFIGURE_TESTSUITE], [
   if $GLIBCXX_IS_NATIVE ; then
@@ -617,6 +618,8 @@  AC_DEFUN([GLIBCXX_CONFIGURE_TESTSUITE], 
   # Export file names for ABI checking.
   baseline_dir="$glibcxx_srcdir/config/abi/post/${abi_baseline_pair}"
   AC_SUBST(baseline_dir)
+  baseline_subdir_switch="$abi_baseline_subdir_switch"
+  AC_SUBST(baseline_subdir_switch)
 ])
 
 
diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -30,6 +30,11 @@ 
 #   abi_baseline_pair      directory name for ABI compat testing,
 #                          defaults to host_cpu-host_os (as per config.guess)
 #
+#   abi_baseline_subdir_switch
+#			   g++ switch to determine ABI baseline subdir for
+#			   multilibbed targets,
+#			   defaults to --print-multi-directory
+#
 #   abi_tweaks_dir         location of cxxabi_tweaks.h,
 #                          defaults to cpu_include_dir
 #
@@ -78,6 +83,7 @@  atomic_flags=""
 atomicity_dir="cpu/generic"
 cpu_defines_dir="cpu/generic"
 try_cpu=generic
+abi_baseline_subdir_switch=--print-multi-directory
 abi_tweaks_dir="cpu/generic"
 error_constants_dir="os/generic"
 
@@ -336,8 +342,10 @@  case "${host}" in
     ;;
   *-*-solaris2.[89])
     abi_baseline_pair=solaris2.8
+    abi_baseline_subdir_switch=--print-multi-os-directory
     ;;
   *-*-solaris2.1[0-9])
     abi_baseline_pair=solaris2.10
+    abi_baseline_subdir_switch=--print-multi-os-directory
     ;;
 esac
diff --git a/libstdc++-v3/testsuite/Makefile.am b/libstdc++-v3/testsuite/Makefile.am
--- a/libstdc++-v3/testsuite/Makefile.am
+++ b/libstdc++-v3/testsuite/Makefile.am
@@ -59,6 +59,7 @@  site.exp: Makefile
 	@echo 'set target_triplet $(target_triplet)' >>site.tmp
 	@echo 'set libiconv "$(LIBICONV)"' >>site.tmp
 	@echo 'set baseline_dir "$(baseline_dir)"' >> site.tmp
+	@echo 'set baseline_subdir_switch "$(baseline_subdir_switch)"' >> site.tmp
 	@echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
 	@test ! -f site.exp || \
 	  sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
@@ -69,7 +70,7 @@  site.exp: Makefile
 
 extract_symvers = $(glibcxx_builddir)/scripts/extract_symvers
 
-baseline_subdir := $(shell $(CXX) --print-multi-dir)
+baseline_subdir := $(shell $(CXX) $(baseline_subdir_switch))
 
 baseline_symbols:
 	-@(output=${baseline_dir}/${baseline_subdir}/baseline_symbols.txt; \
diff --git a/libstdc++-v3/testsuite/libstdc++-abi/abi.exp b/libstdc++-v3/testsuite/libstdc++-abi/abi.exp
--- a/libstdc++-v3/testsuite/libstdc++-abi/abi.exp
+++ b/libstdc++-v3/testsuite/libstdc++-abi/abi.exp
@@ -1,4 +1,4 @@ 
-# Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2009, 2010, 2011 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -24,7 +24,7 @@  if { [string match "*-*-darwin*" $target
     set lib $blddir/src/.libs/libstdc++.so
 }
 
-set baseline_subdir "[eval exec $cxx --print-multi-dir]"
+set baseline_subdir "[eval exec $cxx $baseline_subdir_switch]"
 
 # Build the support objects.
 v3-build_support