This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/53299] libiberty usage of GCC_PICFLAG causes -fPIC to be passed to non-GNU compiler
- From: "skunk at iskunk dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 10 May 2012 20:11:15 +0000
- Subject: [Bug other/53299] libiberty usage of GCC_PICFLAG causes -fPIC to be passed to non-GNU compiler
- Auto-submitted: auto-generated
- References: <bug-53299-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53299
--- Comment #3 from Daniel Richard G. <skunk at iskunk dot org> 2012-05-10 20:11:15 UTC ---
(In reply to comment #2)
> What is the correct option to pass to the vendor compiler in order to get code
> suitable for inclusion in a shared library?
In this case, it's -KPIC.
I don't see that this macro should be necessary, however, given that Libtool
already knows the magic PIC incantation for many systems. Another excerpt from
the bootstrap log (this one with --disable-lto and no -errwarn):
[...]
Configuring stage 1 in ./gcc
configure: creating cache ./config.cache
checking build system type... sparc64-sun-solaris2.8
checking host system type... sparc64-sun-solaris2.8
[...]
checking for objdir... .libs
checking for cc -xarch=v9 -xildoff option to produce PIC... -KPIC -DPIC
checking if cc -xarch=v9 -xildoff PIC flag -KPIC -DPIC works... yes
checking if cc -xarch=v9 -xildoff static flag -Bstatic works... no
checking if cc -xarch=v9 -xildoff supports -c -o file.o... yes
checking if cc -xarch=v9 -xildoff supports -c -o file.o... (cached) yes
checking whether the cc -xarch=v9 -xildoff linker (ld -64) supports shared
libraries... yes
checking dynamic linker characteristics... solaris2.8 ld.so
[...]