[Guidelines Change] Changes to the Packaging Guidelines

Adam Jackson ajax at redhat.com
Thu Sep 22 18:18:10 UTC 2011


On Thu, 2011-09-22 at 20:05 +0200, Jakub Jelinek wrote:

> %rename cc1_options rh_cc1_options_old                                                                                                             
>                                                                                                                                                    
> *cc1_options:                                                                                                                                      
> %{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIC}}}}} %(rh_cc1_options_old)                                                                        
> 
> That looks just wrong.  -fpie/-fPIE is in general faster than -fpic/-fPIC,
> because it can assume (non-weak) symbols defined in the object can't be
> overridden.  Without hardening, objects compiled without
> -fpie/-fPIE/-fpic/-fPIC assume that too (and additionally are position
> dependent), so I fail to see why you'd want to default to -fPIC.  You
> certainly want to default to -fPIE.

You can't default to -fPIE because at cc1 time you don't know whether
the object is destined for a DSO or not, -fPIE will produce relocations
that aren't legal in DSOs, and ld isn't awesome enough to convert them
for you.

Although, one could probably argue that if it were going to be in a DSO,
it'd have -fPIC already present.  If we're willing to accept that, then
sure.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://lists.fedoraproject.org/pipermail/devel/attachments/20110922/ef9bf7bb/attachment.bin 


More information about the devel mailing list