IcedTea Package Size
gnu.andrew at redhat.com
Wed Mar 6 07:26:24 PST 2013
----- Original Message -----
> I've been building JDK6 & 7 the past week with IcedTea and am having
> trouble reducing the size of final JDK. In particular, I care about
> the openjdk.build/j2sdk-image directory.
> When I build the OpenJDK from source using the old build system (i.e.
> ), I get a JDK that results in ~40mb tarballs (excluding doc,
> sample, src.zip, and man from the tarball). I've noticed that the
> major difference is jre/lib/amd64/server/libjvm.so. When I compile
> using the old build system, it results in a ~12mb (uncompressed)
> libjvm.so. When I compile with IcedTea, it's ~150mb (uncompressed).
> I suspect this is related to static/dynamic linking. But, I've gone
> through all the flags in IcedTea's `configure` and I don't see
> anything obvious about linkage that could be causing the size
> difference. In addition, my system JDK is the same version
> (JDK6u27), was built with IcedTea, and has a 12mb libjvm.so.
> For the old build system, I have the following set:
> export HOTSPOT_BUILD_JOBS=`cat /proc/cpuinfo | grep processor | wc
> export PARALLEL_COMPILE_JOBS=`cat /proc/cpuinfo | grep processor | wc
> export BUILD_NUMBER=b20
> export LANG=C
> export ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk
> export ALLOW_DOWNLOADS=true
> export MILESTONE=u27
> export NO_DOCS=true
> export DEBUG_BINARIES=false
> export DEBUG_CLASSFILES=true
> export FULL_DEBUG_SYMBOLS=0
> export ENABLE_FULL_DEBUG_SYMBOLS=0
> export ALT_OBJCOPY=/dev/null
> For IcedTea builds, I've been using the following `configure`:
> ./configure --disable-tests --disable-hotspot-tests --disable-docs
> I also tried using the old build system's environment along with the
> IcedTea build system. None of which had any effect on file size.
> I'm building with Ubuntu 10.04 LTS, gcc 4.4.3, make 3.81.
> Thanks for the help.
IcedTea's libraries are always built with debug information. You can remove
this with strip or better still do:
$ objcopy --only-keep-debug libjvm.so libjvm.so.debug
$ objcopy --strip-debug libjvm.so
$ objcopy --add-gnu-debuglink=libjvm.so.debug libjvm.so
to separate the two.
Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)
PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07
More information about the distro-pkg-dev