[Xorp-users] Reducing Xorp binary setup size ?

Ben Greear greearb at candelatech.com
Mon Mar 15 06:09:16 PDT 2010


On 03/15/2010 05:41 AM, saurabh wrote:
> Thanks Ben for illustrative msg...
>
> Well I compile and installed code git, from your tree on
> my fedora-6 machine with "scons" and "scons install"
>
> It generates total un-stripped size 198 MB, and stripped size 39 MB
> (not 18 MB) in /usr/local/xorp binary directory.
>
> I am using gcc 4.1.1 version on fedora-6. Some additional configuration
> Or patch you made for size reduction?

It seems gcc gets better the newer it is.  I was testing on Fedora 12:

[root at grok xorp.ct]# du -m /usr/local/xorp
2	/usr/local/xorp/sbin
1	/usr/local/xorp/share/xorp/templates
1	/usr/local/xorp/share/xorp
1	/usr/local/xorp/share
2	/usr/local/xorp/lib/xorp/sbin
1	/usr/local/xorp/lib/xorp/bin
13	/usr/local/xorp/lib/xorp/lib
16	/usr/local/xorp/lib/xorp
16	/usr/local/xorp/lib
18	/usr/local/xorp

gcc --version
gcc (GCC) 4.4.3 20100127 (Red Hat 4.4.3-4)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


FC8 isn't quite so good:

[greearb at fs2 corporate]$ du -m /usr/local/xorp/
16	/usr/local/xorp/lib/xorp/lib
1	/usr/local/xorp/lib/xorp/bin
3	/usr/local/xorp/lib/xorp/sbin
19	/usr/local/xorp/lib/xorp
19	/usr/local/xorp/lib
1	/usr/local/xorp/share/xorp/templates
1	/usr/local/xorp/share/xorp
1	/usr/local/xorp/share
3	/usr/local/xorp/sbin
22	/usr/local/xorp/

[greearb at fs2 corporate]$ gcc --version
gcc (GCC) 4.1.2 20070925 (Red Hat 4.1.2-33)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


I'm using the 'lf_pkg.bash' script in the root dir of my xorp.ct repo to install
it...it does my stripping, but I don't know if that has anything to do with it
or not.

Also, make sure you 'rm -fr' your /usr/local/xorp before installing in case there
is some old cruft lying around.

Thanks,
Ben

-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



More information about the Xorp-users mailing list