bugGNU GRUB - Bugs: bug #66470, Build of grub-2.12 with gcc...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #66470: Build of grub-2.12 with gcc 15-20241117 errors with -Werror=unterminated-string-initialization

Submitter:  Rudi Heitbaum <heitbaum>
Submitted:  Wed 20 Nov 2024 01:32:54 PM UTC
   
 
Category:  Compilation Severity:  Major
Priority:  5 - Normal Item Group:  None
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open Release:  other
Release:  Reproducibility:  Every Time
Planned Release:  None

Sat 19 Apr 2025 05:05:29 AM UTC, comment #3: 

Using the following patch instead of CFLAGS+=" -Wno-error=unterminated-strin
g-initialization" to allow compile of 2.12 against gcc-15.

--- a/bootstrap.conf    2023-12-20 15:54:46.000000000 +0000
+++ b/bootstrap.conf    2025-04-19 04:54:21.402235320 +0000
@@ -85,6 +85,7 @@
   # changes to gnulib and update the hash above when they've merged.  Do not
   # add new patches here.
   patch -d grub-core/lib/gnulib -p2 < grub-core/lib/gnulib-patches/fix-width.patch
+  patch -d grub-core/lib/gnulib -p2 < grub-core/lib/gnulib-patches/fix-unterminated-string-initialization.patch
 
   for patchname in \
       0001-Support-POTFILES-shell \
--- /dev/null   2025-04-18 22:05:54.154307831 +0000
+++ a/grub-core/lib/gnulib-patches/fix-unterminated-string-initialization.patch 2025-04-19 04:33:15.890395708 +0000
@@ -0,0 +1,11 @@
+--- a/lib/base64.c     2025-04-19 04:11:46.591729777 +0000
++++ b/lib/base64.c     2025-04-19 04:24:36.861877165 +0000
+@@ -61,7 +61,7 @@
+   return ch;
+ }
+
+-static const char b64c[64] =
++static const char b64c[64] _attribute_((nonstring)) =
+   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+ /* Base64 encode IN array of size INLEN into OUT array. OUT needs

Rudi Heitbaum <heitbaum>
Sat 19 Apr 2025 04:19:13 AM UTC, comment #2: 

Using gcc 15.1.0-RC-20250418 the error is still present, whilst the gcc upstream bug was completed as “multi dimensional”

Rudi Heitbaum <heitbaum>
Mon 23 Dec 2024 04:02:40 PM UTC, comment #1: 

This is occurring in the gnulib library used by GRUB. There is some discussion that has occurred around this issue on the gnulib bug mailing list here:
https://lists.gnu.org/archive/html/bug-gnulib/2024-12/msg00138.html

Currently they are saying this is a GCC issue... they opened this issue for GCC:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178

We can see how this issue progresses during GCC 15 development, perhaps it will be reverted in GCC, and if not perhaps gnulib will apply a workaround or if not we can patch it in GRUB.

Andrew Hamilton <adhamilt>
Wed 20 Nov 2024 01:32:54 PM UTC, original submission:  



/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/bin/x86_64-libreelec-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/grub-2.12/grub-core -I..  -Wall -W  -DGRUB_MACHINE_EFI=1 -DGRUB_MACHINE=I386_EFI -m32 -nostdinc -isystem /var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/lib/gcc/x86_64-libreelec-linux-gnu/15.0.0/include -I/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/grub-2.12/include -I../include -DGRUB_FILE=\"grub_script.yy.c\" -I. -I/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/grub-2.12/grub-core -I.. -I/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/grub-2.12 -I/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/grub-2.12/include -I../include -I/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/grub-2.12/grub-core/lib/libgcrypt-grub/src/   -I/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/grub-2.12/grub-core/lib/posix_wrap  -D_FILE_OFFSET_BITS=64 -std=gnu99 -fno-common -Os -m32 -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 -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations  -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 -march=i386 -falign-functions=1 -falign-loops=1 -falign-jumps=1 -freg-struct-return -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow -Wa,-mx86-used-note=no -msoft-float -fno-omit-frame-pointer -fno-dwarf2-cfi-asm -mno-stack-arg-probe -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-ident -fno-stack-protector -Wtrampolines -Werror   -DGRUB_HAS_PCI -ffreestanding -fno-builtin -Wno-redundant-decls -Wno-unused-but-set-variable  -I/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -MT normal_module-grub_script.yy.o -MD -MP -MF .deps-core/normal_module-grub_script.yy.Tpo -c -o normal_module-grub_script.yy.o `test -f 'grub_script.yy.c' || echo '/var/media/DATA/home-rudi/LibreELEC.tv/build.LibreELEC-Generic.x86_64-13.0-devel/build/grub-2.12/grub-core/'`grub_script.yy.c

../../grub-core/lib/gnulib/base64.c:65:3: error: initializer-string for array of 'char' is too long [-Werror=unterminated-string-initialization]
   65 |   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Rudi Heitbaum <heitbaum>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by adhamilt (Posted a comment)
  • -email is unavailable- added by heitbaum (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code