diff mbox

[testsuite,fortran] Fix Fortran execution tests for non-default multilib

Message ID yddvd3t45g4.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Nov. 19, 2010, 4:57 p.m. UTC
I think I've found and fixed all issues with Fortran multilib testing
introduced by the libquadmath patch:

* $compiler --print-multilib wasn't ever run for the gfortran.* tests.
  This was caused by the braces around $GFORTRAN_UNDER_TEST in
  gfortran.exp (gfortran_link_flags): they caused the literal string
  "$GFORTRAN_UNDER_TEST" to be passed to gcc-set-multilib-library-path,
  which couldn't be found by [which $compiler].

* GFORTRAN_UNDER_TEST needs to use -B<path to libgfortran dir>/ to let
  the driver find libgfortran.spec, not -L.  The trailing / is also
  necessary for this to work.

* Finally, in gcc-defs.exp (gcc-set-multilib-library-path), $options is
  no a list.  As is, $compiler was exec'ed with a single argument
  "-B<somedir> -B<someotherdir>" --print-multilib, which cannot work.
  One needs an eval to fix this.

With those fixes, a -m64/sparcv9 test with runtest worked on
sparc-sun-solaris2.10.  I'm now starting a fresh bootstrap on
i386-pc-solaris2.1 and will commit the patch once this has finishes
successfully.

This code can never have been tested or worked anywhere ;-(

	Rainer


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

	gcc/testsuite:
	* lib/gcc-defs.exp (gcc-set-multilib-library-path): Use eval to
	exec $compiler.
	* lib/gfortran.exp (gfortran_link_flags): Remove braces around
	$GFORTRAN_UNDER_TEST.
	(gfortran_init): Use -B to specify specpath, add trailing /.

Comments

Tobias Burnus Nov. 19, 2010, 9:30 p.m. UTC | #1
Rainer Orth wrote:
> I think I've found and fixed all issues with Fortran multilib testing
> introduced by the libquadmath patch:

Thanks for tracing this down and for the patch.
 From my side - what ever it counts - the patch is OK.

Tobias

> 2010-11-19  Rainer Orth<ro@CeBiTec.Uni-Bielefeld.DE>
>
> 	gcc/testsuite:
> 	* lib/gcc-defs.exp (gcc-set-multilib-library-path): Use eval to
> 	exec $compiler.
> 	* lib/gfortran.exp (gfortran_link_flags): Remove braces around
> 	$GFORTRAN_UNDER_TEST.
> 	(gfortran_init): Use -B to specify specpath, add trailing /.
diff mbox

Patch

diff -r 9fa5269f2518 gcc/testsuite/lib/gcc-defs.exp
--- a/gcc/testsuite/lib/gcc-defs.exp	Fri Nov 19 11:23:22 2010 +0100
+++ b/gcc/testsuite/lib/gcc-defs.exp	Fri Nov 19 17:49:35 2010 +0100
@@ -253,7 +253,7 @@ 
     set options [lrange $compiler 1 end]
     set compiler [lindex $compiler 0]
     if { [is_remote host] == 0 && [which $compiler] != 0 } {
-	foreach i "[exec $compiler $options --print-multi-lib]" {
+	foreach i "[eval exec $compiler $options --print-multi-lib]" {
 	    set mldir ""
 	    regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
 	    set mldir [string trimright $mldir "\;@"]
diff -r 9fa5269f2518 gcc/testsuite/lib/gfortran.exp
--- a/gcc/testsuite/lib/gfortran.exp	Fri Nov 19 11:23:22 2010 +0100
+++ b/gcc/testsuite/lib/gfortran.exp	Fri Nov 19 17:49:35 2010 +0100
@@ -118,7 +118,7 @@ 
           append flags "-L${gccpath}/libiberty "
       }
       append ld_library_path \
-	[gcc-set-multilib-library-path { $GFORTRAN_UNDER_TEST } ]
+	[gcc-set-multilib-library-path $GFORTRAN_UNDER_TEST ]
     }
 
     set_ld_library_path_env_vars
@@ -166,7 +166,7 @@ 
 		} else {
 		    set specpath [get_multilibs]
 		}
-		set GFORTRAN_UNDER_TEST [findfile $base_dir/../../gfortran "$base_dir/../../gfortran -B$base_dir/../../ -L$specpath/libgfortran" [findfile $base_dir/gfortran "$base_dir/gfortran -B$base_dir/" [transform gfortran]]]
+		set GFORTRAN_UNDER_TEST [findfile $base_dir/../../gfortran "$base_dir/../../gfortran -B$base_dir/../../ -B$specpath/libgfortran/" [findfile $base_dir/gfortran "$base_dir/gfortran -B$base_dir/" [transform gfortran]]]
 	    }
 	}
     }