-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path12-backfire-buildfix-all_cgraph_node-gcc-9.patch
More file actions
100 lines (100 loc) · 4.51 KB
/
Copy path12-backfire-buildfix-all_cgraph_node-gcc-9.patch
File metadata and controls
100 lines (100 loc) · 4.51 KB
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
93
94
95
96
97
98
99
100
diff --git a/toolchain/gcc/patches/4.3.3+cs/all_cgraph_node-gcc-9.patch b/toolchain/gcc/patches/4.3.3+cs/all_cgraph_node-gcc-9.patch
new file mode 100644
index 0000000000..e3eff66cb1
--- /dev/null
+++ b/toolchain/gcc/patches/4.3.3+cs/all_cgraph_node-gcc-9.patch
@@ -0,0 +1,44 @@
+The patch is a workaround to build this version of gcc with
+gcc-9.1.0: https://gcc.gnu.org/PR90677
+
+There gcc-9.1.0 pinned 'cgraph_node' to a wired-in type and
+disallows anything else (function names in this case) to share
+'cgraph_node' name.
+
+Without this patch build fails as:
+gcc-4.6.4/gcc/pretty-print.h:322:6: error: 'cgraph_node' is not defined as a type
+ 322 | ATTRIBUTE_GCC_PPDIAG(2,3);
+ | ^~~~~~~~~~~~~
+--- a/gcc/c-tree.h
++++ b/gcc/c-tree.h
+@@ -633,7 +633,7 @@
+ /* In order for the format checking to accept the C frontend
+ diagnostic framework extensions, you must include this file before
+ toplev.h, not after. */
+-#if GCC_VERSION >= 4001
++#if (GCC_VERSION >= 4001) && (GCC_VERSION < 9001) /* 9.1.0 is buggy: https://gcc.gnu.org/PR90677 */
+ #define ATTRIBUTE_GCC_CDIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m ,n))) ATTRIBUTE_NONNULL(m)
+ #else
+ #define ATTRIBUTE_GCC_CDIAG(m, n) ATTRIBUTE_NONNULL(m)
+--- a/gcc/pretty-print.h
++++ b/gcc/pretty-print.h
+@@ -301,7 +301,7 @@
+
+ /* This header may be included before toplev.h, hence the duplicate
+ definitions to allow for GCC-specific formats. */
+-#if GCC_VERSION >= 3005
++#if (GCC_VERSION >= 3005) && (GCC_VERSION < 9001) /* 9.1.0 is buggy: https://gcc.gnu.org/PR90677 */
+ #define ATTRIBUTE_GCC_PPDIAG(m, n) __attribute__ ((__format__ (__gcc_diag__, m ,n))) ATTRIBUTE_NONNULL(m)
+ #else
+ #define ATTRIBUTE_GCC_PPDIAG(m, n) ATTRIBUTE_NONNULL(m)
+--- a/gcc/toplev.h
++++ b/gcc/toplev.h
+@@ -48,7 +48,7 @@
+ /* None of these functions are suitable for ATTRIBUTE_PRINTF, because
+ each language front end can extend them with its own set of format
+ specifiers. We must use custom format checks. */
+-#if GCC_VERSION >= 4001
++#if (GCC_VERSION >= 4001) && (GCC_VERSION < 9001) /* 9.1.0 is buggy: https://gcc.gnu.org/PR90677 */
+ #define ATTRIBUTE_GCC_DIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m)
+ #else
+ #define ATTRIBUTE_GCC_DIAG(m, n) ATTRIBUTE_NONNULL(m)
diff --git a/toolchain/gcc/patches/4.3.3/all_cgraph_node-gcc-9.patch b/toolchain/gcc/patches/4.3.3/all_cgraph_node-gcc-9.patch
new file mode 100644
index 0000000000..e3eff66cb1
--- /dev/null
+++ b/toolchain/gcc/patches/4.3.3/all_cgraph_node-gcc-9.patch
@@ -0,0 +1,44 @@
+The patch is a workaround to build this version of gcc with
+gcc-9.1.0: https://gcc.gnu.org/PR90677
+
+There gcc-9.1.0 pinned 'cgraph_node' to a wired-in type and
+disallows anything else (function names in this case) to share
+'cgraph_node' name.
+
+Without this patch build fails as:
+gcc-4.6.4/gcc/pretty-print.h:322:6: error: 'cgraph_node' is not defined as a type
+ 322 | ATTRIBUTE_GCC_PPDIAG(2,3);
+ | ^~~~~~~~~~~~~
+--- a/gcc/c-tree.h
++++ b/gcc/c-tree.h
+@@ -633,7 +633,7 @@
+ /* In order for the format checking to accept the C frontend
+ diagnostic framework extensions, you must include this file before
+ toplev.h, not after. */
+-#if GCC_VERSION >= 4001
++#if (GCC_VERSION >= 4001) && (GCC_VERSION < 9001) /* 9.1.0 is buggy: https://gcc.gnu.org/PR90677 */
+ #define ATTRIBUTE_GCC_CDIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m ,n))) ATTRIBUTE_NONNULL(m)
+ #else
+ #define ATTRIBUTE_GCC_CDIAG(m, n) ATTRIBUTE_NONNULL(m)
+--- a/gcc/pretty-print.h
++++ b/gcc/pretty-print.h
+@@ -301,7 +301,7 @@
+
+ /* This header may be included before toplev.h, hence the duplicate
+ definitions to allow for GCC-specific formats. */
+-#if GCC_VERSION >= 3005
++#if (GCC_VERSION >= 3005) && (GCC_VERSION < 9001) /* 9.1.0 is buggy: https://gcc.gnu.org/PR90677 */
+ #define ATTRIBUTE_GCC_PPDIAG(m, n) __attribute__ ((__format__ (__gcc_diag__, m ,n))) ATTRIBUTE_NONNULL(m)
+ #else
+ #define ATTRIBUTE_GCC_PPDIAG(m, n) ATTRIBUTE_NONNULL(m)
+--- a/gcc/toplev.h
++++ b/gcc/toplev.h
+@@ -48,7 +48,7 @@
+ /* None of these functions are suitable for ATTRIBUTE_PRINTF, because
+ each language front end can extend them with its own set of format
+ specifiers. We must use custom format checks. */
+-#if GCC_VERSION >= 4001
++#if (GCC_VERSION >= 4001) && (GCC_VERSION < 9001) /* 9.1.0 is buggy: https://gcc.gnu.org/PR90677 */
+ #define ATTRIBUTE_GCC_DIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m)
+ #else
+ #define ATTRIBUTE_GCC_DIAG(m, n) ATTRIBUTE_NONNULL(m)