[Guidelines Change] Changes to the Packaging Guidelines

Jakub Jelinek jakub at redhat.com
Thu Sep 22 18:22:48 UTC 2011

On Thu, Sep 22, 2011 at 02:18:10PM -0400, Adam Jackson 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.

Such packages would be broken and would fail to link without hardening
or at least have text relocations too.  Packagers shouldn't rely on
this spec hack to fix up their packaging bugs (or upstream bugs), the hack
should be just about changing position dependent binaries in the executable
into position independent binaries.


More information about the devel mailing list