1 diff -ur linux-4.14.orig/scripts/gcc-plugins/gcc-common.h linux-4.14/scripts/gcc-plugins/gcc-common.h
2 --- linux-4.14.orig/scripts/gcc-plugins/gcc-common.h 2018-08-19 21:29:20.298229612 +0000
3 +++ linux-4.14/scripts/gcc-plugins/gcc-common.h 2018-08-19 21:33:02.789227107 +0000
8 +#if BUILDING_GCC_VERSION >= 8000
9 +#include "stringpool.h"
12 #if BUILDING_GCC_VERSION >= 4009
15 diff -ur linux-4.14.orig/scripts/gcc-plugins/latent_entropy_plugin.c linux-4.14/scripts/gcc-plugins/latent_entropy_plugin.c
16 --- linux-4.14.orig/scripts/gcc-plugins/latent_entropy_plugin.c 2018-08-19 21:29:20.301229612 +0000
17 +++ linux-4.14/scripts/gcc-plugins/latent_entropy_plugin.c 2018-08-19 21:50:23.229215392 +0000
19 .decl_required = true,
20 .type_required = false,
21 .function_type_required = false,
22 +#if BUILDING_GCC_VERSION >= 8000
23 + .affects_type_identity = false,
24 .handler = handle_latent_entropy_attribute,
26 #if BUILDING_GCC_VERSION >= 4007
27 - .affects_type_identity = false
29 + .handler = handle_latent_entropy_attribute,
30 + .affects_type_identity = false,
32 + .handler = handle_latent_entropy_attribute,
37 static void register_attributes(void *event_data __unused, void *data __unused)
38 diff -ur linux-4.14.orig/scripts/gcc-plugins/randomize_layout_plugin.c linux-4.14/scripts/gcc-plugins/randomize_layout_plugin.c
39 --- linux-4.14.orig/scripts/gcc-plugins/randomize_layout_plugin.c 2018-08-19 21:29:20.303229612 +0000
40 +++ linux-4.14/scripts/gcc-plugins/randomize_layout_plugin.c 2018-08-19 21:55:33.710211897 +0000
42 // need type declaration
43 .type_required = true,
44 .function_type_required = false,
45 - .handler = handle_randomize_layout_attr,
46 +#if BUILDING_GCC_VERSION >= 8000
47 + .affects_type_identity = true,
48 + .handler = handle_randomize_layout_attr,
50 #if BUILDING_GCC_VERSION >= 4007
51 - .affects_type_identity = true
53 + .handler = handle_randomize_layout_attr,
54 + .affects_type_identity = true,
56 + .handler = handle_randomize_layout_attr,
61 static struct attribute_spec no_randomize_layout_attr = {
63 // need type declaration
64 .type_required = true,
65 .function_type_required = false,
66 - .handler = handle_randomize_layout_attr,
67 +#if BUILDING_GCC_VERSION >= 8000
68 + .affects_type_identity = true,
69 + .handler = handle_randomize_layout_attr,
71 #if BUILDING_GCC_VERSION >= 4007
72 - .affects_type_identity = true
74 + .handler = handle_randomize_layout_attr,
75 + .affects_type_identity = true,
77 + .handler = handle_randomize_layout_attr,
82 static struct attribute_spec randomize_considered_attr = {
84 // need type declaration
85 .type_required = true,
86 .function_type_required = false,
87 - .handler = handle_randomize_considered_attr,
88 +#if BUILDING_GCC_VERSION >= 8000
89 + .affects_type_identity = false,
90 + .handler = handle_randomize_considered_attr,
92 #if BUILDING_GCC_VERSION >= 4007
93 - .affects_type_identity = false
95 + .handler = handle_randomize_considered_attr,
96 + .affects_type_identity = false,
98 + .handler = handle_randomize_considered_attr,
100 +#endif /* >= 8000 */
103 static struct attribute_spec randomize_performed_attr = {
104 @@ -634,10 +655,17 @@
105 // need type declaration
106 .type_required = true,
107 .function_type_required = false,
108 - .handler = handle_randomize_performed_attr,
109 +#if BUILDING_GCC_VERSION >= 8000
110 + .affects_type_identity = false,
111 + .handler = handle_randomize_performed_attr,
113 #if BUILDING_GCC_VERSION >= 4007
114 - .affects_type_identity = false
116 + .handler = handle_randomize_performed_attr,
117 + .affects_type_identity = false,
119 + .handler = handle_randomize_performed_attr,
120 +#endif /* >= 4007 */
121 +#endif /* >= 8000 */
124 static void register_attributes(void *event_data, void *data)
125 diff -ur linux-4.14.orig/scripts/gcc-plugins/structleak_plugin.c linux-4.14/scripts/gcc-plugins/structleak_plugin.c
126 --- linux-4.14.orig/scripts/gcc-plugins/structleak_plugin.c 2018-08-19 21:29:20.304229612 +0000
127 +++ linux-4.14/scripts/gcc-plugins/structleak_plugin.c 2018-08-19 21:51:31.790214620 +0000
129 .decl_required = false,
130 .type_required = false,
131 .function_type_required = false,
132 - .handler = handle_user_attribute,
133 +#if BUILDING_GCC_VERSION >= 8000
134 + .affects_type_identity = true,
135 + .handler = handle_user_attribute,
137 #if BUILDING_GCC_VERSION >= 4007
138 - .affects_type_identity = true
140 + .handler = handle_user_attribute,
141 + .affects_type_identity = true,
143 + .handler = handle_user_attribute,
144 +#endif /* >= 4007 */
145 +#endif /* >= 8000 */
148 static void register_attributes(void *event_data, void *data)