Re: configure for smallest possible size

Patrick Marchand Latifi <[email protected]> Mon, 28 Nov 2005 11:56:25 -0500
Newsgroups gmane.comp.java.vm.sablevm.general
Message-ID <[email protected]>
Hi,

(cc'd to sablevm-user since this might be useful for other people)

> Philippe Laporte wrote:
> > What are the exact configure options to use to get the smallest 
> >possible executable size regardless of speed?
> 
> >I know what various gcc options and strip can do, so I'd like to 
> know about optionality/size of various modules.
> 

Here's a quick recipe for those of you who need to build SableVM with
a small memory footprint and can't wait for the next release cycle:

1. Download the following branch with subversion :

    svn co svn+ssh://svn.sablevm.org/public/developers/patrick/sandbox/svm-sfp

2.  enable the 'small footprint option' with configure --enable-small-footprint

    cd svm-sfp && ./autogen.sh &&
    ./configure --prefix=/choose/your/path/to/install --enable-small-footprint

3. If you don't want to use the default threading (inlined), you will save another
    ~20K by combining --enable-small-footprint with option --with-threading=direct
   or  --with-threading=switch.  But you  will lose some performance.

4.  Strip the libsablevm shared object.

      cd /choose/your/path/to/install && strip lib/libsablevm.so

The option --enable-small-footprint compiles the project with 'gcc -Os' and
performs some code refactoring in SableVM's internals.  It reduces the footprint
by around 50%.  You can also read a bit more in svm-sfp/doc/small_footprint.txt.

Please let me know if you have any problems.

take care,

-pat