Every once in a while, on a multi-cpu machine, with high -j values, frysk build mysteriously dies with this synopsis: <obnoxious gcj command, entwined in shellouts, checks and scripts> ../../frysk-sys/lib/dwfl/DwarfDieFactory.java:76: error: Type ‘DwTag’ not found in the declaration of the local variable ‘tagEncodings’. DwTag[] tagEncodings = DwTag.values(); ^ ../../frysk-sys/lib/dwfl/DwarfDieFactory.java:82: error: Type ‘DwTag’ not found in the declaration of the local variable ‘tag’. DwTag tag = tagEncodings[i]; ^ 2 errors make[1]: *** [lib/dwfl/Dwfl.h] Error 1 make[1]: *** Waiting for unfinished jobs.... chmod a-w lib/dwfl/DwTag.tmp mv -f lib/dwfl/DwTag.tmp lib/dwfl/DwTag.java make[1]: Leaving directory `/usr/src/redhat/BUILD/frysk-0.0.1.2007.09.24/build/frysk-sys' make: *** [all-recursive] Error 1 The problem is that for building Dwfl.h, frysk build system first compiles .class files, and then induces appropriate .h files from them by way of gcjh. This is expressed in .java.h implicit rule. But to build .class files, compiler needs DwTag.java and other files... and this dependency isn't stated in Makefile.
Created attachment 2024 [details] Log file demonstrating the problem.
Is this on Fedora 7? Then it might be related/the same as bug #4742
RHEL 5, gcc-java-4.1.1-52. This doesn't seem to be the case however. Dependency file (Dwfl.Po in this case) is present, and non-empty, but it only describes dependencies of Dwfl.o, not Dwfl.h.
All the generated java files need to be created; before starting on the .h files. Some of the .h source (.java) files may be importing generated .java files.
Make generated .h files order-only dependent on generated .java files. frysk-common/ChangeLog 2007-11-14 Andrew Cagney <cagney@redhat.com> * Makefile.rules (built-sources): New. ($(SCRIPT_BUILT)): New. ($(JAVAH_BUILT)): New. ($(ANTLR_BUILT)): New. * Makefile.gen.sh (SCRIPT_BUILT): New. (JAVAH_BUILT): New.