public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* how to compile glibc with -fPIC?
@ 2013-10-07  6:50 CNZhangQuan
  2013-10-07 17:20 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: CNZhangQuan @ 2013-10-07  6:50 UTC (permalink / raw)
  To: gcc-help

hi,

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?
or maybe i should ask is it possible to gen a shared library with
static toolchain?


thanks
Quan
2013-10-07

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: how to compile glibc with -fPIC?
  2013-10-07  6:50 how to compile glibc with -fPIC? CNZhangQuan
@ 2013-10-07 17:20 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2013-10-07 17:20 UTC (permalink / raw)
  To: CNZhangQuan; +Cc: gcc-help

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-07 17:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-07  6:50 how to compile glibc with -fPIC? CNZhangQuan
2013-10-07 17:20 ` Ian Lance Taylor

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