Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2] lz4: improve static only build support
Date: Sun, 22 Apr 2018 10:28:28 +0200	[thread overview]
Message-ID: <20180422102828.01dd1455@windsurf> (raw)
In-Reply-To: <20180421210510.v4zwz6y57z7stryx@tarshish>

Hello Baruch,

On Sun, 22 Apr 2018 00:05:10 +0300, Baruch Siach wrote:

> > Admittedly, it isn't a huge improvement, but for consistency it would
> > be good to do that.  
> 
> Many other packages build both shared and static libraries when 
> BR2_SHARED_LIBS=y.

Yes, I know. I don't know how strict we want to be about this. Probably
not too much because it doesn't matter that much.

> This particular case is easy enough to fix, though.

Yes, that's the point: for this package, it's super easy to fix, so
it's nice to do it.

> Is there any advantage to not building the static library when 
> BR2_SHARED_LIBS=y other than the small build time reduction?

In some cases there is more than a "small build time reduction".

The object files that go in a shared library must be built with -fPIC.
Such object files can also be used in a static library, but the code is
not as optimized as it could be, and therefore object files that go in
a static library should ideally not be built with -fPIC. I believe some
packages (but not many) do build their object files twice, once with
-fPIC for the shared library, once without -fPIC for the static
library. This creates more than a "small build time reduction".

From the commit log of commit f1d3e09895b245da9d54bbaef36e5de95269034e:

    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%).

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2018-04-22  8:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20  4:52 [Buildroot] [PATCH v2] lz4: improve static only build support Baruch Siach
2018-04-20  6:41 ` Thomas Petazzoni
2018-04-21 21:05   ` Baruch Siach
2018-04-22  8:28     ` Thomas Petazzoni [this message]
2018-04-21 12:45 ` Thomas Petazzoni
2018-04-21 20:50   ` Baruch Siach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180422102828.01dd1455@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox