This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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, libstdc++] Make abi_check multilib-aware


As can be seen from the testresults here:

http://gcc.gnu.org/ml/gcc-testresults/2009-02/msg00991.html

, abi_check is passing both for N32 and N64 ABIs on MIPS64.

This can't obviously be correct as I've only added the N32 reference so far.

As it turns out when the libstdc++ testsuite is run with
--target_board='unix{,-mabi=64}', i.e. multilib, for each multilib abi.exp
checks the default-multilib libstdc++.so against the default-multilib
reference file (hence the pass for N64).

libstdc++ is a config-ml.in package so things work when you actually run the
test under the ABI-specific build directory.  That way the N64 abi test does
fail with the expected object size differences, etc.

The patch below adds multilib support to abi.exp.  If there is no
multilib-specific baseline file it uses the one of the default ABI.  I also
modified the check-abi rule to forward the RUNTESTFLAGS to runtest.

Bootstrapped and tested mips64octeon-linux with {,-mabi=64}: as expected N64
abi_check fails now.  I've also bootstrapped and regtested x86_64-linux.

I verified that you could still test a multilib under the multilib-specific
libstdc++ directory as before.

Next thing is to sort out the N64 baseline.

OK to install?

Adam


	* testsuite/libstdc++-abi/abi.exp: Add multilib support.
	* acinclude.m4 (GLIBCXX_CONFIGURE_TESTSUITE): Remove MULTISUBDIR
	from baseline_dir.
	* configure: Regenerate.
	* testsuite/Makefile.am (baseline_file): Remove variable.
	(site.exp): Set baseline_dir rather than baseline_file.
	(check-abi): Pass AM_RUNTESTFLAGS and RUNTESTFLAGS to runtest.
	* testsuite/Makefile.in: Regenerate.

Index: testsuite/libstdc++-abi/abi.exp
===================================================================
--- testsuite/libstdc++-abi/abi.exp	(revision 144041)
+++ testsuite/libstdc++-abi/abi.exp	(working copy)
@@ -18,18 +18,32 @@
 # this test. Or, hey, if we don't support this kind of symbol
 # versioning test: don't run it.
 
+set lib $blddir/src/.libs/libstdc++.so
+set baseline_subdir "[eval exec $cxx --print-multi-dir]"
+
 # Build the support objects.
 v3-build_support
 
-if { (${v3-symver} == 0) || ![info exists baseline_file] \
-	 || ![file exists $baseline_file] \
-	 || ![file exists "../src/.libs/libstdc++.so"] } {
+if { (${v3-symver} == 0) || ![info exists baseline_dir] \
+	 || ![file exists $baseline_dir] \
+	 || ![file exists $lib] } {
+    return
+}
+
+set baseline_file \
+    [file join $baseline_dir $baseline_subdir "baseline_symbols.txt"]
+# If there is no ABI-specific reference file use that of the default ABI.
+if ![file exists $baseline_file] {
+    set baseline_file [file join $baseline_dir "baseline_symbols.txt"]
+}
+if ![file exists $baseline_file] {
     return
 }
+send_log "Checking $lib against $baseline_file\n"
 
 # Figure out what symbols are defined by the active build of the library.
 remote_exec "build" "$srcdir/../scripts/extract_symvers" \
-    [list "../src/.libs/libstdc++.so" "current_symbols.txt"]
+    [list $lib "current_symbols.txt"]
 
 # Build the abi_check program.
 if { [v3_target_compile "$srcdir/util/testsuite_abi_check.cc" "abi_check" \
Index: acinclude.m4
===================================================================
--- acinclude.m4	(revision 144041)
+++ acinclude.m4	(working copy)
@@ -638,7 +638,7 @@ AC_DEFUN([GLIBCXX_CONFIGURE_TESTSUITE], 
   fi
   
   # Export file names for ABI checking.
-  baseline_dir="$glibcxx_srcdir/config/abi/post/${abi_baseline_pair}\$(MULTISUBDIR)"
+  baseline_dir="$glibcxx_srcdir/config/abi/post/${abi_baseline_pair}"
   AC_SUBST(baseline_dir)
 ])
 
Index: configure
===================================================================
--- configure	(revision 144041)
+++ configure	(working copy)
@@ -117983,7 +117983,7 @@ done
   fi
 
   # Export file names for ABI checking.
-  baseline_dir="$glibcxx_srcdir/config/abi/post/${abi_baseline_pair}\$(MULTISUBDIR)"
+  baseline_dir="$glibcxx_srcdir/config/abi/post/${abi_baseline_pair}"
 
 
 
Index: testsuite/Makefile.am
===================================================================
--- testsuite/Makefile.am	(revision 144041)
+++ testsuite/Makefile.am	(working copy)
@@ -58,7 +58,7 @@ site.exp: Makefile
 	@echo 'set target_triplet $(target_triplet)' >>site.tmp
 	@echo 'set target_triplet $(target_triplet)' >>site.tmp
 	@echo 'set libiconv "$(LIBICONV)"' >>site.tmp
-	@echo 'set baseline_file "$(baseline_file)"' >> site.tmp
+	@echo 'set baseline_dir "$(baseline_dir)"' >> 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
@@ -67,7 +67,6 @@ site.exp: Makefile
 	@mv site.tmp site.exp
 
 
-baseline_file = ${baseline_dir}/baseline_symbols.txt
 extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
 
 baseline_symbols:
@@ -165,7 +164,7 @@ check-am:
 # Use 'new-abi-baseline' to create an initial symbol file.  Then run
 # 'check-abi' to test for changes against that file.
 check-abi: site.exp baseline_symbols 
-	-@runtest --tool libstdc++ abi.exp
+	-@runtest $(AM_RUNTESTFLAGS) --tool libstdc++ $(RUNTESTFLAGS) abi.exp
 
 # Runs the testsuite, but in compile only mode.
 # Can be used to test sources with non-GNU FE's at various warning
Index: testsuite/Makefile.in
===================================================================
--- testsuite/Makefile.in	(revision 144041)
+++ testsuite/Makefile.in	(working copy)
@@ -299,7 +299,6 @@ lists_of_files = \
    testsuite_files_interactive \
    testsuite_files_performance
 
-baseline_file = ${baseline_dir}/baseline_symbols.txt
 extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
 check_DEJAGNU_normal_targets = $(patsubst %,check-DEJAGNUnormal%,0 1 2 3)
 
@@ -517,7 +516,7 @@ site.exp: Makefile
 	@echo 'set target_triplet $(target_triplet)' >>site.tmp
 	@echo 'set target_triplet $(target_triplet)' >>site.tmp
 	@echo 'set libiconv "$(LIBICONV)"' >>site.tmp
-	@echo 'set baseline_file "$(baseline_file)"' >> site.tmp
+	@echo 'set baseline_dir "$(baseline_dir)"' >> 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
@@ -618,7 +617,7 @@ check-am:
 # Use 'new-abi-baseline' to create an initial symbol file.  Then run
 # 'check-abi' to test for changes against that file.
 check-abi: site.exp baseline_symbols 
-	-@runtest --tool libstdc++ abi.exp
+	-@runtest $(AM_RUNTESTFLAGS) --tool libstdc++ $(RUNTESTFLAGS) abi.exp
 check-compile: testsuite_files ${compile_script}
 	-@(chmod + ${compile_script}; \
 	  ${compile_script} ${glibcxx_srcdir} ${glibcxx_builddir})


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