Daniel Iliev wrote:
So, both flags let gcc produce PIC for libs and programs and none of
them lets gcc produce PIC for libs only? The next flag described in the
man page is -fpie, which makes PIC for programs only. Something is wrong
and don't know how to find the right explanation.

The problem is that -fPIC is a code-generating flag, i.e. it applies to the .o object files built. The compiler can't work out whether that object is used in a program or a shared library, so it can't know whether using PIC is a good idea or not.

--
Kind Regards,

Simon Stelling
Gentoo/AMD64 developer
--
gentoo-amd64@gentoo.org mailing list

Reply via email to