mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: musl-cross-make: how to build target libraries with -fpic
Date: Wed, 20 Dec 2017 21:03:42 -0500	[thread overview]
Message-ID: <20171221020342.GX1627@brightrain.aerifal.cx> (raw)
In-Reply-To: <a6d49414-4ab4-54f6-3b68-bf8a6fb1b9ae@gmail.com>

On Thu, Dec 21, 2017 at 09:51:21AM +1100, Patrick Oppenlander wrote:
> Hi,
> 
> what is the the right way to build a toolchain with PIC libraries?
> 
> The best I've come up with is to add
> 
> GCC_CONFIG_FOR_TARGET = CFLAGS_FOR_TARGET="-g -O2 -fpic"
> MUSL_CONFIG = CFLAGS="-fpic"
> 
> to my config. But that seems a little over complicated.
> 
> Is there a recommended/better way?

Are you specifically trying to get -fpic instead of -fPIC? As far as I
know, -fPIC is the default for all of the gcc target libraries anyway;
if not all, at least for libgcc (parts of which normally get linked
into most shared libraries and thus need to be pic). If you build gcc
with --enable-default-pie, musl libc.a will also end up as PIC by
default.

Aside from that, the above should work, but you should probably be
using GCC_CONFIG, not GCC_CONFIG_FOR_TARGET. The latter is intended
for the makefiles and your config.mak to automatically build based on
$(TARGET) to meet the ABI requirements of the target you specified,
and replacing it will definitely break some targets.

Rich


      reply	other threads:[~2017-12-21  2:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-20 22:51 Patrick Oppenlander
2017-12-21  2:03 ` Rich Felker [this message]

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=20171221020342.GX1627@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).