This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
gcj exe size competition
- From: Boris Kolar <boris dot kolar at globera dot com>
- To: java at gcc dot gnu dot org
- Date: Wed, 29 Jan 2003 23:36:26 +0100
- Subject: gcj exe size competition
I've just build gcj 3.2.1 (Mingw32) on Cygwin (with very few manual changes in
files "libjava/java/net/natPlainSocketImpl.cc" and "libjava/win32.cc" -see
details at the bottom of this mail).
I followed John Murga's build instructions (look for "GCJ/MingW buld
entirely..." thread on this mailing list), except I used gcc-3.2.1 without patches.
After compiling HelloWorld example, I got exe of length 1027072 bytes. After
compressing it with UPX, i got exe size of 345600 bytes, which is pretty good.
Does anyone have any ideas how to do even better? The options I used when
building gcj:
[configuration]
--enable-languages=c,c++,java
--disable-nls
--disable-debug
--enable-threads=win32
--with-gcc
--with-gnu-as
--with-gnu-ld
--disable-win32-registry
--disable-multilib
--without-newlib
--disable-shared
--enable-libgcj
--disable-java-awt
--disable-java-net
--disable-jvmpi
--without-libffi
--without-x
--enable-java-gc=boehm
--disable-libgcj-debug
--disable-interpreter
--enable-hash-synchronization
[build flags]
BOOT_CFLAGS='-Os -g0 -pipe -fssa'
CFLAGS='-Os -g0 -pipe -fssa'
CXXFLAGS='-Os -g0 -pipe -fssa'
LIBCFLAGS='-Os -g0 -pipe -fssa'
LIBCXXFLAGS='-Os -g0 -pipe -fno-implicit-templates -fssa'
JCFLAGS='-gs -pipe -fssa'
GCJFLAGS='-Os -g0 -pipe -fssa'
LIBGCJ_CFLAGS='-Os -g0 -pipe -fssa'
LIBGCJ_CXXFLAGS='-Os -g0 -pipe -fssa'
DEBUG_FLAGS='-g0'
LDFLAGS='-s'
The changes to official gcj 3.2.1:
file "libjava/net/natPlainSocketImpl.cc":
- replace "#include <winsock.h>" -> "#include <winsock2.h>
- move "#include <java/lang/Thread.h>" line after "#else /* DISABLE_JAVA_NET */"
file "libjava/win32.cc":
- add "#include <stdio.h>"