public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: CNZhangQuan <cnzhangquan@gmail.com>
Cc: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Re: how to compile glibc with -fPIC?
Date: Mon, 07 Oct 2013 17:20:00 -0000	[thread overview]
Message-ID: <CAKOQZ8xz9K-cF02AAhf3Mn7gkcvD88HcxqdLjFKJbwkmAMaPBQ@mail.gmail.com> (raw)
In-Reply-To: <CACdxSLkW0bf+7x-XRFyaf0RT+OSeOHEqfpXapgrWrYsqpDLucg@mail.gmail.com>

On Sun, Oct 6, 2013 at 11:50 PM, CNZhangQuan <cnzhangquan@gmail.com> wrote:
>
> i want to build a 'static toolchain', with option --disable-shared,
> for no shared library include/depend in the toolchain-self
>
> cause i don't want the target binary runs depend on the toolchain,
> such as libc.so, ld-xxx.so.
>
>
> but when the target binary need the function dlopen, it give a build
> error that libc.a need to recompile with -fPIC
>
>
> so, how to compile glibc with -fPIC?

You will need to ask the glibc developers.  This is the GCC help list,
not the glibc list, and different people work on the different
projects.  When writing to the glibc list you should explain how you
managed to compile glibc *without* -fPIC.


> or maybe i should ask is it possible to gen a shared library with
> static toolchain?

Yes, it is.  To say a "static toolchain" effectively just means using
different defaults.  In fact you could probably do what you want with
just a minor edit of gcc/gcc.c to add -static to LINK_COMMAND_SPEC.
Although you would only want to add it if some option (perhaps
--no-static?) where not present.

Ian

      reply	other threads:[~2013-10-07 17:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-07  6:50 CNZhangQuan
2013-10-07 17:20 ` Ian Lance Taylor [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=CAKOQZ8xz9K-cF02AAhf3Mn7gkcvD88HcxqdLjFKJbwkmAMaPBQ@mail.gmail.com \
    --to=iant@google.com \
    --cc=cnzhangquan@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).