[C++-sig] Size difference between .so and .dll files

Christophe Grimault christophe.grimault at novagrid.com
Wed Jun 16 18:16:37 CEST 2004



Niall Douglas wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>On 15 Jun 2004 at 10:28, Christophe Grimault wrote:
>
>  
>
>>We have 2 versions of the same  software. One on linux RH9, and one 
>>Win XP. Both of them compile and work fine. They use several C++ files
>>compiled with boost to interact with Python. On windows, a dll with a
>>size of a few hundreds of ko. On linux, the size for the equivalent
>>.so is a few Mo.
>>
>>Have we missed something ? Any hints to reduce this size, if possible,
>>are welcome !
>>    
>>
>
>1. Use GCC 3.4. This should knock 50% off your binary.
>
I have tried the  gcc-3.4. Compared to gcc-3.2 used before, a .so 
typically goes from 5.4 Mo to 4.0 Mo.

>2. Patch GCC with my patch at 
>http://www.nedprod.com/programs/gccvisibility.html. With -
>fvisibility=hidden this should knock a further few hundred Kb off 
>your binary and produce better quality code too.
>
Thanks for the hint. I did not have the time to try yet !

>
>No matter what you do, the Linux binary will be at least 20% larger 
>than your MSVC binary.
>  
>
Last question. I do not compile my .so with bjam but with a separate 
Makefile, outside of the boost architecture. May be I'm also missing 
something in the Makefile that the Jamfile does !? I think i remember 
that, if I try to compile the same .so, inside the boost architecture, I 
get a big improvement. Uhm ?

Thanks a lot !!

>Cheers,
>Niall
>
>
>
>
>
>-----BEGIN PGP SIGNATURE-----
>Version: idw's PGP-Frontend 4.9.6.1 / 9-2003 + PGP 8.0.2
>
>iQA/AwUBQM+cocEcvDLFGKbPEQLS8wCbBUA+oewaC4wT2JlPiE3ZpB47xBUAoK6o
>y6Gdwodyc/ngkqG3aWpsOLPC
>=sbJi
>-----END PGP SIGNATURE-----
>
>_______________________________________________
>C++-sig mailing list
>C++-sig at python.org
>http://mail.python.org/mailman/listinfo/c++-sig
>
>  
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20040616/29d1b546/attachment.htm>


More information about the Cplusplus-sig mailing list