3.1 PATCH: Use correct libgcj.spec for multilibbed testing
Rainer Orth
ro@TechFak.Uni-Bielefeld.DE
Thu May 2 03:03:00 GMT 2002
As described in the thread starting at
http://gcc.gnu.org/ml/java/2002-03/msg00389.html
the libjava testsuite unconditionally uses the libgcj.spec file
corresponding to the default multilib. This is wrong on mips-sgi-irix6.5:
the testsuite results at
http://gcc.gnu.org/ml/gcc-testresults/2002-04/msg01133.html
show that for -mabi=64 (the N64 ABI) all compilation tests fail:
ld64: WARNING 84 : /usr/lib64/libm.so is not used for resolving any symbol.
ld64: FATAL 9 : I/O error (-ldl): No such file or directory
collect2: ld returned 32 exit status
The following patch fixes this and gives reasonable N32 and N64 testsuite
results. Tested by running
make RUNTESTFLAGS="--target_board 'unix{,-mabi=64}'" check
in mips-sgi-irix6.5/libjava/testsuite.
The new testsuite results are here:
http://gcc.gnu.org/ml/gcc-testresults/2002-05/msg00042.html
Ok for branch and mainline?
Rainer
Tue Apr 30 04:02:43 2002 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* testsuite/lib/libjava.exp (libjava_find_spec): New function.
(libjava_init): Use it to find libgcj.spec.
(libjava_arguments): Likewise.
Index: libjava.exp
===================================================================
RCS file: /cvs/gcc/gcc/libjava/testsuite/lib/libjava.exp,v
retrieving revision 1.33.2.2
diff -u -p -r1.33.2.2 libjava.exp
--- libjava.exp 11 Apr 2002 20:55:51 -0000 1.33.2.2
+++ libjava.exp 30 Apr 2002 22:50:53 -0000
@@ -127,8 +127,13 @@ proc libjava_init { args } {
}
}
+ # FIXME: This finds libgcj.spec for the default multilib.
+ # If thread models differ between multilibs, this has to be moved
+ # to libjava_arguments
+ set specdir [libjava_find_spec]
+
# The -B is so we find libgcj.spec.
- set text [eval exec "$GCJ_UNDER_TEST -B$objdir/../ -v 2>@ stdout"]
+ set text [eval exec "$GCJ_UNDER_TEST -B$specdir -v 2>@ stdout"]
regexp -- "Thread model: (\[^\n\]+)\n" $text ignore model
set libjava_uses_threads [expr {! ($model == "no"
|| $model == "none"
@@ -192,6 +197,19 @@ proc libjava_find_lib {dir name} {
return ""
}
+# Find libgcj.spec. We need to use the file corresponding to the multilib
+# under test since they might differ. Append a trailing slash since this
+# is used with -B.
+proc libjava_find_spec {} {
+ global objdir
+ set gp [get_multilibs]
+
+ if {[file exists $gp/libjava/libgcj.spec]} then {
+ return "$gp/libjava/"
+ }
+ return "$objdir/../"
+}
+
# Remove a bunch of files.
proc gcj_cleanup {args} {
foreach file $args {
@@ -316,6 +334,9 @@ proc libjava_arguments {{mode compile}}
lappend args "additional_flags=$TOOL_OPTIONS"
}
+ # Determine libgcj.spec corresponding to multilib under test.
+ set specdir [libjava_find_spec]
+
# Search for libtool. We need it to link.
set found_compiler 0
set d [absolute $objdir]
@@ -323,15 +344,15 @@ proc libjava_arguments {{mode compile}}
if {[file exists $d/$x/libtool]} then {
# We have to run silently to avoid DejaGNU lossage.
lappend args \
- "compiler=$d/$x/libtool --silent --tag=GCJ --mode=$mode $GCJ_UNDER_TEST -B$objdir/../"
+ "compiler=$d/$x/libtool --silent --tag=GCJ --mode=$mode $GCJ_UNDER_TEST -B$specdir"
set found_compiler 1
break
}
}
if {! $found_compiler} {
- # Append -B$objdir/../ so that we find libgcj.spec before it
+ # Append -B$specdir so that we find libgcj.spec before it
# is installed.
- lappend args "compiler=$GCJ_UNDER_TEST -B$objdir/../"
+ lappend args "compiler=$GCJ_UNDER_TEST -B$specdir"
}
# Avoid libtool wrapper scripts when possible.
More information about the Gcc-patches
mailing list