]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
gnulib: Add patch to allow GRUB w/GCC-15 compile
authorAndrew Hamilton <adhamilt@gmail.com>
Wed, 18 Jun 2025 01:58:25 +0000 (20:58 -0500)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 26 Jun 2025 15:02:21 +0000 (17:02 +0200)
Pull in Gnulib fix to allow lib/base64.c to compile using GCC 15 or newer.

Pulled from Gnulib commit 25df6dc425 (Silence some
-Wunterminated-string-initialization warnings.)

GCC 15 adds a new compiler warning "-Wunterminated-string-initialization"
that will trigger what is considered a false-positive in lib/base64.c as
this array is not treated as a string but an array of characters so the
lack of NUL string terminator is expected.

GCC team has added ability to flag such instances of arrays that the
compiler may think are strings as "nonstring" arrays to avoid this
warning: __attribute__((nonstring)).

Fixes: https://savannah.gnu.org/bugs/?66470
Signed-off-by: Andrew Hamilton <adhamilt@gmail.com>
Reviewed-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
bootstrap.conf
conf/Makefile.extra-dist
grub-core/lib/gnulib-patches/fix-gcc-15-compile.patch [new file with mode: 0644]

index 7cd375ba901809ebb12bd1f18ad4f2bd71de505d..5717b7109a3dc02bb9fb5b2b199afacc670a479b 100644 (file)
@@ -86,7 +86,8 @@ bootstrap_post_import_hook () {
   # add new patches here.
   for patchname in fix-width \
       fix-regcomp-resource-leak \
-      fix-regexec-resource-leak; do
+      fix-regexec-resource-leak \
+      fix-gcc-15-compile; do
     patch -d grub-core/lib/gnulib -p2 \
        < "grub-core/lib/gnulib-patches/$patchname.patch"
   done
index f59b8d8b3218638b2cec1bf1dcd2a3a032eff08c..869e3a16c5090299426ae5a266e1203edd9abf9a 100644 (file)
@@ -31,6 +31,7 @@ EXTRA_DIST += grub-core/genemuinitheader.sh
 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-width.patch
 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regcomp-resource-leak.patch
 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regexec-resource-leak.patch
+EXTRA_DIST += grub-core/lib/gnulib-patches/fix-gcc-15-compile.patch
 
 EXTRA_DIST += grub-core/lib/libgcrypt
 EXTRA_DIST += grub-core/lib/libgcrypt-grub/mpi/generic
diff --git a/grub-core/lib/gnulib-patches/fix-gcc-15-compile.patch b/grub-core/lib/gnulib-patches/fix-gcc-15-compile.patch
new file mode 100644 (file)
index 0000000..287332e
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/lib/base64.c
++++ b/lib/base64.c
+@@ -61,7 +61,7 @@
+   return ch;
+ }
+
+-static const char b64c[64] =
++static const char b64c[64] _GL_ATTRIBUTE_NONSTRING =
+   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+ /* Base64 encode IN array of size INLEN into OUT array. OUT needs