* gcc9.1 and f2fs
@ 2019-05-06 17:15 Neil MacLeod
2019-05-06 17:31 ` Bruce Dubbs
2019-05-06 17:59 ` John Paul Adrian Glaubitz
0 siblings, 2 replies; 14+ messages in thread
From: Neil MacLeod @ 2019-05-06 17:15 UTC (permalink / raw)
To: grub-devel
With the latest grub HEAD (620857c4dccb8f0548cdb855f6b2f46ebea3919e)
I'm getting the following compilation error with gcc-9.1:
/home/ubuntu/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/x86_64-libreelec-linux-gnu-gcc
-DHAVE_CONFIG_H -I. -Wall -W -DGRUB_UTIL=1 -D_FILE_OFFSET_BITS=64
-I./include -DGRUB_FILE=\"grub-core/fs/xfs.c\" -I. -I. -I. -I.
-I./include -I./include -I./grub-core/lib/libgcrypt-grub/src/
-I./grub-core/lib/minilzo -I./grub-core/lib/xzembed
-I./grub-core/lib/zstd -DMINILZO_HAVE_CONFIG_H -D_FILE_OFFSET_BITS=64
-fno-builtin-gettext -Wall -W -Wshadow -Wpointer-arith -Wundef
-Wchar-subscripts -Wcomment -Wdeprecated-declarations
-Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal
-Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit
-Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces
-Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type
-Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs
-Wunknown-pragmas -Wunused -Wunused-function -Wunused-label
-Wunused-parameter -Wunused-value -Wunused-variable -Wwrite-strings
-Wnested-externs -Wstrict-prototypes -Wcast-align -Wextra
-Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast
-Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla
-Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros
-Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs
-Wmissing-prototypes -Wmissing-declarations -Wformat=2 -Werror
-fno-builtin -Wno-undef
-I/home/ubuntu/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include
-fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -MT
grub-core/fs/libgrubmods_a-xfs.o -MD -MP -MF
grub-core/fs/.deps-util/libgrubmods_a-xfs.Tpo -c -o
grub-core/fs/libgrubmods_a-xfs.o `test -f 'grub-core/fs/xfs.c' || echo
'./'`grub-core/fs/xfs.c
grub-core/fs/f2fs.c: In function 'grub_f2fs_label':
grub-core/fs/f2fs.c:1248:60: error: taking address of packed member of
'struct grub_f2fs_superblock' may result in an unaligned pointer value
[-Werror=address-of-packed-member]
1248 | *label = (char *) grub_f2fs_utf16_to_utf8
(data->sblock.volume_name);
| ~~~~~~~~~~~~^~~~~~~~~~~~
cc1: all warnings being treated as errors
make[3]: *** [Makefile:6943: grub-core/fs/libgrubmods_a-f2fs.o] Error 1
make[3]: *** Waiting for unfinished jobs....
Does anyone have a patch?
Full build log: http://ix.io/1Iet
Many thanks!
Neil
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: gcc9.1 and f2fs 2019-05-06 17:15 gcc9.1 and f2fs Neil MacLeod @ 2019-05-06 17:31 ` Bruce Dubbs 2019-05-06 17:36 ` Neil MacLeod 2019-05-06 17:59 ` John Paul Adrian Glaubitz 1 sibling, 1 reply; 14+ messages in thread From: Bruce Dubbs @ 2019-05-06 17:31 UTC (permalink / raw) To: grub-devel On 5/6/19 12:15 PM, Neil MacLeod wrote: > With the latest grub HEAD (620857c4dccb8f0548cdb855f6b2f46ebea3919e) > I'm getting the following compilation error with gcc-9.1: > > /home/ubuntu/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/x86_64-libreelec-linux-gnu-gcc > -DHAVE_CONFIG_H -I. -Wall -W -DGRUB_UTIL=1 -D_FILE_OFFSET_BITS=64 > -I./include -DGRUB_FILE=\"grub-core/fs/xfs.c\" -I. -I. -I. -I. > -I./include -I./include -I./grub-core/lib/libgcrypt-grub/src/ > -I./grub-core/lib/minilzo -I./grub-core/lib/xzembed > -I./grub-core/lib/zstd -DMINILZO_HAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 > -fno-builtin-gettext -Wall -W -Wshadow -Wpointer-arith -Wundef > -Wchar-subscripts -Wcomment -Wdeprecated-declarations > -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal > -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit > -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces > -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type > -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs/error > -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label > -Wunused-parameter -Wunused-value -Wunused-variable -Wwrite-strings > -Wnested-externs -Wstrict-prototypes -Wcast-align -Wextra > -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast > -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla > -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros > -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs > -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -Werror > -fno-builtin -Wno-undef > -I/home/ubuntu/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include > -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -MT > grub-core/fs/libgrubmods_a-xfs.o -MD -MP -MF > grub-core/fs/.deps-util/libgrubmods_a-xfs.Tpo -c -o > grub-core/fs/libgrubmods_a-xfs.o `test -f 'grub-core/fs/xfs.c' || echo > './'`grub-core/fs/xfs.c > grub-core/fs/f2fs.c: In function 'grub_f2fs_label': > grub-core/fs/f2fs.c:1248:60: error: taking address of packed member of > 'struct grub_f2fs_superblock' may result in an unaligned pointer value > [-Werror=address-of-packed-member] > 1248 | *label = (char *) grub_f2fs_utf16_to_utf8 > (data->sblock.volume_name); > | ~~~~~~~~~~~~^~~~~~~~~~~~ > cc1: all warnings being treated as errors > make[3]: *** [Makefile:6943: grub-core/fs/libgrubmods_a-f2fs.o] Error 1 > make[3]: *** Waiting for unfinished jobs.... > > Does anyone have a patch? > > Full build log: http://ix.io/1Iet Try building with ./configure ... --disable-werror -- Bruce ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: gcc9.1 and f2fs 2019-05-06 17:31 ` Bruce Dubbs @ 2019-05-06 17:36 ` Neil MacLeod 0 siblings, 0 replies; 14+ messages in thread From: Neil MacLeod @ 2019-05-06 17:36 UTC (permalink / raw) To: The development of GNU GRUB Hi Bruce I'll give that a try in an hour or two once my build machine is not busy with another job, but presumably this is just for a test as it doesn't seem like a long term fix? Similar errors have all been fixed in code but for some reason this f2fs failure remains. Thanks Neil On Mon, 6 May 2019 at 18:32, Bruce Dubbs <bruce.dubbs@gmail.com> wrote: > > On 5/6/19 12:15 PM, Neil MacLeod wrote: > > With the latest grub HEAD (620857c4dccb8f0548cdb855f6b2f46ebea3919e) > > I'm getting the following compilation error with gcc-9.1: > > > > /home/ubuntu/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/bin/x86_64-libreelec-linux-gnu-gcc > > -DHAVE_CONFIG_H -I. -Wall -W -DGRUB_UTIL=1 -D_FILE_OFFSET_BITS=64 > > -I./include -DGRUB_FILE=\"grub-core/fs/xfs.c\" -I. -I. -I. -I. > > -I./include -I./include -I./grub-core/lib/libgcrypt-grub/src/ > > -I./grub-core/lib/minilzo -I./grub-core/lib/xzembed > > -I./grub-core/lib/zstd -DMINILZO_HAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 > > -fno-builtin-gettext -Wall -W -Wshadow -Wpointer-arith -Wundef > > -Wchar-subscripts -Wcomment -Wdeprecated-declarations > > -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal > > -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit > > -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces > > -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type > > -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs/error > > -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label > > -Wunused-parameter -Wunused-value -Wunused-variable -Wwrite-strings > > -Wnested-externs -Wstrict-prototypes -Wcast-align -Wextra > > -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast > > -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla > > -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros > > -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs > > -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -Werror > > -fno-builtin -Wno-undef > > -I/home/ubuntu/projects/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.1-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include > > -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -MT > > grub-core/fs/libgrubmods_a-xfs.o -MD -MP -MF > > grub-core/fs/.deps-util/libgrubmods_a-xfs.Tpo -c -o > > grub-core/fs/libgrubmods_a-xfs.o `test -f 'grub-core/fs/xfs.c' || echo > > './'`grub-core/fs/xfs.c > > grub-core/fs/f2fs.c: In function 'grub_f2fs_label': > > grub-core/fs/f2fs.c:1248:60: error: taking address of packed member of > > 'struct grub_f2fs_superblock' may result in an unaligned pointer value > > [-Werror=address-of-packed-member] > > 1248 | *label = (char *) grub_f2fs_utf16_to_utf8 > > (data->sblock.volume_name); > > | ~~~~~~~~~~~~^~~~~~~~~~~~ > > cc1: all warnings being treated as errors > > make[3]: *** [Makefile:6943: grub-core/fs/libgrubmods_a-f2fs.o] Error 1 > > make[3]: *** Waiting for unfinished jobs.... > > > > Does anyone have a patch? > > > > Full build log: http://ix.io/1Iet > > Try building with ./configure ... --disable-werror > > -- Bruce > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: gcc9.1 and f2fs 2019-05-06 17:15 gcc9.1 and f2fs Neil MacLeod 2019-05-06 17:31 ` Bruce Dubbs @ 2019-05-06 17:59 ` John Paul Adrian Glaubitz 2019-05-06 18:19 ` Neil MacLeod 2019-05-17 7:13 ` Michael Chang 1 sibling, 2 replies; 14+ messages in thread From: John Paul Adrian Glaubitz @ 2019-05-06 17:59 UTC (permalink / raw) To: Neil MacLeod; +Cc: The development of GNU GRUB [-- Attachment #1: Type: text/plain, Size: 315 bytes --] On 5/6/19 7:15 PM, Neil MacLeod wrote: > Does anyone have a patch? Try the attached patch. Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaubitz@debian.org `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 [-- Attachment #2: 0001-f2fs-Disable-gcc9-Waddress-of-packed-member.patch --] [-- Type: text/x-patch, Size: 994 bytes --] From b0d03dd5605220d0d23d72e662f10ce7b02a54a6 Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Date: Mon, 6 May 2019 19:55:01 +0200 Subject: [PATCH] f2fs: Disable gcc9 -Waddress-of-packed-member --- grub-core/fs/f2fs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/grub-core/fs/f2fs.c b/grub-core/fs/f2fs.c index 1cad2615f..0dd09bc23 100644 --- a/grub-core/fs/f2fs.c +++ b/grub-core/fs/f2fs.c @@ -1235,6 +1235,12 @@ grub_f2fs_utf16_to_utf8 (grub_uint16_t *in_buf_le) return out_buf; } + +#if __GNUC__ >= 9 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Waddress-of-packed-member" +#endif + static grub_err_t grub_f2fs_label (grub_device_t device, char **label) { @@ -1255,6 +1261,10 @@ grub_f2fs_label (grub_device_t device, char **label) return grub_errno; } +#if __GNUC__ >= 9 +#pragma GCC diagnostic pop +#endif + static grub_err_t grub_f2fs_uuid (grub_device_t device, char **uuid) { -- 2.20.1 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: gcc9.1 and f2fs 2019-05-06 17:59 ` John Paul Adrian Glaubitz @ 2019-05-06 18:19 ` Neil MacLeod 2019-05-06 19:58 ` Neil MacLeod 2019-05-17 7:13 ` Michael Chang 1 sibling, 1 reply; 14+ messages in thread From: Neil MacLeod @ 2019-05-06 18:19 UTC (permalink / raw) To: John Paul Adrian Glaubitz; +Cc: The development of GNU GRUB Thanks Adrian - testing with your patch now, will be another hour or so until the build is complete (cross-compiling environment with own toolchain etc.) Just a correction, I'm testing with 4dd4ceec023111a4ccf69f8de6fa0885c6847a35 (current HEAD) - looks like I cut & pasted a rev from a different repo in my original post! Regards Neil On Mon, 6 May 2019 at 18:59, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> wrote: > > On 5/6/19 7:15 PM, Neil MacLeod wrote: > > Does anyone have a patch? > > Try the attached patch. > > Adrian > > -- > .''`. John Paul Adrian Glaubitz > : :' : Debian Developer - glaubitz@debian.org > `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de > `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: gcc9.1 and f2fs 2019-05-06 18:19 ` Neil MacLeod @ 2019-05-06 19:58 ` Neil MacLeod 2019-05-08 0:51 ` Neil MacLeod 0 siblings, 1 reply; 14+ messages in thread From: Neil MacLeod @ 2019-05-06 19:58 UTC (permalink / raw) To: John Paul Adrian Glaubitz; +Cc: The development of GNU GRUB Hi Adrian With your patch, grub now fails to build as follows: fs/f2fs.c: In function 'grub_f2fs_get_block': fs/f2fs.c:864:43: error: 'offset' may be used uninitialized in this function [-Werror=maybe-uninitialized] 864 | return grub_le_to_cpu32 (inode->i_addr[offset[0]]); | ^ cc1: all warnings being treated as errors make[4]: *** [Makefile:33773: fs/f2fs_module-f2fs.o] Error 1 This is the last 1000 lines of the build log with your patch applied: http://ix.io/1IfE And this is the f2fs.c used for the compilation (it includes your patch): http://ix.io/1IfC Many thanks Neil On Mon, 6 May 2019 at 19:19, Neil MacLeod <neil@nmacleod.com> wrote: > > Thanks Adrian - testing with your patch now, will be another hour or > so until the build is complete (cross-compiling environment with own > toolchain etc.) > > Just a correction, I'm testing with > 4dd4ceec023111a4ccf69f8de6fa0885c6847a35 (current HEAD) - looks like I > cut & pasted a rev from a different repo in my original post! > > Regards > Neil > > On Mon, 6 May 2019 at 18:59, John Paul Adrian Glaubitz > <glaubitz@physik.fu-berlin.de> wrote: > > > > On 5/6/19 7:15 PM, Neil MacLeod wrote: > > > Does anyone have a patch? > > > > Try the attached patch. > > > > Adrian > > > > -- > > .''`. John Paul Adrian Glaubitz > > : :' : Debian Developer - glaubitz@debian.org > > `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de > > `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: gcc9.1 and f2fs 2019-05-06 19:58 ` Neil MacLeod @ 2019-05-08 0:51 ` Neil MacLeod 2019-05-08 1:09 ` Neil MacLeod 2019-05-17 7:31 ` Michael Chang 0 siblings, 2 replies; 14+ messages in thread From: Neil MacLeod @ 2019-05-08 0:51 UTC (permalink / raw) To: John Paul Adrian Glaubitz; +Cc: The development of GNU GRUB [-- Attachment #1: Type: text/plain, Size: 2031 bytes --] Adrian I used the attached patch and grub is now building for me with gcc-9.1. I've no idea if this is the right solution, but it does at least work (ie. builds) which is all I require for now as I'm not personally using grub in the distribution I'm building (LibreELEC) and can't actually say if it works at run-time. Many thanks Neil On Mon, 6 May 2019 at 20:58, Neil MacLeod <neil@nmacleod.com> wrote: > > Hi Adrian > > With your patch, grub now fails to build as follows: > > fs/f2fs.c: In function 'grub_f2fs_get_block': > fs/f2fs.c:864:43: error: 'offset' may be used uninitialized in this > function [-Werror=maybe-uninitialized] > 864 | return grub_le_to_cpu32 (inode->i_addr[offset[0]]); > | ^ > cc1: all warnings being treated as errors > make[4]: *** [Makefile:33773: fs/f2fs_module-f2fs.o] Error 1 > > This is the last 1000 lines of the build log with your patch applied: > http://ix.io/1IfE > > And this is the f2fs.c used for the compilation (it includes your > patch): http://ix.io/1IfC > > Many thanks > Neil > > On Mon, 6 May 2019 at 19:19, Neil MacLeod <neil@nmacleod.com> wrote: > > > > Thanks Adrian - testing with your patch now, will be another hour or > > so until the build is complete (cross-compiling environment with own > > toolchain etc.) > > > > Just a correction, I'm testing with > > 4dd4ceec023111a4ccf69f8de6fa0885c6847a35 (current HEAD) - looks like I > > cut & pasted a rev from a different repo in my original post! > > > > Regards > > Neil > > > > On Mon, 6 May 2019 at 18:59, John Paul Adrian Glaubitz > > <glaubitz@physik.fu-berlin.de> wrote: > > > > > > On 5/6/19 7:15 PM, Neil MacLeod wrote: > > > > Does anyone have a patch? > > > > > > Try the attached patch. > > > > > > Adrian > > > > > > -- > > > .''`. John Paul Adrian Glaubitz > > > : :' : Debian Developer - glaubitz@debian.org > > > `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de > > > `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 [-- Attachment #2: f2fs-uninitialized.patch --] [-- Type: application/octet-stream, Size: 1936 bytes --] From a23ded0363c034e73eee85ef0f10200acc761c5e Mon Sep 17 00:00:00 2001 From: MilhouseVH <milhouseVH.github@nmacleod.com> Date: Wed, 8 May 2019 01:43:54 +0100 Subject: [PATCH] grub: add -WWmaybe-uninitialized fix --- ...02-f2fs-Disable-gcc9-Wmaybe-uninitialized.patch | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 packages/tools/grub/patches/grub-0002-f2fs-Disable-gcc9-Wmaybe-uninitialized.patch diff --git a/packages/tools/grub/patches/grub-0002-f2fs-Disable-gcc9-Wmaybe-uninitialized.patch b/packages/tools/grub/patches/grub-0002-f2fs-Disable-gcc9-Wmaybe-uninitialized.patch new file mode 100644 index 0000000..bc2dc90 --- /dev/null +++ b/packages/tools/grub/patches/grub-0002-f2fs-Disable-gcc9-Wmaybe-uninitialized.patch @@ -0,0 +1,39 @@ +From 70fd808f7d502188a6bdade6b6b343fc97ecfac9 Mon Sep 17 00:00:00 2001 +From: MilhouseVH <milhouseVH.github@nmacleod.com> +Date: Wed, 8 May 2019 01:42:27 +0100 +Subject: [PATCH] f2fs: Disable gcc9 -Wmaybe-uninitialized + +--- + grub-core/fs/f2fs.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/grub-core/fs/f2fs.c b/grub-core/fs/f2fs.c +index 644653d..d0308fe 100644 +--- a/grub-core/fs/f2fs.c ++++ b/grub-core/fs/f2fs.c +@@ -848,6 +848,11 @@ grub_f2fs_mount (grub_disk_t disk) + return NULL; + } + ++#if __GNUC__ >= 9 ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" ++#endif ++ + /* Guarantee inline_data was handled by caller. */ + static grub_disk_addr_t + grub_f2fs_get_block (grub_fshelp_node_t node, grub_disk_addr_t block_ofs) +@@ -888,6 +893,10 @@ grub_f2fs_get_block (grub_fshelp_node_t node, grub_disk_addr_t block_ofs) + return block_addr; + } + ++#if __GNUC__ >= 9 ++#pragma GCC diagnostic pop ++#endif ++ + static grub_ssize_t + grub_f2fs_read_file (grub_fshelp_node_t node, + grub_disk_read_hook_t read_hook, void *read_hook_data, +-- +2.7.4 + -- 2.14.1 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: gcc9.1 and f2fs 2019-05-08 0:51 ` Neil MacLeod @ 2019-05-08 1:09 ` Neil MacLeod 2019-05-10 10:56 ` Daniel Kiper 2019-05-17 7:31 ` Michael Chang 1 sibling, 1 reply; 14+ messages in thread From: Neil MacLeod @ 2019-05-08 1:09 UTC (permalink / raw) To: John Paul Adrian Glaubitz; +Cc: The development of GNU GRUB [-- Attachment #1: Type: text/plain, Size: 2297 bytes --] Sorry, wrong patch in previous email - this is the one for grub! Neil On Wed, 8 May 2019 at 01:51, Neil MacLeod <neil@nmacleod.com> wrote: > > Adrian > > I used the attached patch and grub is now building for me with gcc-9.1. > > I've no idea if this is the right solution, but it does at least work > (ie. builds) which is all I require for now as I'm not personally > using grub in the distribution I'm building (LibreELEC) and can't > actually say if it works at run-time. > > Many thanks > Neil > > > On Mon, 6 May 2019 at 20:58, Neil MacLeod <neil@nmacleod.com> wrote: > > > > Hi Adrian > > > > With your patch, grub now fails to build as follows: > > > > fs/f2fs.c: In function 'grub_f2fs_get_block': > > fs/f2fs.c:864:43: error: 'offset' may be used uninitialized in this > > function [-Werror=maybe-uninitialized] > > 864 | return grub_le_to_cpu32 (inode->i_addr[offset[0]]); > > | ^ > > cc1: all warnings being treated as errors > > make[4]: *** [Makefile:33773: fs/f2fs_module-f2fs.o] Error 1 > > > > This is the last 1000 lines of the build log with your patch applied: > > http://ix.io/1IfE > > > > And this is the f2fs.c used for the compilation (it includes your > > patch): http://ix.io/1IfC > > > > Many thanks > > Neil > > > > On Mon, 6 May 2019 at 19:19, Neil MacLeod <neil@nmacleod.com> wrote: > > > > > > Thanks Adrian - testing with your patch now, will be another hour or > > > so until the build is complete (cross-compiling environment with own > > > toolchain etc.) > > > > > > Just a correction, I'm testing with > > > 4dd4ceec023111a4ccf69f8de6fa0885c6847a35 (current HEAD) - looks like I > > > cut & pasted a rev from a different repo in my original post! > > > > > > Regards > > > Neil > > > > > > On Mon, 6 May 2019 at 18:59, John Paul Adrian Glaubitz > > > <glaubitz@physik.fu-berlin.de> wrote: > > > > > > > > On 5/6/19 7:15 PM, Neil MacLeod wrote: > > > > > Does anyone have a patch? > > > > > > > > Try the attached patch. > > > > > > > > Adrian > > > > > > > > -- > > > > .''`. John Paul Adrian Glaubitz > > > > : :' : Debian Developer - glaubitz@debian.org > > > > `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de > > > > `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 [-- Attachment #2: f2fs-uninitialized.patch --] [-- Type: application/octet-stream, Size: 1105 bytes --] From 70fd808f7d502188a6bdade6b6b343fc97ecfac9 Mon Sep 17 00:00:00 2001 From: MilhouseVH <milhouseVH.github@nmacleod.com> Date: Wed, 8 May 2019 01:42:27 +0100 Subject: [PATCH] f2fs: Disable gcc9 -Wmaybe-uninitialized --- grub-core/fs/f2fs.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/grub-core/fs/f2fs.c b/grub-core/fs/f2fs.c index 644653d..d0308fe 100644 --- a/grub-core/fs/f2fs.c +++ b/grub-core/fs/f2fs.c @@ -848,6 +848,11 @@ grub_f2fs_mount (grub_disk_t disk) return NULL; } +#if __GNUC__ >= 9 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif + /* Guarantee inline_data was handled by caller. */ static grub_disk_addr_t grub_f2fs_get_block (grub_fshelp_node_t node, grub_disk_addr_t block_ofs) @@ -888,6 +893,10 @@ grub_f2fs_get_block (grub_fshelp_node_t node, grub_disk_addr_t block_ofs) return block_addr; } +#if __GNUC__ >= 9 +#pragma GCC diagnostic pop +#endif + static grub_ssize_t grub_f2fs_read_file (grub_fshelp_node_t node, grub_disk_read_hook_t read_hook, void *read_hook_data, -- 2.7.4 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: gcc9.1 and f2fs 2019-05-08 1:09 ` Neil MacLeod @ 2019-05-10 10:56 ` Daniel Kiper 0 siblings, 0 replies; 14+ messages in thread From: Daniel Kiper @ 2019-05-10 10:56 UTC (permalink / raw) To: Neil MacLeod Cc: John Paul Adrian Glaubitz, The development of GNU GRUB, mchang CC-ing Michael. On Wed, May 08, 2019 at 02:09:17AM +0100, Neil MacLeod wrote: > Sorry, wrong patch in previous email - this is the one for grub! > > Neil > > On Wed, 8 May 2019 at 01:51, Neil MacLeod <neil@nmacleod.com> wrote: > > > > Adrian > > > > I used the attached patch and grub is now building for me with gcc-9.1. > > > > I've no idea if this is the right solution, but it does at least work > > (ie. builds) which is all I require for now as I'm not personally > > using grub in the distribution I'm building (LibreELEC) and can't > > actually say if it works at run-time. > > > > Many thanks > > Neil > > > > > > On Mon, 6 May 2019 at 20:58, Neil MacLeod <neil@nmacleod.com> wrote: > > > > > > Hi Adrian > > > > > > With your patch, grub now fails to build as follows: > > > > > > fs/f2fs.c: In function 'grub_f2fs_get_block': > > > fs/f2fs.c:864:43: error: 'offset' may be used uninitialized in this > > > function [-Werror=maybe-uninitialized] > > > 864 | return grub_le_to_cpu32 (inode->i_addr[offset[0]]); > > > | ^ > > > cc1: all warnings being treated as errors > > > make[4]: *** [Makefile:33773: fs/f2fs_module-f2fs.o] Error 1 > > > > > > This is the last 1000 lines of the build log with your patch applied: > > > http://ix.io/1IfE > > > > > > And this is the f2fs.c used for the compilation (it includes your > > > patch): http://ix.io/1IfC > > > > > > Many thanks > > > Neil > > > > > > On Mon, 6 May 2019 at 19:19, Neil MacLeod <neil@nmacleod.com> wrote: > > > > > > > > Thanks Adrian - testing with your patch now, will be another hour or > > > > so until the build is complete (cross-compiling environment with own > > > > toolchain etc.) > > > > > > > > Just a correction, I'm testing with > > > > 4dd4ceec023111a4ccf69f8de6fa0885c6847a35 (current HEAD) - looks like I > > > > cut & pasted a rev from a different repo in my original post! > > > > > > > > Regards > > > > Neil > > > > > > > > On Mon, 6 May 2019 at 18:59, John Paul Adrian Glaubitz > > > > <glaubitz@physik.fu-berlin.de> wrote: > > > > > > > > > > On 5/6/19 7:15 PM, Neil MacLeod wrote: > > > > > > Does anyone have a patch? > > > > > > > > > > Try the attached patch. I am afraid that we have two issues here. May I ask one of you to reinvestigate them and post proper fix(es)? And this is clearly release material. Daniel ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: gcc9.1 and f2fs 2019-05-08 0:51 ` Neil MacLeod 2019-05-08 1:09 ` Neil MacLeod @ 2019-05-17 7:31 ` Michael Chang 1 sibling, 0 replies; 14+ messages in thread From: Michael Chang @ 2019-05-17 7:31 UTC (permalink / raw) To: The development of GNU GRUB; +Cc: John Paul Adrian Glaubitz On Wed, May 08, 2019 at 01:51:20AM +0100, Neil MacLeod wrote: > Adrian > > I used the attached patch and grub is now building for me with gcc-9.1. > > I've no idea if this is the right solution, but it does at least work > (ie. builds) which is all I require for now as I'm not personally > using grub in the distribution I'm building (LibreELEC) and can't > actually say if it works at run-time. Hi Neil, The gcc diagnose here is right and addressed a real problem IMHO, so we can't suppress it but have to fix the real problem it has pointed out. I will try to come up with a patch and post it to mailing list. Thanks, Michael > > Many thanks > Neil > > > On Mon, 6 May 2019 at 20:58, Neil MacLeod <neil@nmacleod.com> wrote: > > > > Hi Adrian > > > > With your patch, grub now fails to build as follows: > > > > fs/f2fs.c: In function 'grub_f2fs_get_block': > > fs/f2fs.c:864:43: error: 'offset' may be used uninitialized in this > > function [-Werror=maybe-uninitialized] > > 864 | return grub_le_to_cpu32 (inode->i_addr[offset[0]]); > > | ^ > > cc1: all warnings being treated as errors > > make[4]: *** [Makefile:33773: fs/f2fs_module-f2fs.o] Error 1 > > > > This is the last 1000 lines of the build log with your patch applied: > > http://ix.io/1IfE > > > > And this is the f2fs.c used for the compilation (it includes your > > patch): http://ix.io/1IfC > > > > Many thanks > > Neil > > > > On Mon, 6 May 2019 at 19:19, Neil MacLeod <neil@nmacleod.com> wrote: > > > > > > Thanks Adrian - testing with your patch now, will be another hour or > > > so until the build is complete (cross-compiling environment with own > > > toolchain etc.) > > > > > > Just a correction, I'm testing with > > > 4dd4ceec023111a4ccf69f8de6fa0885c6847a35 (current HEAD) - looks like I > > > cut & pasted a rev from a different repo in my original post! > > > > > > Regards > > > Neil > > > > > > On Mon, 6 May 2019 at 18:59, John Paul Adrian Glaubitz > > > <glaubitz@physik.fu-berlin.de> wrote: > > > > > > > > On 5/6/19 7:15 PM, Neil MacLeod wrote: > > > > > Does anyone have a patch? > > > > > > > > Try the attached patch. > > > > > > > > Adrian > > > > > > > > -- > > > > .''`. John Paul Adrian Glaubitz > > > > : :' : Debian Developer - glaubitz@debian.org > > > > `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de > > > > `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: gcc9.1 and f2fs 2019-05-06 17:59 ` John Paul Adrian Glaubitz 2019-05-06 18:19 ` Neil MacLeod @ 2019-05-17 7:13 ` Michael Chang 2019-05-17 9:03 ` John Paul Adrian Glaubitz 2019-05-17 17:12 ` Bruce Dubbs 1 sibling, 2 replies; 14+ messages in thread From: Michael Chang @ 2019-05-17 7:13 UTC (permalink / raw) To: The development of GNU GRUB; +Cc: Neil MacLeod Hello John, Except for lacking commit message and SOB, the fix is LGTM. You could add my Reviewed-by: Michael Chang <mchang@suse.com> if you resend the patch to mailing list with those missing message fixed. Thanks, Michael On Mon, May 06, 2019 at 07:59:42PM +0200, John Paul Adrian Glaubitz wrote: > On 5/6/19 7:15 PM, Neil MacLeod wrote: > > Does anyone have a patch? > > Try the attached patch. > > Adrian > > -- > .''`. John Paul Adrian Glaubitz > : :' : Debian Developer - glaubitz@debian.org > `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de > `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 > >From b0d03dd5605220d0d23d72e662f10ce7b02a54a6 Mon Sep 17 00:00:00 2001 > From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> > Date: Mon, 6 May 2019 19:55:01 +0200 > Subject: [PATCH] f2fs: Disable gcc9 -Waddress-of-packed-member > > --- > grub-core/fs/f2fs.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/grub-core/fs/f2fs.c b/grub-core/fs/f2fs.c > index 1cad2615f..0dd09bc23 100644 > --- a/grub-core/fs/f2fs.c > +++ b/grub-core/fs/f2fs.c > @@ -1235,6 +1235,12 @@ grub_f2fs_utf16_to_utf8 (grub_uint16_t *in_buf_le) > return out_buf; > } > > + > +#if __GNUC__ >= 9 > +#pragma GCC diagnostic push > +#pragma GCC diagnostic ignored "-Waddress-of-packed-member" > +#endif > + > static grub_err_t > grub_f2fs_label (grub_device_t device, char **label) > { > @@ -1255,6 +1261,10 @@ grub_f2fs_label (grub_device_t device, char **label) > return grub_errno; > } > > +#if __GNUC__ >= 9 > +#pragma GCC diagnostic pop > +#endif > + > static grub_err_t > grub_f2fs_uuid (grub_device_t device, char **uuid) > { > -- > 2.20.1 > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: gcc9.1 and f2fs 2019-05-17 7:13 ` Michael Chang @ 2019-05-17 9:03 ` John Paul Adrian Glaubitz 2019-05-17 17:12 ` Bruce Dubbs 1 sibling, 0 replies; 14+ messages in thread From: John Paul Adrian Glaubitz @ 2019-05-17 9:03 UTC (permalink / raw) To: Michael Chang; +Cc: The development of GNU GRUB Hi Michael! On 5/17/19 9:13 AM, Michael Chang wrote: > Except for lacking commit message and SOB, the fix is LGTM. > > You could add my Reviewed-by: Michael Chang <mchang@suse.com> if you > resend the patch to mailing list with those missing message fixed. I can do that later today. I'm currently busy with work (I'm also @suse.com ;)). Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaubitz@debian.org `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: gcc9.1 and f2fs 2019-05-17 7:13 ` Michael Chang 2019-05-17 9:03 ` John Paul Adrian Glaubitz @ 2019-05-17 17:12 ` Bruce Dubbs 2019-05-20 11:55 ` Daniel Kiper 1 sibling, 1 reply; 14+ messages in thread From: Bruce Dubbs @ 2019-05-17 17:12 UTC (permalink / raw) To: grub-devel On 5/17/19 2:13 AM, Michael Chang wrote: > Hello John, > > Except for lacking commit message and SOB, the fix is LGTM. [snip] >> --- >> grub-core/fs/f2fs.c | 10 ++++++++++ >> 1 file changed, 10 insertions(+) >> >> diff --git a/grub-core/fs/f2fs.c b/grub-core/fs/f2fs.c >> index 1cad2615f..0dd09bc23 100644 >> --- a/grub-core/fs/f2fs.c >> +++ b/grub-core/fs/f2fs.c >> @@ -1235,6 +1235,12 @@ grub_f2fs_utf16_to_utf8 (grub_uint16_t *in_buf_le) >> return out_buf; >> } >> >> + >> +#if __GNUC__ >= 9 >> +#pragma GCC diagnostic push >> +#pragma GCC diagnostic ignored "-Waddress-of-packed-member" >> +#endif >> + >> static grub_err_t >> grub_f2fs_label (grub_device_t device, char **label) >> { >> @@ -1255,6 +1261,10 @@ grub_f2fs_label (grub_device_t device, char **label) >> return grub_errno; >> } >> >> +#if __GNUC__ >= 9 >> +#pragma GCC diagnostic pop >> +#endif >> + >> static grub_err_t >> grub_f2fs_uuid (grub_device_t device, char **uuid) >> { I would like to point out that it is not a good idea to make a stable release using -Werror as a default. It is fine for development, but grub has traditionally taken a long time between stable releases (version 2.00 was in 2012 and version 2.02 was in 2017). After release, a new version of a compiler has a high probability of producing more warnings, which will break the build if using -Werrror. At linuxfromscratch we add --disable-werror, but it really shouldn't be needed. -- Bruce ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: gcc9.1 and f2fs 2019-05-17 17:12 ` Bruce Dubbs @ 2019-05-20 11:55 ` Daniel Kiper 0 siblings, 0 replies; 14+ messages in thread From: Daniel Kiper @ 2019-05-20 11:55 UTC (permalink / raw) To: Bruce Dubbs; +Cc: grub-devel On Fri, May 17, 2019 at 12:12:31PM -0500, Bruce Dubbs wrote: > On 5/17/19 2:13 AM, Michael Chang wrote: > > Hello John, > > > > Except for lacking commit message and SOB, the fix is LGTM. > > [snip] > > > > --- > > > grub-core/fs/f2fs.c | 10 ++++++++++ > > > 1 file changed, 10 insertions(+) > > > > > > diff --git a/grub-core/fs/f2fs.c b/grub-core/fs/f2fs.c > > > index 1cad2615f..0dd09bc23 100644 > > > --- a/grub-core/fs/f2fs.c > > > +++ b/grub-core/fs/f2fs.c > > > @@ -1235,6 +1235,12 @@ grub_f2fs_utf16_to_utf8 (grub_uint16_t *in_buf_le) > > > return out_buf; > > > } > > > + > > > +#if __GNUC__ >= 9 > > > +#pragma GCC diagnostic push > > > +#pragma GCC diagnostic ignored "-Waddress-of-packed-member" > > > +#endif > > > + > > > static grub_err_t > > > grub_f2fs_label (grub_device_t device, char **label) > > > { > > > @@ -1255,6 +1261,10 @@ grub_f2fs_label (grub_device_t device, char **label) > > > return grub_errno; > > > } > > > +#if __GNUC__ >= 9 > > > +#pragma GCC diagnostic pop > > > +#endif > > > + > > > static grub_err_t > > > grub_f2fs_uuid (grub_device_t device, char **uuid) > > > { > > I would like to point out that it is not a good idea to make a stable > release using -Werror as a default. It is fine for development, but grub > has traditionally taken a long time between stable releases (version 2.00 > was in 2012 and version 2.02 was in 2017). After release, a new version of > a compiler has a high probability of producing more warnings, which will > break the build if using -Werrror. > > At linuxfromscratch we add --disable-werror, but it really shouldn't be > needed. Thank you for your notice but there was no plan to make -Werror as a default. Michael sent better fix and now it is in the tree. Daniel ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2019-05-20 11:55 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-05-06 17:15 gcc9.1 and f2fs Neil MacLeod 2019-05-06 17:31 ` Bruce Dubbs 2019-05-06 17:36 ` Neil MacLeod 2019-05-06 17:59 ` John Paul Adrian Glaubitz 2019-05-06 18:19 ` Neil MacLeod 2019-05-06 19:58 ` Neil MacLeod 2019-05-08 0:51 ` Neil MacLeod 2019-05-08 1:09 ` Neil MacLeod 2019-05-10 10:56 ` Daniel Kiper 2019-05-17 7:31 ` Michael Chang 2019-05-17 7:13 ` Michael Chang 2019-05-17 9:03 ` John Paul Adrian Glaubitz 2019-05-17 17:12 ` Bruce Dubbs 2019-05-20 11:55 ` Daniel Kiper
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.