[Buildroot] [WIP PATCH 2/5] gcc-final: disable shared build for static

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Mon May 26 10:24:19 UTC 2014


Dear Gustavo Zacarias,

On Mon, 26 May 2014 07:06:08 -0300, Gustavo Zacarias wrote:

> > No, we want to install .a files as well in my opinion. In fact, the
> > patch series I have to rename BR2_PREFER_STATIC_LIB makes things
> > even clearer, with three possibilities: pure static, static and
> > shared, pure shared.
> 
> Sorry but i didn't see your patchset so relax a bit :)

Yeah, no problem :)

> That being said do we really want a pure dyn scenario? Since we
> purge .a files from the target anyway since they're not required for
> runtime it wouldn't hurt a bit to keep the dual mode and just static
> i think. Regards.

There is an advantage with the pure dynamic scenario: build time.

When you have dyn+static, you build all object files (for packages that
do it correctly): once for static without -fPIC, and once for dynamic
with -fPIC. Here is what I have in my commit log about this:

    For example, a static+shared build of libglib2 takes 1 minutes and
    59 seconds, with a final build directory of 96 MB. A shared-only
    build of libglib2 takes only 1 minutes and 31 seconds (almost a 25%
    reduction of the build time), and the final build directory weights
    89 MB (a reduction of almost 8%).

A 25% reduction in build time is certainly nice for users who don't
care about static libraries, no?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the buildroot mailing list