xbps-src: pass PIE flags via -specs mechanism, avoids breaking static build.
This commit is contained in:
parent
494316a961
commit
ea96fc3cce
|
@ -1,4 +1,6 @@
|
|||
_GCCSPECSDIR=${XBPS_COMMONDIR}/environment/configure/gccspecs
|
||||
|
||||
if [ -n "$build_pie" ]; then
|
||||
CFLAGS+=" -fPIE"
|
||||
LDFLAGS+=" -pie"
|
||||
CFLAGS+=" -specs=$_GCCSPECSDIR/hardened-cc1"
|
||||
LDFLAGS+=" -specs=$_GCCSPECSDIR/hardened-ld"
|
||||
fi
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
*cc1_options:
|
||||
+ %{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}
|
|
@ -0,0 +1,5 @@
|
|||
*self_spec:
|
||||
+ %{static|Bstatic|shared|Bshareable|i|r|pie|nopie:;:-pie}
|
||||
|
||||
*link:
|
||||
+ %{!static:-z relro}
|
Loading…
Reference in New Issue