Simon Stelling wrote:
> 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.
>
Well, then I have to simplify more (because of my lack of knowledge) and
ask what are the pros and cons to use PIC when building a program and a
share library?

-- 
Best regards,
Daniel


-- 
gentoo-amd64@gentoo.org mailing list

Reply via email to