This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Building libstdc++ non-shared with -fpic ?
- To: Ingo Rohloff <lundril at gmx dot net>
- Subject: Re: Building libstdc++ non-shared with -fpic ?
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 30 Jun 2000 12:34:08 -0300
- Cc: gcc at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
- References: <20000630162046.A15548@flashline.chipnet>
On Jun 30, 2000, Ingo Rohloff <lundril@gmx.net> wrote:
> A resolution to this problem seems to compile libstdc++ as
> static library BUT with the -fpic option, so that the code
> included in the static archive is PIC.
PIC code may be far slower than non-PIC code, due to increased
register pressure, so doing that by default is not a good idea. But
there might be an option to do it.
> PS: Some people said that the linker should be able to recognize
> if non PIC is linked to a shared library and complain, but I'm not
> sure if this is possible. Comments ?
Some linkers do, and either complain or arrange for the non-PIC code
to be included in the shared library anyway, even though it may not be
able to share memory pages across multiple processes, for requiring
relocation.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me