[C++-sig] Re: Reduce the resulting .so file size
David Abrahams
dave at boost-consulting.com
Wed Dec 29 20:49:29 CET 2004
Jonathan Brandmeyer wrote:
> On Wed, 2004-12-29 at 15:33 -0300, João Paulo Fernandes Farias wrote:
>> Hi!
>>
>> Is there a way to reduce the final .so file size?
>>
>> I've ported pyogre to linux and the final .so file is about 63Mb.
>
> First off, see how much stripping the .so reduces the file size.
> Building with optimization enabled tends to produce much smaller
> extension module code than building without it.
>
> If you want to try something experimental, use this patch to reduce the
> default symbol visibility in your module:
> http://www.nedprod.com/programs/gccvisibility.html
>
> You might be able to get away with using a linker version script as
> described in my post of April 2, 2004 in the thread "Loading
> Boost.Python made bindings is horribly slow?". The caveat to this is
> that it is only really practical if no other module will be using
> symbols from the one that uses this trick. Otherwise, it's a
> maintenance nightmare.
?? I can't see why you'd say that. This patch just makes GCC use the
Windows model, which causes no maintenance hassles in my opinion.
--
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com
More information about the Cplusplus-sig
mailing list