[Expat-discuss] Downsize Expat For Embedded System

Sebastian Pipping webmaster at hartwork.org
Fri Jun 29 18:39:52 CEST 2007


Karl Waclawek wrote:
> cjliarng wrote:
>>   I need to trim the share object down to 100~150KB.
>>   So I tried the following..
>>   My platform is on linux, use gcc for expat 2.0.1.
>>   I have tried to 
>>   Add -DXML_MIN_SIZE for CFLAGS in Makefile.
>>   And #undef XML_DTD, #undef XML_NS in expat_config.h.
>>   It works and trim around 100K away.
>>   However, the output share object libexpat.so is still around 260K.
>>   Is there any thing I can do to make the .so down to around 100K?
>>   Thanks in advanced for any advise~~
>>   
> This is strange indeed. On Windows, the regular size of the Dll is about
> 148KB, without any tricks.
> Any ideas anyone?

------------------------------------------------------------
Stripping the .so file reduces the filesize from
245,563 down to 86,944 at my place and still
seems to work. I ran this command:

$ strip -s ./.libs/libexpat.so.1.5.2

In case it doesn't work after that you could try
stripping just the debug symbols with "-d" instead.



Sebastian


More information about the Expat-discuss mailing list