1 |
Simon Stelling wrote: |
2 |
> Daniel Iliev wrote: |
3 |
>> So, both flags let gcc produce PIC for libs and programs and none of |
4 |
>> them lets gcc produce PIC for libs only? The next flag described in the |
5 |
>> man page is -fpie, which makes PIC for programs only. Something is wrong |
6 |
>> and don't know how to find the right explanation. |
7 |
> |
8 |
> The problem is that -fPIC is a code-generating flag, i.e. it applies |
9 |
> to the .o object files built. The compiler can't work out whether that |
10 |
> object is used in a program or a shared library, so it can't know |
11 |
> whether using PIC is a good idea or not. |
12 |
> |
13 |
Well, then I have to simplify more (because of my lack of knowledge) and |
14 |
ask what are the pros and cons to use PIC when building a program and a |
15 |
share library? |
16 |
|
17 |
-- |
18 |
Best regards, |
19 |
Daniel |
20 |
|
21 |
|
22 |
-- |
23 |
gentoo-amd64@g.o mailing list |