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 1/2] package/libabseil-cpp new package
Date: Wed, 22 Jul 2020 09:27:00 +0200	[thread overview]
Message-ID: <20200722092700.76f8decd@windsurf.home> (raw)
In-Reply-To: <20200721214522.3719304-1-aduskett@gmail.com>

Hello Adam,

Thanks for the new iteration.

On Tue, 21 Jul 2020 14:45:21 -0700
aduskett at gmail.com wrote:

> +Because libabseil-cpp builds static libraries, it is better to set the
> +POSITION_INDEPENDENT_CODE to ON instead of forcing fPIC, as forcing fPIC may
> +cause relocation errors when shared libraries link against the built static
> +libraries.

Duh? This doesn't make much sense to me. Did you perhaps misunderstand
what I said in my previous e-mail ?

When building static libraries, -fPIC is normally not needed.

Except when such static libraries end up being linked into a shared
library, in which case all the code of the shared library (which
includes the static library) must have been compiled with -fPIC.

The reason is pretty simple: the load address of shared libraries is
decided at runtime, and it may be different for every program using a
given shared library. Hence the shared library code must be Position
Independent, so that it can run from any memory address.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  parent reply	other threads:[~2020-07-22  7:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21 21:45 [Buildroot] [PATCH v2 1/2] package/libabseil-cpp new package aduskett at gmail.com
2020-07-21 21:45 ` [Buildroot] [PATCH v2 2/2] package/grpc: bump version to 1.30.2 aduskett at gmail.com
2020-07-25 20:44   ` Thomas Petazzoni
2020-07-22  7:27 ` Thomas Petazzoni [this message]
2020-07-25 20:43 ` [Buildroot] [PATCH v2 1/2] package/libabseil-cpp new package Thomas Petazzoni

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=20200722092700.76f8decd@windsurf.home \
    --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