From e58a7b24e97bdb99b881cb21e4896e18f66461e2 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Thu, 19 Nov 2015 16:25:44 +0100 Subject: [PATCH] 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. --- common/environment/configure/gccspecs/hardened-cc1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/environment/configure/gccspecs/hardened-cc1 b/common/environment/configure/gccspecs/hardened-cc1 index 47b4792555..f2757592a3 100644 --- a/common/environment/configure/gccspecs/hardened-cc1 +++ b/common/environment/configure/gccspecs/hardened-cc1 @@ -1,2 +1,5 @@ +*cpp_options: ++ %{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}} + *cc1_options: + %{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}