1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
--- a/gcc/config/gnu-user.h 2011-04-28 18:49:49.000000000 +0200
+++ b/gcc/config/gnu-user.h 2012-09-08 18:22:41.020729353 +0200
@@ -98,3 +98,31 @@ see the files COPYING3 and COPYING.RUNTI
#define TARGET_C99_FUNCTIONS 1
#define TARGET_HAS_SINCOS 1
+
+#ifdef ENABLE_ESPF
+#ifdef ENABLE_ESPF_PIE
+#define ESPF_GCC_PIE_SPEC \
+"%{pie|fpic|fPIC|fpie|fPIE|fno-pic|fno-PIC|fno-pie|fno-PIE| \
+shared|static|nostdlib|nostartfiles:;:-fPIE -pie}"
+#else
+#define ESPF_GCC_PIE_SPEC ""
+#endif
+#ifdef ENABLE_ESPF_SSP
+#define ESPF_GCC_SSP_SPEC \
+"%{nostdlib|nodefaultlibs|fno-stack-protector| \
+fstack-protector|fstack-protector-all:;:-fstack-protector}"
+#else
+#define ESPF_GCC_SSP_SPEC ""
+#endif
+#ifdef ENABLE_ESPF_FORTIFY
+#define ESPF_CPP_UNIQUE_OPTIONS_SPEC \
+"%{D_FORTIFY_SOURCE|D_FORTIFY_SOURCE=*|U_FORTIFY_SOURCE:;:-D_FORTIFY_SOURCE=2}"
+#else
+#define ESPF_CPP_UNIQUE_OPTIONS_SPEC ""
+#endif
+#define ESPF_DRIVER_SELF_SPECS \
+ESPF_GCC_PIE_SPEC, \
+ESPF_GCC_SSP_SPEC
+#define ESPF_EXTRA_SPECS \
+{ "espf_cpp_unique_options", ESPF_CPP_UNIQUE_OPTIONS_SPEC }
+#endif
--- a/gcc/config/i386/gnu-user.h 2011-05-05 14:32:50.000000000 +0200
+++ b/gcc/config/i386/gnu-user.h 2012-07-09 14:28:38.726289455 +0200
@@ -93,9 +93,16 @@ along with GCC; see the file COPYING3.
"--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
#undef SUBTARGET_EXTRA_SPECS
+#ifdef ENABLE_ESPF
#define SUBTARGET_EXTRA_SPECS \
{ "link_emulation", GNU_USER_LINK_EMULATION },\
- { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
+ { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }, \
+ ESPF_EXTRA_SPECS
+#else
+#define SUBTARGET_EXTRA_SPECS \
+ { "link_emulation", GNU_USER_LINK_EMULATION },\
+ { "dynamic_linker", GNU_USER_DYNAMIC_LINKER }
+#endif
#undef LINK_SPEC
#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
@@ -202,3 +159,7 @@ along with GCC; see the file COPYING3.
#define TARGET_CAN_SPLIT_STACK
#define TARGET_THREAD_SPLIT_STACK_OFFSET 0x30
#endif
+
+#ifdef ENABLE_ESPF
+#define DRIVER_SELF_SPECS ESPF_DRIVER_SELF_SPECS
+#endif
--- gcc-4.8-20120302/gcc/config/i386/gnu-user64.h 2012-06-30 00:21:30.000000000 +0200
+++ gcc-4.8-20120302-work/gcc/config/i386/gnu-user64.h 2012-09-08 18:14:03.683713936 +0200
@@ -94,3 +94,7 @@ see the files COPYING3 and COPYING.RUNTI
#undef WCHAR_TYPE
#define WCHAR_TYPE (TARGET_LP64 ? "int" : "long int")
+
+#ifdef ENABLE_ESPF
+#define DRIVER_SELF_SPECS ESPF_DRIVER_SELF_SPECS
+#endif
--- a/gcc/config/i386/i386.h 2011-11-24 23:11:12.000000000 +0100
+++ b/gcc/config/i386/i386.h 2012-07-09 14:21:24.575276517 +0200
@@ -617,13 +617,16 @@ enum target_cpu_default
Do not define this macro if it does not need to do anything. */
#ifndef SUBTARGET_EXTRA_SPECS
+#ifdef ENABLE_ESPF
+#define SUBTARGET_EXTRA_SPECS ESPF_EXTRA_SPECS
+#else
#define SUBTARGET_EXTRA_SPECS
#endif
+#endif
#define EXTRA_SPECS \
{ "cc1_cpu", CC1_CPU_SPEC }, \
SUBTARGET_EXTRA_SPECS
-
/* Set the value of FLT_EVAL_METHOD in float.h. When using only the
FPU, assume that the fpcw is set to extended precision; when using
|