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.
This commit is contained in:
parent
0e99e3b00d
commit
882f23cf98
2 changed files with 22 additions and 15 deletions
8
common/environment/configure/gccspecs/hardened-mips-cc1
Normal file
8
common/environment/configure/gccspecs/hardened-mips-cc1
Normal file
|
@ -0,0 +1,8 @@
|
|||
*cpp_options:
|
||||
+ %{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE -mshared}}}}}
|
||||
|
||||
*cc1_options:
|
||||
+ %{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE -mshared}}}}}
|
||||
|
||||
*asm_options:
|
||||
+ %{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-mshared}}}}}
|
Loading…
Add table
Add a link
Reference in a new issue