Commit graph

4 commits

Author SHA1 Message Date
Juan RP 882f23cf98 env/hardening: fix hardening on MIPS.
Thanks to @chneukirchen for finding the correct solution:

gcc sets -mno-shared by default when compiling non-PIC, and because
we are overriding the builtin specs, this internal rule set for gnu/mips
does not trigger:

gcc/config/mips/gnu-user.h:/* Default to -mno-shared for non-PIC.  */
gcc/config/mips/gnu-user.h:  " %{mshared|mno-shared|fpic|fPIC|fpie|fPIE:;:-mno-shared}"

So that we now use a specific specs file just for mips that sets -mshared for PIC.

This fixes building packages with hardening enabled for MIPS.
2016-04-27 15:01:40 +02:00
Christian Neukirchen e58a7b24e9 gccspecs/hardened-cc1: also pass -fPIE to cpp by default.
Note that -fPIE defines __PIC__ and __PIE__, so passing this on to
pure cpp(1)/gcc -E executions is relevant.

Found the hard way due to ccache breaking on i686 with precompiled
headers which used the non-PIC definitions in cpuid.h since header
precompilation doesn't read cc1_options.
2015-11-19 16:30:06 +01:00
Christian Neukirchen cd01759127 defaults.conf: move -z now to hardened-ld only. 2015-03-08 19:57:01 +01:00
Christian Neukirchen ea96fc3cce xbps-src: pass PIE flags via -specs mechanism, avoids breaking static build. 2015-03-07 20:59:50 +01:00