GCC 3.3 is released,
containing quite a few changes to GCJ, although not really enough to be useful to most of you. So we’ll have to wait for version 3.4 - which was expected anyway.
New GCJ features:
* The java.sql and javax.sql packages now implement the JDBC 3.0 (JDK 1.4) API.
* The JDK 1.4 assert facility has been implemented.
* The bytecode interpreter is now direct threaded and thus faster.
But contains plenty of bug fixes, there is to many to list but can be found here http://gcc.gnu.org/gcc-3.3/changes.html.
The www.mingw.org version is not yet ready (judging from source forge), but should be soon-ish…
Just to clear up what Jacko is saying:
Here is the most exciting “hello world” program, in java:
public class hello
{
public static void main(String[] args)
{
System.out.println("Hello World");
}
}
Compiling this file using GCJ to produce an .exe file with:
gcj --main=hello -o hello hello.java
Produces a file that is 2,606,061 bytes in size or 2.6Meg !
To remove symbols from the .exe file, compile instead with:
gcj --main=hello -o hello hello.java -Wl,--strip-all
Be careful with the syntax that is an L in the -Wl, it’s also case sensative.
This will produce a file size of 1,816,064 bytes or 1.8 meg.
Using a well known .exe file compressor UPX (Ultimate Packer for eXecutables) by Markus Franz Xaver Johannes Oberhumer (that is just one person) and László Molnár.
This can be located on the UPX web site http://upx.sourceforge.net/.
Using the recommanded switches for best compression :
upx --best --crp-ms=999999 --nrv2d -o hellod.exe hello.exe
Produces a file size of 495,104 bytes or ~483K.
A great improvement on the 2.6 Meg file initially created.
All the best,
Woz.
P.S.
Jacko get back to the revision! You’ll only regret it if you mess up your exams!
Best of luck with them too!