This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Many libjava testsuite failures on Solaris/SPARC and Intel
- To: java at gcc dot gnu dot org
- Subject: Many libjava testsuite failures on Solaris/SPARC and Intel
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- Date: Thu, 28 Jun 2001 00:51:10 +0200 (MEST)
I'm currently investigating GCC 3.0 on Solaris 2.5.1/SPARC (where
--enable-libgcj is on by default), Solaris 8/SPARC (both 32-bit and 64-bit)
and Solaris 8/Intel (where I've manually set --enable-libgcj). With a few
patches for the Solaris/SPARC V9 and Intel cases, I've been able to
bootstrap all those configurations, but all the testcases where a java
program is linked fail like this:
ld: warning: file /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//libjava/.libs/libgcj.so: attempted multiple inclusion of file
ld: warning: file /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//boehm-gc/.libs/libgcjgc.so: attempted multiple inclusion of file
ld: warning: file /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//zlib/.libs/libzgcj.so: attempted multiple inclusion of file
This is only a linker warning, but since it's unexpected to the dejagnu
framework, this causes the compilation to fail.
If one manually reruns this with gcj -v, one can see what's going on:
CLASSPATH=.. /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8/libjava/testsuite/../libtool --tag=GCJ --mode=link /vol/gcc/obj/gcc-3.0/8-gcc/gcc/gcj -B/vol/gcc/obj/gcc-3.0/8-gcc/gcc/ --encoding=UTF-8 -B/vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8/libjava/testsuite/../ /vol/gnu/src/gcc/gcc-3.0/libjava/testsuite/libjava.compile/ArrayClass.java /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//libjava/libgcj.la /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//boehm-gc/libgcjgc.la /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//zlib/libzgcj.la --main=ArrayClass -g -L/vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//libjava/.libs -L/vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//boehm-gc/.libs -L/vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//zlib/.libs -lm -o /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8/libjava/testsuite/ArrayClass -v
/vol/gcc/obj/gcc-3.0/8-gcc/gcc/gcj -B/vol/gcc/obj/gcc-3.0/8-gcc/gcc/ --encoding=UTF-8 -B/vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8/libjava/testsuite/../ /vol/gnu/src/gcc/gcc-3.0/libjava/testsuite/libjava.compile/ArrayClass.java --main=ArrayClass -g -o /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8/libjava/testsuite/.libs/ArrayClass -v /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//libjava/.libs/libgcj.so -L/amnt/figaro/volumes/obj-gcc/gcc/obj.sol2/gcc-3.0/8-gcc/sparc-sun-solaris2.8/libjava -lrt -ldl /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//boehm-gc/.libs/libgcjgc.so -lpthread /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//zlib/.libs/libzgcj.so -L/vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//libjava/.libs -L/vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//boehm-gc/.libs -L/vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//zlib/.libs -lm -Wl,-R -Wl,/vol/gcc/lib
Reading specs from /vol/gcc/obj/gcc-3.0/8-gcc/gcc/specs
Reading specs from /amnt/figaro/volumes/obj-gcc/gcc/obj.sol2/gcc-3.0/8-gcc/sparc-sun-solaris2.8/libjava/libgcj.spec
rename spec lib to liborig
rename spec startfile to startfileorig
Configured with: /vol/gnu/src/gcc/gcc-3.0/configure --prefix=/vol/gcc --with-local-prefix=/vol/gcc --disable-nls --enable-libgcj
Thread model: posix
gcc version 3.0
/vol/gcc/obj/gcc-3.0/8-gcc/gcc/jc1 /vol/gnu/src/gcc/gcc-3.0/libjava/testsuite/libjava.compile/ArrayClass.java -fuse-divide-subroutine -fuse-boehm-gc -fnon-call-exceptions -quiet -dumpbase ArrayClass.java -g -version -fencoding=UTF-8 -o /var/tmp/ccWfV4hw.s
GNU Java version 3.0 (sparc-sun-solaris2.8)
compiled by GNU C version 3.0.
/usr/ccs/bin/as -V -Qy -s -o /var/tmp/ccaYk8m4.o /var/tmp/ccWfV4hw.s
/usr/ccs/bin/as: Sun WorkShop 6 99/08/18
/vol/gcc/obj/gcc-3.0/8-gcc/gcc/jvgenmain ArrayClass /var/tmp/ccwADkBImain.i
/vol/gcc/obj/gcc-3.0/8-gcc/gcc/cc1 /var/tmp/ccwADkBImain.i -quiet -dumpbase ArrayClass.c -g -version -fdollars-in-identifiers -o /var/tmp/ccQ3T9Ynmain.s
GNU CPP version 3.0 (cpplib) (sparc)
GNU C version 3.0 (sparc-sun-solaris2.8)
compiled by GNU C version 3.0.
/usr/ccs/bin/as -V -Qy -s -o /var/tmp/cccMR5K8main.o /var/tmp/ccQ3T9Ynmain.s
/usr/ccs/bin/as: Sun WorkShop 6 99/08/18
/vol/gcc/obj/gcc-3.0/8-gcc/gcc/collect2 -V -Y P,/usr/ccs/lib:/usr/lib -Qy -o /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8/libjava/testsuite/.libs/ArrayClass /vol/gcc/obj/gcc-3.0/8-gcc/gcc/crt1.o /vol/gcc/obj/gcc-3.0/8-gcc/gcc/crti.o /usr/ccs/lib/values-Xa.o /vol/gcc/obj/gcc-3.0/8-gcc/gcc/crtbegin.o -u data_start /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8/libjava/testsuite/../libgcjdata.a -L/amnt/figaro/volumes/obj-gcc/gcc/obj.sol2/gcc-3.0/8-gcc/sparc-sun-solaris2.8/libjava -L/vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//libjava/.libs -L/vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//boehm-gc/.libs -L/vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//zlib/.libs -L/vol/gcc/obj/gcc-3.0/8-gcc/gcc -L/vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8/libjava/testsuite/.. -L/usr/ccs/bin -L/usr/ccs/lib /var/tmp/cccMR5K8main.o /var/tmp/ccaYk8m4.o /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//libjava/.libs/libgcj.so -lrt -ldl /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8/!
/boehm-gc/.libs/libgcjgc.so -lpthread /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//zlib/.libs/libzgcj.so -lm -R /vol/gcc/lib -lgcc_s -lgcc -lgcj -lm -lgcjgc -lpthread -lrt -lzgcj -lsocket -lnsl -ldl -lgcc_s -lgcc -lc -lgcc_s -lgcc /vol/gcc/obj/gcc-3.0/8-gcc/gcc/crtend.o /vol/gcc/obj/gcc-3.0/8-gcc/gcc/crtn.o
ld: Software Generation Utilities - Solaris-ELF (4.0)
ld: warning: file /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//libjava/.libs/libgcj.so: attempted multiple inclusion of file
ld: warning: file /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//boehm-gc/.libs/libgcjgc.so: attempted multiple inclusion of file
ld: warning: file /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8//zlib/.libs/libzgcj.so: attempted multiple inclusion of file
creating /vol/gcc/obj/gcc-3.0/8-gcc/sparc-sun-solaris2.8/libjava/testsuite/ArrayClass
I.e. libgcj.so is really linked twice, once from the explicit libgcj.la
passed in by the libjava dejagnu testsuite driver, and a second time from
the -lgcj passed by the gcj driver. I don't have a copy of GCC 3.0
installed in $prefix yet, so ld is right: these files are identical and the
warning is correct. You may even get different errors/warnings if you have
a copy of say GCC 3.0 installed in $prefix while testing a 3.0.1
prerelease; I haven't tried this yet.
Looking at the the Solaris 8 libld sources, which are responsible for the
warning, there's no way, ld switch or otherwise, to disable this.
So to really find out the state of libjava on Solaris, there are a few
possibilities:
* Remove the duplicate .la libraries in testsuite/lib/libjava.exp, relying
on gcj to pass them. This worked for me (patch included below),
revealing that libjava on Solaris 8 is in a reasonable shape, but has
probably a couple of problems on other platforms: i.e. platforms that
rely on libtool magic to select the correct (i.e. uninstalled) libgcj et
al. shared libs when e.g. RPATH cannot be overridden by LD_LIBRARY_PATH,
as on Solaris and newer ELF systems that implement the latest ELF gABI
with DT_RUNPATH that *is* overridable. So this solution may be out of
question, although I'm not really sure: I might try this on IRIX 6 or
Tru64 UNIX (where libgcj doesn't build yet), which strictly implement ELF
gABI 4.1 in this respect. Perhaps someone else could try this on his
system and report what he finds?
* One could simply ignore the warnings in dejagnu, as is done for a couple
of other assembler and linker warnings that are known to be harmless, and
no easy workaround/fix exists. This is ugly, since the warnings are
well-founded, but certainly a possibility (although we would have to
point libjava testers at the necessary patch or the CVS version of
dejagnu for this to work).
* A last alternative might be to add a -nostdlibgcj switch to gcj, so we
can avoid the library duplication in the first place, but still link in
the necessary system libraries.
What do you think is the best approach to handle this?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Email: ro@TechFak.Uni-Bielefeld.DE
Thu Jun 28 00:47:23 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* lib/libjava.exp (libjava_find_lib): Remove duplicate .la files.
===================================================================
RCS file: libjava/testsuite/lib/RCS/libjava.exp,v
retrieving revision 1.1
diff -up -r1.1 libjava/testsuite/lib/libjava.exp
--- libjava/testsuite/lib/libjava.exp 2001/05/04 19:32:15 1.1
+++ libjava/testsuite/lib/libjava.exp 2001/06/26 19:41:53
@@ -175,11 +175,11 @@ proc libjava_find_lib {dir name} {
foreach sub {.libs _libs} {
if {$gp != ""} {
if {[file exists $gp/$dir/$sub/lib${name}.a]} then {
- return "$gp/$dir/lib${name}.la -L$gp/$dir/$sub"
+ return "-L$gp/$dir/$sub"
}
}
set lib [findfile $base_dir/../../$dir/$sub/lib${name}.a \
- "$base_dir/../../$dir/lib${name}.la -L$base_dir/../../$dir/$sub" \
+ "-L$base_dir/../../$dir/$sub" \
""]
if {$lib != ""} {
return $lib