Skip to content

Commit f6ebdaa

Browse files
GCC8: Fixing up some attr ordering problems, carrying on from earlier
1 parent a92f4fe commit f6ebdaa

5 files changed

+48
-75
lines changed

patches/b_scripts_gcc-plugins_checker_plugin.c.patch

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ new file mode 100644
33
index 0000000..33f4af8
44
--- /dev/null
55
+++ b/scripts/gcc-plugins/checker_plugin.c
6-
@@ -0,0 +1,493 @@
6+
@@ -0,0 +1,491 @@
77
+/*
88
+ * Copyright 2011-2017 by the PaX Team <pageexec@freemail.hu>
99
+ * Licensed under the GPL v2
@@ -179,21 +179,19 @@ index 0000000..33f4af8
179179
+ return NULL_TREE;
180180
+}
181181
+
182-
+static struct attribute_spec context_attr = {
183-
+ .name = "context",
184-
+ .min_length = 2,
185-
+ .max_length = 3,
186-
+ .decl_required = true,
187-
+ .type_required = false,
188-
+ .function_type_required = false,
189-
+ .handler = handle_context_attribute,
190-
+#if BUILDING_GCC_VERSION >= 4007
191-
+ .affects_type_identity = true
192-
+#endif
193-
+};
182+
+static struct attribute_spec context_attr = { };
194183
+
195184
+static void register_attributes(void *event_data, void *data)
196185
+{
186+
+ context_attr.name = "context";
187+
+ context_attr.min_length = 2;
188+
+ context_attr.max_length = 3;
189+
+ context_attr.decl_required = true;
190+
+ context_attr.handler = handle_context_attribute;
191+
+#if BUILDING_GCC_VERSION >= 4007
192+
+ context_attr.affects_type_identity = true;
193+
+#endif
194+
+
197195
+ register_attribute(&context_attr);
198196
+}
199197
+

patches/b_scripts_gcc-plugins_constify_plugin.c.patch

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ new file mode 100644
33
index 0000000..42f2209
44
--- /dev/null
55
+++ b/scripts/gcc-plugins/constify_plugin.c
6-
@@ -0,0 +1,577 @@
6+
@@ -0,0 +1,567 @@
77
+/*
88
+ * Copyright 2011 by Emese Revfy <re.emese@gmail.com>
99
+ * Copyright 2011-2017 by PaX Team <pageexec@freemail.hu>
@@ -306,34 +306,24 @@ index 0000000..42f2209
306306
+ return NULL_TREE;
307307
+}
308308
+
309-
+static struct attribute_spec no_const_attr = {
310-
+ .name = "no_const",
311-
+ .min_length = 0,
312-
+ .max_length = 0,
313-
+ .decl_required = false,
314-
+ .type_required = false,
315-
+ .function_type_required = false,
316-
+ .handler = handle_no_const_attribute,
309+
+static struct attribute_spec no_const_attr = { };
310+
+
311+
+static struct attribute_spec do_const_attr = { };
312+
+
313+
+static void register_attributes(void *event_data, void *data)
314+
+{
315+
+ no_const_attr.name = "no_const";
316+
+ no_const_attr.handler = handle_no_const_attribute;
317317
+#if BUILDING_GCC_VERSION >= 4007
318-
+ .affects_type_identity = true
318+
+ no_const_attr.affects_type_identity = true;
319319
+#endif
320-
+};
321320
+
322-
+static struct attribute_spec do_const_attr = {
323-
+ .name = "do_const",
324-
+ .min_length = 0,
325-
+ .max_length = 0,
326-
+ .decl_required = false,
327-
+ .type_required = false,
328-
+ .function_type_required = false,
329-
+ .handler = handle_do_const_attribute,
321+
+ do_const_attr.name = "do_const";
322+
+ do_const_attr.handler = handle_do_const_attribute;
330323
+#if BUILDING_GCC_VERSION >= 4007
331-
+ .affects_type_identity = true
324+
+ do_const_attr.affects_type_identity = true;
332325
+#endif
333-
+};
334326
+
335-
+static void register_attributes(void *event_data, void *data)
336-
+{
337327
+ register_attribute(&no_const_attr);
338328
+ register_attribute(&do_const_attr);
339329
+}

patches/b_scripts_gcc-plugins_rap_plugin_rap_fptr_pass.c.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ new file mode 100644
33
index 0000000..09e1377
44
--- /dev/null
55
+++ b/scripts/gcc-plugins/rap_plugin/rap_fptr_pass.c
6-
@@ -0,0 +1,281 @@
6+
@@ -0,0 +1,280 @@
77
+/*
88
+ * Copyright 2012-2017 by PaX Team <pageexec@freemail.hu>
99
+ * Licensed under the GPL v2

patches/b_scripts_gcc-plugins_rap_plugin_rap_plugin.c.patch

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ new file mode 100644
33
index 0000000..3a3ac17
44
--- /dev/null
55
+++ b/scripts/gcc-plugins/rap_plugin/rap_plugin.c
6-
@@ -0,0 +1,778 @@
6+
@@ -0,0 +1,773 @@
77
+/*
88
+ * Copyright 2012-2017 by PaX Team <pageexec@freemail.hu>
99
+ * Licensed under the GPL v2
@@ -579,21 +579,16 @@ index 0000000..3a3ac17
579579
+ return NULL_TREE;
580580
+}
581581
+
582-
+static struct attribute_spec rap_hash_attr = {
583-
+ .name = "rap_hash",
584-
+ .min_length = 0,
585-
+ .max_length = 0,
586-
+ .decl_required = false,
587-
+ .type_required = true,
588-
+ .function_type_required = false,
589-
+ .handler = handle_rap_hash_attribute,
590-
+#if BUILDING_GCC_VERSION >= 4007
591-
+ .affects_type_identity = true
592-
+#endif
593-
+};
582+
+static struct attribute_spec rap_hash_attr = { };
594583
+
595584
+static void register_attributes(void *event_data __unused, void *data __unused)
596585
+{
586+
+ rap_hash_attr.name = "rap_hash";
587+
+ rap_hash_attr.type_required = true;
588+
+ rap_hash_attr.handler = handle_rap_hash_attribute;
589+
+#if BUILDING_GCC_VERSION >= 4007
590+
+ rap_hash_attr.affects_type_identity = true;
591+
+#endif
597592
+ register_attribute(&rap_hash_attr);
598593
+}
599594
+

patches/b_scripts_gcc-plugins_size_overflow_plugin_size_overflow_plugin.c.patch

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ new file mode 100644
33
index 0000000..f2571bf
44
--- /dev/null
55
+++ b/scripts/gcc-plugins/size_overflow_plugin/size_overflow_plugin.c
6-
@@ -0,0 +1,299 @@
6+
@@ -0,0 +1,289 @@
77
+/*
88
+ * Copyright 2011-2017 by Emese Revfy <re.emese@gmail.com>
99
+ * Licensed under the GPL v2
@@ -132,34 +132,24 @@ index 0000000..f2571bf
132132
+ return NULL_TREE;
133133
+}
134134
+
135-
+static struct attribute_spec size_overflow_attr = {
136-
+ .name = "size_overflow",
137-
+ .min_length = 1,
138-
+ .max_length = -1,
139-
+ .decl_required = true,
140-
+ .type_required = false,
141-
+ .function_type_required = false,
142-
+ .handler = handle_size_overflow_attribute,
143-
+#if BUILDING_GCC_VERSION >= 4007
144-
+ .affects_type_identity = false
145-
+#endif
146-
+};
135+
+static struct attribute_spec size_overflow_attr = { };
147136
+
148-
+static struct attribute_spec intentional_overflow_attr = {
149-
+ .name = "intentional_overflow",
150-
+ .min_length = 1,
151-
+ .max_length = -1,
152-
+ .decl_required = true,
153-
+ .type_required = false,
154-
+ .function_type_required = false,
155-
+ .handler = handle_intentional_overflow_attribute,
156-
+#if BUILDING_GCC_VERSION >= 4007
157-
+ .affects_type_identity = false
158-
+#endif
159-
+};
137+
+static struct attribute_spec intentional_overflow_attr = { };
160138
+
161139
+static void register_attributes(void __unused *event_data, void __unused *data)
162140
+{
141+
+ size_overflow_attr.name = "size_overflow";
142+
+ size_overflow_attr.min_length = 1;
143+
+ size_overflow_attr.max_length = -1;
144+
+ size_overflow_attr.decl_required = true;
145+
+ size_overflow_attr.handler = handle_size_overflow_attribute;
146+
+
147+
+ intentional_overflow_attr.name = "intentional_overflow";
148+
+ intentional_overflow_attr.min_length = 1;
149+
+ intentional_overflow_attr.max_length = -1;
150+
+ intentional_overflow_attr.decl_required = true;
151+
+ intentional_overflow_attr.handler = handle_intentional_overflow_attribute;
152+
+
163153
+ register_attribute(&size_overflow_attr);
164154
+ register_attribute(&intentional_overflow_attr);
165155
+}

0 commit comments

Comments
 (0)