summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/grub
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2019-05-07 16:11:41 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-08 22:56:45 +0100
commit0a219f449a3afe298f6f1bbf06c0cac18e008026 (patch)
treefc1b8042cceab128a67bc2c344d3a2b238e5770a /meta/recipes-bsp/grub
parent624ba02f5f1ecc228beab6eac63dbf219f23ec7b (diff)
downloadpoky-0a219f449a3afe298f6f1bbf06c0cac18e008026.tar.gz
grub: Use -Wno-error instead of doing this on a per-warning basis
In practice the warnings were disabled individually instead of fixes added, so just make all warnings non-fatal to achieve the same. (From OE-Core rev: 330fc83d4519da3c13eb55e8c060ba3e191c9906) Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp/grub')
-rw-r--r--meta/recipes-bsp/grub/files/disable-address-of-packed-member.patch262
-rw-r--r--meta/recipes-bsp/grub/files/fix.build.with.gcc-7.patch39
-rw-r--r--meta/recipes-bsp/grub/files/fix.build.with.squashfs.patch24
-rw-r--r--meta/recipes-bsp/grub/grub-efi_2.02.bb4
-rw-r--r--meta/recipes-bsp/grub/grub2.inc5
5 files changed, 2 insertions, 332 deletions
diff --git a/meta/recipes-bsp/grub/files/disable-address-of-packed-member.patch b/meta/recipes-bsp/grub/files/disable-address-of-packed-member.patch
deleted file mode 100644
index 415f52ebe3..0000000000
--- a/meta/recipes-bsp/grub/files/disable-address-of-packed-member.patch
+++ /dev/null
@@ -1,262 +0,0 @@
1Disable address-of-packed-member warnings with gcc9
2
3gcc9 has turned this warning into error when -Werror is used, lets paper
4it over by turning it into a warning for now
5
6Fixes
7 error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member]
8
9Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11--- a/grub-core/commands/lsacpi.c
12+++ b/grub-core/commands/lsacpi.c
13@@ -26,6 +26,9 @@
14 #include <grub/dl.h>
15
16 #pragma GCC diagnostic ignored "-Wcast-align"
17+#if __GNUC__ >= 9
18+#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
19+#endif
20
21 GRUB_MOD_LICENSE ("GPLv3+");
22
23--- a/grub-core/commands/lspci.c
24+++ b/grub-core/commands/lspci.c
25@@ -26,6 +26,9 @@
26
27 GRUB_MOD_LICENSE ("GPLv3+");
28
29+#if __GNUC__ >= 9
30+#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
31+#endif
32 struct grub_pci_classname
33 {
34 int class;
35@@ -171,7 +174,7 @@ grub_lspci_iter (grub_pci_device_t dev,
36
37 if (space == 0)
38 continue;
39-
40+
41 switch (space & GRUB_PCI_ADDR_SPACE_MASK)
42 {
43 case GRUB_PCI_ADDR_SPACE_IO:
44@@ -195,13 +198,13 @@ grub_lspci_iter (grub_pci_device_t dev,
45 (space & GRUB_PCI_ADDR_MEM_MASK),
46 space & GRUB_PCI_ADDR_MEM_PREFETCH
47 ? "prefetchable" : "non-prefetchable");
48-
49+
50 }
51 else
52 grub_printf ("\t32-bit memory space %d at 0x%016llx [%s]\n",
53 (unsigned) ((reg - GRUB_PCI_REG_ADDRESSES)
54 / sizeof (grub_uint32_t)) - 1,
55- (unsigned long long)
56+ (unsigned long long)
57 (space & GRUB_PCI_ADDR_MEM_MASK),
58 space & GRUB_PCI_ADDR_MEM_PREFETCH
59 ? "prefetchable" : "non-prefetchable");
60--- a/grub-core/fs/cpio_common.c
61+++ b/grub-core/fs/cpio_common.c
62@@ -26,7 +26,9 @@
63 #include <grub/archelp.h>
64
65 GRUB_MOD_LICENSE ("GPLv3+");
66-
67+#if __GNUC__ >= 9
68+#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
69+#endif
70 struct grub_archelp_data
71 {
72 grub_disk_t disk;
73@@ -108,7 +110,7 @@ grub_cpio_get_link_target (struct grub_a
74 if (!ret)
75 return NULL;
76
77- err = grub_disk_read (data->disk, 0, data->dofs, data->size,
78+ err = grub_disk_read (data->disk, 0, data->dofs, data->size,
79 ret);
80 if (err)
81 {
82--- a/grub-core/fs/hfs.c
83+++ b/grub-core/fs/hfs.c
84@@ -32,6 +32,9 @@
85 #include <grub/fshelp.h>
86
87 GRUB_MOD_LICENSE ("GPLv3+");
88+#if __GNUC__ >= 9
89+#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
90+#endif
91
92 #define GRUB_HFS_SBLOCK 2
93 #define GRUB_HFS_EMBED_HFSPLUS_SIG 0x482B
94@@ -882,7 +885,7 @@ grub_hfs_iterate_dir_it_dir (struct grub
95 {
96 struct grub_hfs_catalog_key *ckey = rec->key;
97 struct grub_hfs_iterate_dir_node_found_ctx *ctx = hook_arg;
98-
99+
100 /* Stop when the entries do not match anymore. */
101 if (ckey->parent_dir != ctx->dir_be)
102 return 1;
103@@ -1076,7 +1079,7 @@ macroman_to_utf8 (char *to, const grub_u
104 {
105 *optr++ = ':';
106 continue;
107- }
108+ }
109 if (!(*iptr & 0x80))
110 {
111 *optr++ = *iptr;
112@@ -1093,7 +1096,7 @@ utf8_to_macroman (grub_uint8_t *to, cons
113 grub_uint8_t *end = to + 31;
114 grub_uint8_t *optr = to;
115 const char *iptr = from;
116-
117+
118 while (*iptr && optr < end)
119 {
120 int i, clen;
121@@ -1103,7 +1106,7 @@ utf8_to_macroman (grub_uint8_t *to, cons
122 *optr++ = '/';
123 iptr++;
124 continue;
125- }
126+ }
127 if (!(*iptr & 0x80))
128 {
129 *optr++ = *iptr++;
130@@ -1164,7 +1167,7 @@ lookup_file (grub_fshelp_node_t dir,
131 *foundnode = grub_malloc (sizeof (struct grub_fshelp_node));
132 if (!*foundnode)
133 return grub_errno;
134-
135+
136 (*foundnode)->inode = grub_be_to_cpu32 (fdrec.dir.dirid);
137 (*foundnode)->fdrec = fdrec;
138 (*foundnode)->data = dir->data;
139@@ -1265,7 +1268,7 @@ grub_hfs_dir (grub_device_t device, cons
140 .hook_data = hook_data
141 };
142 grub_fshelp_node_t found = NULL;
143-
144+
145 grub_dl_ref (my_mod);
146
147 data = grub_hfs_mount (device->disk);
148@@ -1294,7 +1297,7 @@ grub_hfs_open (struct grub_file *file, c
149 {
150 struct grub_hfs_data *data;
151 grub_fshelp_node_t found = NULL;
152-
153+
154 grub_dl_ref (my_mod);
155
156 data = grub_hfs_mount (file->device->disk);
157--- a/grub-core/fs/hfsplus.c
158+++ b/grub-core/fs/hfsplus.c
159@@ -19,7 +19,7 @@
160
161 /* HFS+ is documented at http://developer.apple.com/technotes/tn/tn1150.html */
162
163-#define grub_fshelp_node grub_hfsplus_file
164+#define grub_fshelp_node grub_hfsplus_file
165 #include <grub/err.h>
166 #include <grub/file.h>
167 #include <grub/mm.h>
168@@ -34,6 +34,9 @@
169
170 GRUB_MOD_LICENSE ("GPLv3+");
171
172+#if __GNUC__ >= 9
173+#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
174+#endif
175 /* The type of node. */
176 enum grub_hfsplus_btnode_type
177 {
178@@ -145,7 +148,7 @@ grub_hfsplus_read_block (grub_fshelp_nod
179 {
180 struct grub_hfsplus_btnode *nnode = 0;
181 grub_disk_addr_t blksleft = fileblock;
182- struct grub_hfsplus_extent *extents = node->compressed
183+ struct grub_hfsplus_extent *extents = node->compressed
184 ? &node->resource_extents[0] : &node->extents[0];
185
186 while (1)
187@@ -461,7 +464,7 @@ grub_hfsplus_cmp_extkey (struct grub_hfs
188
189 if (extkey_a->type < extkey_b->type)
190 return -1;
191-
192+
193 akey = grub_be_to_cpu32 (extkey_a->start);
194 if (akey > extkey_b->start)
195 return 1;
196@@ -548,7 +551,7 @@ grub_hfsplus_btree_search (struct grub_h
197 struct grub_hfsplus_key_internal *key,
198 int (*compare_keys) (struct grub_hfsplus_key *keya,
199 struct grub_hfsplus_key_internal *keyb),
200- struct grub_hfsplus_btnode **matchnode,
201+ struct grub_hfsplus_btnode **matchnode,
202 grub_off_t *keyoffset)
203 {
204 grub_uint64_t currnode;
205--- a/grub-core/fs/jfs.c
206+++ b/grub-core/fs/jfs.c
207@@ -28,6 +28,9 @@
208 #include <grub/i18n.h>
209
210 GRUB_MOD_LICENSE ("GPLv3+");
211+#if __GNUC__ >= 9
212+#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
213+#endif
214
215 #define GRUB_JFS_MAX_SYMLNK_CNT 8
216 #define GRUB_JFS_FILETYPE_MASK 0170000
217--- a/grub-core/kern/efi/efi.c
218+++ b/grub-core/kern/efi/efi.c
219@@ -29,6 +29,9 @@
220 #include <grub/mm.h>
221 #include <grub/loader.h>
222
223+#if __GNUC__ >= 9
224+#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
225+#endif
226 /* The handle of GRUB itself. Filled in by the startup code. */
227 grub_efi_handle_t grub_efi_image_handle;
228
229@@ -201,7 +204,7 @@ grub_efi_set_variable(const char *var, c
230
231 r = grub_efi_system_table->runtime_services;
232
233- status = efi_call_5 (r->set_variable, var16, guid,
234+ status = efi_call_5 (r->set_variable, var16, guid,
235 (GRUB_EFI_VARIABLE_NON_VOLATILE
236 | GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS
237 | GRUB_EFI_VARIABLE_RUNTIME_ACCESS),
238--- a/grub-core/loader/efi/chainloader.c
239+++ b/grub-core/loader/efi/chainloader.c
240@@ -41,6 +41,9 @@
241 #endif
242
243 GRUB_MOD_LICENSE ("GPLv3+");
244+#if __GNUC__ >= 9
245+#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
246+#endif
247
248 static grub_dl_t my_mod;
249
250--- a/grub-core/commands/usbtest.c
251+++ b/grub-core/commands/usbtest.c
252@@ -63,6 +63,10 @@ static const char *usb_devspeed[] =
253 "High"
254 };
255
256+#if __GNUC__ >= 9
257+#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
258+#endif
259+
260 static grub_usb_err_t
261 grub_usb_get_string (grub_usb_device_t dev, grub_uint8_t index, int langid,
262 char **string)
diff --git a/meta/recipes-bsp/grub/files/fix.build.with.gcc-7.patch b/meta/recipes-bsp/grub/files/fix.build.with.gcc-7.patch
deleted file mode 100644
index f35df97bfc..0000000000
--- a/meta/recipes-bsp/grub/files/fix.build.with.gcc-7.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1* e.g. with gentoo gcc-7.1 they define _FORTIFY_SOURCE by default with:
2 https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/src/patchsets/gcc/7.1.0/gentoo/10_all_default-fortify-source.patch?view=markup
3 which results in following error while building grub-efi-native:
4 ./config-util.h:1504:48: error: this use of "defined" may not be portable [-Werror=expansion-to-defined]
5 || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
6 ^~~~~~~~~~~~~~~
7 this part comes from gnulib and it's used only for Apple and BSD,
8 so we can ignore it, but we cannot add -Wno-error=expansion-to-defined
9 because this warning was introduced only in gcc-7 and older gcc
10 will fail with:
11 cc1: error: -Werror=expansion-to-defined: no option -Wexpansion-to-defined
12 use #pragma to work around this
13
14Upstream-Status: Pending (should be fixed in gnulib which is then rarely updated in grub)
15
16Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
17
18diff -uNr grub-2.02.old/m4/extern-inline.m4 grub-2.02/m4/extern-inline.m4
19--- grub-2.02.old/m4/extern-inline.m4 2016-02-28 15:22:21.000000000 +0100
20+++ grub-2.02/m4/extern-inline.m4 2017-08-22 19:26:45.213637276 +0200
21@@ -39,6 +39,10 @@
22 OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
23 for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
24 Assume DragonFly and FreeBSD will be similar. */
25+#pragma GCC diagnostic push
26+#if __GNUC__ >= 7
27+#pragma GCC diagnostic ignored "-Wexpansion-to-defined"
28+#endif
29 #if (((defined __APPLE__ && defined __MACH__) \
30 || defined __DragonFly__ || defined __FreeBSD__) \
31 && (defined __header_inline \
32@@ -50,6 +52,7 @@
33 && defined __GNUC__ && ! defined __cplusplus))))
34 # define _GL_EXTERN_INLINE_STDHEADER_BUG
35 #endif
36+#pragma GCC diagnostic pop
37 #if ((__GNUC__ \
38 ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
39 : (199901L <= __STDC_VERSION__ \
diff --git a/meta/recipes-bsp/grub/files/fix.build.with.squashfs.patch b/meta/recipes-bsp/grub/files/fix.build.with.squashfs.patch
deleted file mode 100644
index 2c2d2ea0b1..0000000000
--- a/meta/recipes-bsp/grub/files/fix.build.with.squashfs.patch
+++ /dev/null
@@ -1,24 +0,0 @@
1When squashfs support is enabled, the build fails with:
2
3../grub-2.02/grub-core/fs/squash4.c: In function 'direct_read':
4../grub-2.02/grub-core/fs/squash4.c:868:10: error: 'err' may be used uninitialized in this function [-Werror=maybe-uninitialized]
5 if (err)
6 ^
7cc1: all warnings being treated as errors
8Makefile:7272: recipe for target 'grub-core/fs/libgrubmods_a-squash4.o' failed
9
10Upstream-Status: Pending (should be fixed in gnulib which is then rarely updated in grub)
11
12Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
13
14--- grub-2.02/grub-core/fs/squash4.c 2019-03-10 20:00:14.070468728 +0000
15+++ grub-2.02.fixed/grub-core/fs/squash4.c 2019-03-10 19:58:31.382477818 +0000
16@@ -746,7 +746,7 @@
17 struct grub_squash_cache_inode *ino,
18 grub_off_t off, char *buf, grub_size_t len)
19 {
20- grub_err_t err;
21+ grub_err_t err = 0;
22 grub_off_t cumulated_uncompressed_size = 0;
23 grub_uint64_t a = 0;
24 grub_size_t i;
diff --git a/meta/recipes-bsp/grub/grub-efi_2.02.bb b/meta/recipes-bsp/grub/grub-efi_2.02.bb
index 6dbd23a3c7..0028a9b6eb 100644
--- a/meta/recipes-bsp/grub/grub-efi_2.02.bb
+++ b/meta/recipes-bsp/grub/grub-efi_2.02.bb
@@ -41,10 +41,6 @@ inherit deploy
41CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN=" 41CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
42EXTRA_OECONF += "--enable-efiemu=no" 42EXTRA_OECONF += "--enable-efiemu=no"
43 43
44# ldm.c:114:7: error: trampoline generated for nested function 'hook' [-Werror=trampolines]
45# and many other places in the grub code when compiled with some native gcc compilers (specifically, gentoo)
46CFLAGS_append_class-native = " -Wno-error=trampolines"
47
48do_mkimage() { 44do_mkimage() {
49 cd ${B} 45 cd ${B}
50 # Search for the grub.cfg on the local boot media by using the 46 # Search for the grub.cfg on the local boot media by using the
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
index c6994723f9..7d8c280b3f 100644
--- a/meta/recipes-bsp/grub/grub2.inc
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -17,12 +17,9 @@ SRC_URI = "https://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
17 file://autogen.sh-exclude-pc.patch \ 17 file://autogen.sh-exclude-pc.patch \
18 file://grub-module-explicitly-keeps-symbole-.module_license.patch \ 18 file://grub-module-explicitly-keeps-symbole-.module_license.patch \
19 file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \ 19 file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \
20 file://fix.build.with.gcc-7.patch \
21 file://gcc8.patch \ 20 file://gcc8.patch \
22 file://0001-x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch \ 21 file://0001-x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch \
23 file://0001-grub-setup-Debug-message-cleanup.patch \ 22 file://0001-grub-setup-Debug-message-cleanup.patch \
24 file://disable-address-of-packed-member.patch \
25 file://fix.build.with.squashfs.patch \
26" 23"
27SRC_URI[md5sum] = "1116d1f60c840e6dbd67abbc99acb45d" 24SRC_URI[md5sum] = "1116d1f60c840e6dbd67abbc99acb45d"
28SRC_URI[sha256sum] = "660ee136fbcee08858516ed4de2ad87068bfe1b6b8b37896ce3529ff054a726d" 25SRC_URI[sha256sum] = "660ee136fbcee08858516ed4de2ad87068bfe1b6b8b37896ce3529ff054a726d"
@@ -63,6 +60,8 @@ BUILD_CFLAGS = ""
63BUILD_CXXFLAGS = "" 60BUILD_CXXFLAGS = ""
64BUILD_LDFLAGS = "" 61BUILD_LDFLAGS = ""
65 62
63CFLAGS_append = "-Wno-error"
64
66do_configure_prepend() { 65do_configure_prepend() {
67 # The grub2 configure script uses variables such as TARGET_CFLAGS etc 66 # The grub2 configure script uses variables such as TARGET_CFLAGS etc
68 # for its own purposes. Remove the OE versions from the environment to 67 # for its own purposes. Remove the OE versions from the environment to