Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] libcap: fix static linking issue
Date: Wed, 16 Oct 2013 18:09:46 +0200	[thread overview]
Message-ID: <20131016180946.00a8b309@skate> (raw)
In-Reply-To: <525AF808.4000207@openwide.fr>

Dear Romain Naour,

On Sun, 13 Oct 2013 21:44:08 +0200, Romain Naour wrote:

> You're right, the static lib isn?t built with -fPIC.
> But the libcap build system build the static and shared libraries,
> even if you don't want one of them.
> 
> The build failure [1] is caused by the missing -fPIC during the build of libcap.so.2.22
> 
> So, we may add -fPIC if BR2_PREFER_STATIC_LIB=y and the shared lib is build correctly
> (ok it's weird)
> Or add a patch for enable/disable separately the static/shared build.

If BR2_PREFER_STATIC_LIB=y, then not shared library should be built at
all. Even though the naming of the option doesn't make it clear for the
moment.

And therefore, when BR2_PREFER_STATIC_LIB=y, passing -fPIC should not
be needed, as we're building only static libraries.

I had a quick look at libcap, and we can easily build only the static
or shared library by doing the $(MAKE) only in $(@D)/libcap, and using
the libcap.a and libcap.so targets. But the install target is not really
adapted to that, so we would have to install things manually.

Maybe a little patch to the libcap/Makefile which understands
BUILD_STATIC and BUILD_SHARED variables would be good.

Best regards,

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

  reply	other threads:[~2013-10-16 16:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-06 20:10 [Buildroot] [PATCH 1/1] libcap: fix static linking issue Romain Naour
2013-10-06 21:29 ` Thomas Petazzoni
2013-10-08  8:11   ` Romain Naour
2013-10-08  8:13     ` Thomas Petazzoni
2013-10-13 19:44       ` Romain Naour
2013-10-16 16:09         ` Thomas Petazzoni [this message]
2013-11-01 17:48 ` Thomas Petazzoni
2013-11-02 15:52   ` Romain Naour

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=20131016180946.00a8b309@skate \
    --to=thomas.petazzoni@free-electrons.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