Building ant 1.6.5 normally with gcj 4.0.2 works nicely; trying to compile the resulting jar files into a binary fails:
After ant dist: cd bin/lib LINKTO="-L." for i in *.jar; do [ "$i" = "ant-launcher.jar" ] && continue gcj -O2 -fPIC -fjni -findirect-dispatch -shared -Wl,-Bsymbolic -o lib${i/.jar/.so} $i LINKTO="$LINKTO -l${i/.jar/}" done gcj -O2 -fjni -findirect-dispatch -o antbin --main=org.apache.tools.ant.launcher.Launcher ant-launcher.jar $LINKTO results in /tmp/cc5M7IPD.o: In function `main': ccy5f8qg.i:(.text+0x20): undefined reference to `org::apache::tools::ant::launcher::Launcher::class$' collect2: ld returned 1 exit status ant-launcher.jar contains the org.apache.tools.ant.launcher.Launcher class as expected, and can be run perfectly through gij. -- Summary: Can't compile ant 1.6.5 to machine code Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: java AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bero at arklinux dot org GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25021