[Xorp-hackers] XORP on memory stringent embedded platform

Pavlin Radoslavov pavlin@icir.org
Thu, 25 Nov 2004 12:43:59 -0800

> I managed to port the multicast subsystem of XORP to a embedded system,
> functionalities including PIM-SM+Mld6igmp+MFEA+lib{xorp,proto,comm,mrt,xrl}.
> The embedded system is memeory stringent (32M). The orignal system image size
> is about 5M (os + app, which contains a lot functionalities implemented using C).
> After add the XORP related functionality, the image grows to about 11M (debugging
> information stripped) and the system free memory fall down to a low level.
> So I doubt if I should port other part of XORP system to that embedded platform. 
> I guess the main reason is because XORP is written in C++. Does the big image size
> related to stl/template ? Is there good ways to reduce XORP image size? 
> (BTW, I have tried -Os option, but the compiler seems too old to support that.
>  May be I should upgrade the compiler.)

I just did two compilations (using gcc-3.4.2) with the -O2 flag and
the -Os flag respectively. The size of the stripped pim/test_pim
stand-alone binary (which contains all multicast-related stuff) with
the -O2 flag is 6.4MB. The size with the -Os flag is 5.8MB.
Of course, there is no guarantee that you will similar size
reduction if you upgrade your compiler, but it may be worth to try.

Does your system supports dynamic libraries? If yes, then using
XORP dynamic libraries can also help to reduce the size (see the
previous email on the subject by Bruce who is working right now on
enabling dynamic linkage).