1 |
Robert Moss posted <41A10443.2070108@g.o>, excerpted below, on |
2 |
Sun, 21 Nov 2004 21:10:27 +0000: |
3 |
|
4 |
> No, this is wrong. On amd64, you should *not* use -fPIC in make.conf. |
5 |
> That's been policy since 2004.0. It is required that -fPIC is used for |
6 |
> shared things (such as shared libraries) and it is required that -fPIC is |
7 |
> not used for non-shared things (such as binaries). Thus, it must not be |
8 |
> set in make.conf, otherwise you break this. If something does not compile |
9 |
> without using -fPIC in CFLAGS, then that is a bug. |
10 |
> |
11 |
> Hardened is different, however. |
12 |
> |
13 |
> Duncan wrote: |
14 |
>> No, not all archs follow x86 (or whatever arch rules you are assuming) |
15 |
>> rules. On some archs (amd64 comes to mind as that's what I use), -fPIC |
16 |
>> is required. Gentoo amd64 officially discourages it in make.conf, so as |
17 |
>> to hilite ebuilds which do NOT set it so they can be patched to do so, |
18 |
>> but it's required on the arch, regardless, whether it's configured in |
19 |
>> the source, in the ebuild, or in make.conf, so on some archs anyway, |
20 |
>> it's NOT wrong to have it in make.conf, hardened or not. |
21 |
|
22 |
That's why I said "Gentoo officially discourages". |
23 |
|
24 |
As for required, you are correct that it's "required" for shared libs on |
25 |
amd64. However, you are incorrect in that it's NOT "required that it be |
26 |
OFF for unshared ELF executables, because the fact that I can type this |
27 |
message and send it on such a system, in PAN, on KDE, on X, on Gentoo for |
28 |
amd64, with -fPIC in my CFLAGS when I compiled a good share of |
29 |
what's running, indicates that it cannot be a "requirement" for it to be |
30 |
off in those cases in the same way that it's "required" to be on (on pain |
31 |
of compile error) for libraries. |
32 |
|
33 |
As I stated, "Gentoo officially discourages" setting it in CFLAGS, for bug |
34 |
hunting and reporting reasons, but it works, and some of use use it even |
35 |
on non-hardened (because hardened did NOT work here, couldn't run xorg) |
36 |
because we like the idea of "position independent code" even in our |
37 |
executables, with the fact that it prevents occasional hassles with |
38 |
unpatched libs where it's definitely required, just a very pleasant side |
39 |
effect. |
40 |
|
41 |
-- |
42 |
Duncan - List replies preferred. No HTML msgs. |
43 |
"They that can give up essential liberty to obtain a little |
44 |
temporary safety, deserve neither liberty nor safety." -- |
45 |
Benjamin Franklin |
46 |
|
47 |
|
48 |
|
49 |
-- |
50 |
gentoo-dev@g.o mailing list |