I installed trunk revision 144128 but it's 'gjar' is broken and causes later revisions of gcc to be un-buildable. # gjar --version jar (GNU Classpath) 0.98-pre # find --version find (GNU findutils) 4.4.0 Installed GCC: # gcc -v Using built-in specs. Target: i386-pc-solaris2.11 Configured with: ../gcc_trunk/configure --build=i386-pc-solaris2.11 --target=i386-pc-solaris2.11 --enable-languages=ada,c,c++,fortran,java,objc,obj-c++ --enable-shared --disable-static --enable-multilib --enable-decimal-float --with-long-double-128 --with-included-gettext --enable-stage1-checking --enable-checking=release --with-tune=k8 --with-cpu=k8 --with-arch=k8 --with-gnu-as --with-as=/usr/local/bin/as --without-gnu-ld --with-ld=/usr/bin/ld --with-gmp=/usr/local --with-mpfr=/usr/local --without-ppl Thread model: posix gcc version 4.4.0 20090212 (experimental) [trunk revision 144128] (GCC) Building GCC: # gcc/xgcc -v Using built-in specs. Target: i386-pc-solaris2.11 Configured with: ../gcc_trunk/configure --build=i386-pc-solaris2.11 --target=i386-pc-solaris2.11 --enable-languages=ada,c,c++,fortran,java,objc,obj-c++ --enable-shared --disable-static --enable-multilib --enable-decimal-float --with-long-double-128 --with-included-gettext --enable-stage1-checking --enable-checking=release --with-tune=k8 --with-cpu=k8 --with-arch=k8 --with-gnu-as --with-as=/usr/local/bin/as --with-gnu-ld --with-ld=/usr/local/bin/ld --with-gmp=/usr/local --with-mpfr=/usr/local --without-ppl Thread model: posix gcc version 4.4.0 20090213 (experimental) [trunk revision 144149] (GCC) The build breaks here: # gmake (many hours) here=`pwd`; cd ../../../../gcc_trunk/libjava/classpath/lib; \ find gnu java javax org sun -name .svn -prune -o -name '*.class' -print | \ gjar -cfM@ $here/libgcj-4.4.0.jar jar: internal error: java.lang.NullPointerException at gnu.classpath.tools.jar.Creator.writeCommandLineEntries(Creator.java:226) at gnu.classpath.tools.jar.Creator.run(Creator.java:244) at gnu.classpath.tools.jar.Main.run(Main.java:276) at gnu.classpath.tools.jar.Main.main(Main.java:284) gmake[5]: *** [libgcj-4.4.0.jar] Error 1 gmake[5]: Leaving directory `/usr/share/src/gcc_build/i386-pc-solaris2.11/amd64/libjava' gmake[4]: *** [all-recursive] Error 1 gmake[4]: Leaving directory `/usr/share/src/gcc_build/i386-pc-solaris2.11/amd64/libjava' gmake[3]: *** [multi-do] Error 1 gmake[3]: Leaving directory `/usr/share/src/gcc_build/i386-pc-solaris2.11/libjava' gmake[2]: *** [all-multi] Error 2 gmake[2]: Leaving directory `/usr/share/src/gcc_build/i386-pc-solaris2.11/libjava' gmake[1]: *** [all-target-libjava] Error 2 gmake[1]: Leaving directory `/usr/share/src/gcc_build' gmake: *** [all] Error 2 # Rob
This Bug stems from the setting of a new signal handler in GC_SysVGetDataStart() and the SIGSEGV is not getting caught. ../gcc_trunk/boehm-gc/os_dep.c : ... GC_setup_temporary_fault_handler(); if (SETJMP(GC_jmp_buf) == 0) { /* Try writing to the address. */ *result = *result; /* SIGSEGV */ GC_reset_fault_handler(); } else { ... A quick workaround is to delete or rename your 'gjar' before gcc's configury detects it. The gcc scripts will workaround the absence of 'gjar' during the build. Rob
I am reducing this from a "BLOCKER" only because there is a simple 'workaround' (and no 'fix') that allows one to easily continue the build without any modification to the source. Lowered to "CRITICAL". Rob
Same problem on my x86_64-linux-gnu system.
Err, libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java is just complete bullshit. Citing: protected Manifest createManifest(Main parameters) throws IOException { if (! parameters.wantManifest) return null; if (parameters.manifestFile != null) { // User specified a manifest file. InputStream contents = new FileInputStream(parameters.manifestFile); return new Manifest(contents); } return new Manifest(); } protected void writeCommandLineEntries(Main parameters, OutputStream os) throws IOException { manifest = createManifest(parameters); /* If no version is specified, provide the same manifest version default * as Sun's jar tool */ Attributes attr = manifest.getMainAttributes(); WTF do you expect to happen when createManifest returns NULL? Well, a crash. Simpler testcase: > gjar-4.4 -cfM - jar: internal error: java.lang.NullPointerException at gnu.classpath.tools.jar.Creator.writeCommandLineEntries(Creator.java:219) at gnu.classpath.tools.jar.Creator.run(Creator.java:244) at gnu.classpath.tools.jar.Main.run(Main.java:276) at gnu.classpath.tools.jar.Main.main(Main.java:284) Diff between what is in gcc 4.3 and what is in gcc 4.4: @@ -222,9 +214,15 @@ throws IOException { manifest = createManifest(parameters); + /* If no version is specified, provide the same manifest version default + * as Sun's jar tool */ + Attributes attr = manifest.getMainAttributes(); + if (attr.getValue(Attributes.Name.MANIFEST_VERSION) == null) + attr.putValue(Attributes.Name.MANIFEST_VERSION.toString(), "1.0"); + attr.putValue("Created-By", System.getProperty("java.version") + + " (" + System.getProperty("java.vendor") + ")"); oh, really? Gosh. So, who owns that brown paperbag?
Same code in GCC trunk. This is a major regression to classpath 0.96.
I guess a simple if (parameters.manifestFile) { } around that offending change would fix it. But the way classpath is handled inside the gcc tree is very unfriendly to simple changes. Tom, can you get this fixed and installed on the 4.4 branch and trunk?
This kind of fix works for me.
(In reply to comment #7) > This kind of fix works for me. I'll leave it (java) to the Experts, so if you like it, commit it. The only useful comment I could make is that I filed this on "2009-02-13". I described it as a "Blocker" or "Critical" and you describe this as a "major regression"; some eights months later we are here ... Thanks for being the one to fix it, Rob
*** Bug 41768 has been marked as a duplicate of this bug. ***
Looks like classpath development is dead. I have a set of files I can drop into the GCC repositories but am not prepared to do a proper classpath update (nor doing the upstream fix). openSUSE packages now have this fixed.
Well, you can at least submit the same patch to classpath-patches, if you haven't done so already. Maybe just Cc: classpath-patches when you submit the patch to java-patches.
Subject: Re: trunk revision 144128 - jar: internal error: java.lang.NullPointerException On Wed, 21 Oct 2009, aph at gcc dot gnu dot org wrote: > ------- Comment #11 from aph at gcc dot gnu dot org 2009-10-21 12:38 ------- > Well, you can at least submit the same patch to classpath-patches, if you > haven't done so already. Maybe just Cc: classpath-patches when you submit the > patch to java-patches. Done.
Oh, it's moderated. Well, so much for the fish.
From the discussion it sounds like this isn't going to make it into a released gcc any time soon. Any chance someone could upload a set of patches that I can apply locally?
Subject: Bug 39177 Author: rguenth Date: Thu Oct 22 15:41:32 2009 New Revision: 153461 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153461 Log: 2009-10-22 Richard Guenther <rguenther@suse.de> PR cp-tools/39177 * tools/gnu/classpath/tools/jar/Creator.java (writeCommandLineEntries): Do not use uninitialized manifest. * tools/classes/gnu/classpath/tools/jar/Creator.class: Re-generated. Modified: trunk/libjava/classpath/ChangeLog trunk/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Creator.class trunk/libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java
Subject: Bug 39177 Author: rguenth Date: Thu Oct 22 15:50:46 2009 New Revision: 153462 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153462 Log: 2009-10-22 Richard Guenther <rguenther@suse.de> PR cp-tools/39177 * tools/gnu/classpath/tools/jar/Creator.java (writeCommandLineEntries): Do not use uninitialized manifest. * tools/classes/gnu/classpath/tools/jar/Creator.class: Re-generated. Modified: branches/gcc-4_4-branch/libjava/classpath/ChangeLog branches/gcc-4_4-branch/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Creator.class branches/gcc-4_4-branch/libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java
Fixed in the GCC copy of classpath.
revision 1.9774 date: 2009-10-22 16:51:18 +0000; author: aph; state: Exp; lines: +12 -0; commitid: 5aOqqFT1hGw5gy8u; 2009-10-22 Andrew Haley <aph@redhat.com> * native/jni/native-lib/cpnet.c (cpnet_addMembership): Fix aliasing warning. (cpnet_dropMembership): Likewise. 2009-10-21 Richard Guenther <rguenther@suse.de> PR cp-tools/39177 * tools/gnu/classpath/tools/jar/Creator.java (writeCommandLineEntries): Do not use uninitialized manifest.
*** Bug 42849 has been marked as a duplicate of this bug. ***
*** Bug 53400 has been marked as a duplicate of this bug. ***