1 |
Daniel Iliev wrote: |
2 |
> So, both flags let gcc produce PIC for libs and programs and none of |
3 |
> them lets gcc produce PIC for libs only? The next flag described in the |
4 |
> man page is -fpie, which makes PIC for programs only. Something is wrong |
5 |
> and don't know how to find the right explanation. |
6 |
|
7 |
The problem is that -fPIC is a code-generating flag, i.e. it applies to |
8 |
the .o object files built. The compiler can't work out whether that |
9 |
object is used in a program or a shared library, so it can't know |
10 |
whether using PIC is a good idea or not. |
11 |
|
12 |
-- |
13 |
Kind Regards, |
14 |
|
15 |
Simon Stelling |
16 |
Gentoo/AMD64 developer |
17 |
-- |
18 |
gentoo-amd64@g.o mailing list |