I can't build GNU Classpath with current cvs gcj. This may be a regression, though it is also possible that Classpath changed in a way that gcj can't handle. The code in question is correct. It appears that gcj is picking the wrong 'Certificate': make[1]: Entering directory `/home/tromey/gnu/classpath/build/lib' top_builddir=.. /bin/sh ./gen-classlist.sh standard /home/tromey/gnu/Binarycompat/install/bin/gcj --bootclasspath '' --classpath ../../classpath:../vm/current:.: -C -d . @classes ../../classpath/java/security/cert/X509Certificate.java:143: error: Class `java.security.cert.X509Certificate' can't subclass interface `java.security.Certificate'. public abstract class X509Certificate extends Certificate implements X509Extension ^ ../../classpath/java/security/cert/X509Certificate.java:0: confused by earlier errors, bailing out
Confirmed.
You haven't provided full instructions to duplicate this. Can you please submit 1. The commands you used to check out the source. 2. The commands you used to configure and build. Yes, I know that I could figure it out, but as you must already know this information why not provide it in the PR?
I built with $ gcj --version gcj (GCC) 4.0.0 20041006 (experimental) $ `pwd`/../configure --with-gcj --disable-gtk-peer $ make Making all in lib make[1]: Entering directory `/home/aph/classpath/build/lib' top_builddir=.. /bin/sh ./gen-classlist.sh standard /home/aph/gcc/install/bin/gcj --bootclasspath '' --classpath /home/aph/classpath/build/..:../vm/current:.: -C -d . @classes touch compile-classes if ! [ -e gnu ]; then mkdir gnu; fi if ! [ -e gnu/java ]; then mkdir gnu/java; fi if ! [ -e gnu/java/locale ]; then mkdir gnu/java/locale; fi touch resources if test "/usr/bin/zip" != ""; then /usr/bin/zip -r -D glibj.zip gnu java javax o ... make[1]: Nothing to be done for `all-am'. make[1]: Leaving directory `/home/aph/classpath/build' $ uname -a Linux zorro.pink 2.4.21-4.17.EL #1 Mon Nov 17 19:46:22 EST 2003 x86_64 x86_64 x86_64 GNU/Linux
Here's how I configured. Some of these options aren't used by classpath, they come from my generic build script. Note that this reliably fails for me on x86 fc2. It failed again last night. opsy. ./config.status --version GNU Classpath config.status 0.11+cvs configured by ../classpath/configure, generated by GNU Autoconf 2.59, with options "'--prefix=/home/tromey/gnu/classpath/install' '--enable-languages=c++,java' '--enable-threads=posix' '--enable-checking=tree' '--enable-java-awt=gtk,xlib' '--with-gcj' '--enable-jni' '--enable-regen-headers'" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it.
these are my classpath config options: [wolfram:~/home-work/cp-objdir] andreast% ./config.status --version GNU Classpath config.status 0.11+cvs configured by ../classpath/configure, generated by GNU Autoconf 2.59, with options "'--with-gcj'" [wolfram:~/home-work/cp-objdir] andreast% gcj -v Reading specs from /Volumes/src/gcc/gcc-cvs/testbin/lib/gcc/powerpc-apple-darwin7.5.0/4.0.0/specs Configured with: /Volumes/src/gcc/gcc-cvs/gcc/configure --prefix=/Volumes/src/gcc/gcc-cvs/testbin --disable-checking --enable-languages=c,c++,java --enable-java-awt=gtk --enable-gtk-cairo --enable-libgcj-multifile Thread model: posix gcc version 4.0.0 20041006 (experimental) The failure is the same as Tom's. I tried before aph's ci (where the first change has a wrong date btw.) yesterday morning and today after all ci's on gcc/java. So, form my side it is not coming form aph's patch. [wolfram:gcc-cvs/objdir/gcc] andreast% cat ../../gcc/LAST_UPDATED Wed Oct 6 10:15:09 CEST 2004 Wed Oct 6 08:15:09 UTC 2004 The machine is a G4 with 1GB of mem. The CL entries I refer to. 2004-10-05 Andrew Haley <aph@redhat.com> PR java/17779 * jcf-parse.c (parse_zip_file_entries): If a class has a superclass and a TYPE_SIZE of zero, lay it out. 2004-09-30 Andrew Haley <aph@redhat.com> PR java/17733 * jcf-parse.c (compute_class_name): Rewrite.
Tom, can you build on a machine I can reach? Toronto, maybe?
I did a build in Toronto. It works perfectly there. However, it continues to fail here at home nightly. These nightly builds are pristine; I don't know what is going on.
Subject: can't build GNU Classpath I think I'm going to have to give up on this bug. If I can't duplicate the problem myself and you can't duplicate the propblem on any machine to which I have access there's nothing that I can do.
I can't duplicate this problem, nor can anyone else duplicate it on any machine to which I have access.
Got another report for this on powerpc-apple-darwin7.5.0, gcj 3.4.2. I have added a workaround for it in GNU Classpath CVS --- java/security/cert/X509Certificate.java 20 Oct 2004 07:11:40 -0000 1.7 +++ java/security/cert/X509Certificate.java 27 Oct 2004 19:03:07 -0000 @@ -135,7 +135,9 @@ * @author Mark Benvenuto * @author Casey Marshall (rsdio@metastatic.org) */ -public abstract class X509Certificate extends Certificate implements X509Extension +public abstract class X509Certificate + extends java.security.cert.Certificate // XXX workaround for gcj bug #17845 + implements X509Extension { private static final long serialVersionUID = -2491127588187038216L;
Does this mean that you've actually been able to duplicate the bug? Can you at least let me have a backtrace? Surely it's better to fix the bug than install a workaround in Classpath.
> Does this mean that you've actually been able to duplicate the bug? > Can you at least let me have a backtrace? > Surely it's better to fix the bug than install a workaround in Classpath. I have seen the bug occur on a cygwin machine to which I don't have access anymore. I thought it was related to the file system being case-insensitive so jikes was used to do the source to byte code compilation. Chris is now seeing it on his powerpc machine. The workaround at least makes it possible to keep working on GNU Classpath. We have a policy that GNU Classpath (releases) need to be able to be build with the latest GCC release (and possibly older versions or CVS). There isn't a backtrace since it just gives this error messages: ../../classpath/java/security/cert/X509Certificate.java:143: error: Class `java.security.cert.X509Certificate' can't subclass interface `java.security.Certificate'. public abstract class X509Certificate extends Certificate implements X509Extension ^ ../../classpath/java/security/cert/X509Certificate.java:0: confused by earlier errors, bailing out Is there a trick to get you the backtrace you need to further analyze why this is happening?
Is this true anymore, I built classpath a couple of days ago on powerpc-darwin with a case-insensitive file system and it worked for me.
Subject: Re: can't build GNU Classpath pinskia at gcc dot gnu dot org wrote: > Is this true anymore, I built classpath a couple of days ago on > powerpc-darwin with a case-insensitive > file system and it worked for me. works for me.
Fixed or at least works for me.
It can be reproduced in libgcj, with --enable-libgcj-multifile. Paolo
I'll try to produce a reduced test case.
Reduced test case: ==> Dummy.java <== package java.security; class Dummy { } ==> gnuX509Certificate.java <== package gnu.java.security.x509; class X509Certificate extends java.security.cert.X509Certificate { } ==> X509Certificate.java <== package java.security.cert; public abstract class X509Certificate extends Certificate { } jc1 Command line: ../../gcc/jc1 srclist -fclasspath= -fbootclasspath=.:../../../libjava -ffilelist-file -fsyntax-only
(In reply to comment #18) > Reduced test case: I saw something like this before in a different bug.
Subject: Re: [4.1 Regression] More problems with simple type names as superclasses >I saw something like this before in a different bug. > It must have been PR21436, which I also reported/distilled/fixed. But it is not a dup, because no imports are involved in this case. Paolo
This code in do_resolve_class seems bogus to me. Fixing it removes the failure. Note that java.security is in the package_list because of Dummy.java, but it absolutely does *not* belong in the search path! This is the only use of package_list, by the way. /* 5- Try with a name qualified with the package names we've seen so far */ if (!QUALIFIED_P (TYPE_NAME (class_type))) { tree package; /* If there is a current package (ctxp->package), it's the first element of package_list and we can skip it. */ for (package = (ctxp->package ? TREE_CHAIN (package_list) : package_list); package; package = TREE_CHAIN (package)) if ((new_class_decl = qualify_and_find (class_type, TREE_PURPOSE (package), TYPE_NAME (class_type)))) return new_class_decl; }
Not fixing the hunk -- removing it actually!
Created attachment 8926 [details] patch to fix the bug
Fixed by patch.
Subject: Bug 17845 CVSROOT: /cvs/gcc Module name: gcc Changes by: bonzini@gcc.gnu.org 2005-05-19 11:16:31 Modified files: gcc/java : parse.y ChangeLog Log message: 2005-05-19 Paolo Bonzini <bonzini@gnu.org> PR java/17845 * parse.y (register_package, package_list): Remove. (package_declaration): Do not call register_package. (do_resolve_class): Do not use package_list. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.y.diff?cvsroot=gcc&r1=1.533&r2=1.534 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1612&r2=1.1613
Subject: Bug 17845 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: bonzini@gcc.gnu.org 2005-08-17 12:57:08 Modified files: libjava : ChangeLog Makefile.am Makefile.in configure configure.ac libjava/external: Makefile.in libjava/external/sax: Makefile.in libjava/external/w3c_dom: Makefile.in libjava/gcj : Makefile.in libjava/include: Makefile.in libjava/testsuite: Makefile.in libjava/testsuite/libjava.jacks: jacks.xfail gcc/java : ChangeLog class.c parse.h parse.y Log message: libjava: 2005-08-17 Paolo Bonzini <bonzini@gnu.org> Backport from mainline: 2005-05-18 Paolo Bonzini <bonzini@gnu.org> * Makefile.am (Makefile.deps): Do not use \0, it is unportable. * Makefile.in: Regenerate. 2005-05-17 Paolo Bonzini <bonzini@gnu.org> * configure.ac (--enable-libgcj-multifile): Remove. * Makefile.am (all_native_compiled_source_files, (all_native_compiled_dirs, all_java_dirs, all_java_lo_files, all_libgcj_lo_files, all_xlib_lo_files, all_java_deps_files, all_java_stamp_files, all_java_filelist_files): New variables. (EXTRA_DIST): New Automake variable. (CLEANFILES): Add .stamp, .list and .lo files. (%.list, %.lo, %.stamp, Makefile.deps): New rules. (classes.stamp): Depend on $(all_java_stamp_files). (libgcj.la): Pass $(libgcj_la_LIBADD) to the linker without going through write_entries_to_file. (all_java_source_files, all_property_files): Move earlier. (libgcj_la_OBJECTS, javao_files, xlib_javao_files, all_java_class_files): Remove. (gtk_awt_peer_sources): Rename to... (gtk_awt_peer_source_files): ... this. Adjust throughout. (ONESTEP): Remove. (libgcj0_convenience_la_SOURCES): Remove Java source files. (libgcj0_convenience_la_LIBADD): Add $(all_libgcj_lo_files). (libgcj0_convenience_la_DEPENDENCIES): Likewise. (libgcj_la_SOURCES): Remove. (lib_gnu_awt_xlib_la_SOURCES): Remove Java source files. (lib_gnu_awt_xlib_la_LIBADD): Add $(all_xlib_lo_files). (lib_gnu_awt_xlib_la_DEPENDENCIES): Likewise. * configure: Regenerate. * Makefile.in: Regenerate. * external/Makefile.in: Regenerate. * external/sax/Makefile.in: Regenerate. * external/w3c_dom/Makefile.in: Regenerate. * gcj/Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * libltdl/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. 2005-05-10 Paolo Bonzini <bonzini@gnu.org> PR java/21436 * testsuite/libjava.jacks/jacks.xfail: Adjust. gcc/java: 2005-08-17 Paolo Bonzini <bonzini@gnu.org> Backport from mainline: 2005-05-19 Paolo Bonzini <bonzini@gnu.org> PR java/17845 * parse.y (register_package, package_list): Remove. (package_declaration): Do not call register_package. (do_resolve_class): Do not use package_list. 2005-05-10 Paolo Bonzini <bonzini@gnu.org> PR java/21436 * class.c (maybe_layout_super_class): Look for imports in this_class. * parse.h (ctxp_for_generation_last): New. (do_resolve_class): Add a parameter. * parse.y (ctxp_for_generation_last): New. (java_pop_parser_context): Add at end of list. (find_in_imports, find_in_imports_on_demand): Look in ctxp if the TYPE_IMPORT_LIST or respectively the TYPE_IMPORT_DEMAND_LIST of the given type are NULL. (do_resolve_class): Look into the imports of the new second parameter. Adjust recursive calls. (resolve_class, resolve_inner_class, find_as_inner_class): Adjust calls to do_resolve_class. (create_class): Set the TYPE_IMPORT_LIST and TYPE_IMPORT_DEMAND_LIST. (java_complete_class): Do not do that here. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.3391.2.89&r2=1.3391.2.90 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/Makefile.am.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.455.2.13&r2=1.455.2.14 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/Makefile.in.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.485.2.13&r2=1.485.2.14 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/configure.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.253.2.4&r2=1.253.2.5 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/configure.ac.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.19.2.4&r2=1.19.2.5 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/external/Makefile.in.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1.14.2&r2=1.1.14.3 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/external/sax/Makefile.in.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.2.12.2&r2=1.2.12.3 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/external/w3c_dom/Makefile.in.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.2.12.2&r2=1.2.12.3 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/gcj/Makefile.in.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.62.10.2&r2=1.62.10.3 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/include/Makefile.in.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.64.4.2&r2=1.64.4.3 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/Makefile.in.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.73.10.2&r2=1.73.10.3 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.jacks/jacks.xfail.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.19&r2=1.19.8.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1556.2.27&r2=1.1556.2.28 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/class.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.220.8.3&r2=1.220.8.4 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.103&r2=1.103.18.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.y.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.528.6.2&r2=1.528.6.3