]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
gnulib: Drop fix-base64.patch
authorRobbie Harwood <rharwood@redhat.com>
Tue, 15 Mar 2022 18:05:40 +0000 (14:05 -0400)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 21 Mar 2022 17:50:13 +0000 (18:50 +0100)
Originally added in commit 9fbdec2f (bootstrap: Add gnulib's base64
module) and subsequently modified in commit 552c9fd08 (gnulib: Fix build
of base64 when compiling with memory debugging), fix-base64.patch
handled two problems we have using gnulib, which are exercised by the
base64 module but not directly caused by it.

First, GRUB defines its own bool type, while gnulib expects the
equivalent of stdbool.h to be present. Rather than patching gnulib,
instead use gnulib's stdbool module to provide a bool type if needed
(suggested by Simon Josefsson).

Second, our config.h doesn't always inherit config-util.h, which is
where gnulib-related options like _GL_ATTRIBUTE_CONST end up.
fix-base64.h worked around this by defining the attribute away, but this
workaround is better placed in config.h itself, not a gnulib patch.

Signed-off-by: Robbie Harwood <rharwood@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
bootstrap.conf
conf/Makefile.extra-dist
config.h.in
grub-core/lib/gnulib-patches/fix-base64.patch [deleted file]
grub-core/lib/posix_wrap/sys/types.h
grub-core/lib/xzembed/xz.h

index 0dd893c5c01a2dec861162563c6d1723da130362..21a8cf15dcd5e13ead1c55b17025e6ec2767f783 100644 (file)
@@ -35,6 +35,7 @@ gnulib_modules="
   realloc-gnu
   regex
   save-cwd
+  stdbool
 "
 
 gnulib_tool_option_extras="\
@@ -80,7 +81,7 @@ cp -a INSTALL INSTALL.grub
 
 bootstrap_post_import_hook () {
   set -e
-  for patchname in fix-base64 fix-null-deref fix-null-state-deref fix-regcomp-uninit-token \
+  for patchname in fix-null-deref fix-null-state-deref fix-regcomp-uninit-token \
       fix-regexec-null-deref fix-uninit-structure fix-unused-value fix-width no-abort; do
     patch -d grub-core/lib/gnulib -p2 \
       < "grub-core/lib/gnulib-patches/$patchname.patch"
index 8f1485d52a5ad5ecbfb176bcb4d4167d322e0cf5..15a9b74e945173fc969ff86fc5dfae175ebf8d1f 100644 (file)
@@ -28,7 +28,6 @@ EXTRA_DIST += grub-core/gensymlist.sh
 EXTRA_DIST += grub-core/genemuinit.sh
 EXTRA_DIST += grub-core/genemuinitheader.sh
 
-EXTRA_DIST += grub-core/lib/gnulib-patches/fix-base64.patch
 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-deref.patch
 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-state-deref.patch
 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch
index 4d4cc74cb2f5472cdb95bd0f7a80cdaf7a771834..8808d72720561fea28ddff344abd67c1a08439ea 100644 (file)
@@ -68,4 +68,8 @@
 
 #  define _GNU_SOURCE 1
 
+#  ifndef _GL_INLINE_HEADER_BEGIN
+#    define _GL_ATTRIBUTE_CONST __attribute__ ((const))
+#  endif /* !_GL_INLINE_HEADER_BEGIN */
+
 #endif
diff --git a/grub-core/lib/gnulib-patches/fix-base64.patch b/grub-core/lib/gnulib-patches/fix-base64.patch
deleted file mode 100644 (file)
index 985db12..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/lib/base64.h b/lib/base64.h
-index 9cd0183b8..185a2afa1 100644
---- a/lib/base64.h
-+++ b/lib/base64.h
-@@ -21,8 +21,14 @@
- /* Get size_t. */
- # include <stddef.h>
--/* Get bool. */
--# include <stdbool.h>
-+#ifndef GRUB_POSIX_BOOL_DEFINED
-+typedef enum { false = 0, true = 1 } bool;
-+#define GRUB_POSIX_BOOL_DEFINED 1
-+#endif
-+
-+#ifndef _GL_ATTRIBUTE_CONST
-+# define _GL_ATTRIBUTE_CONST /* empty */
-+#endif
- # ifdef __cplusplus
- extern "C" {
index 854eb0122efaa55f58085f067b52fa93ce5e7cda..eeda543c47e2f2653154d11a3a4ff2c5fd3dbcdf 100644 (file)
 
 #include <stddef.h>
 
+/* Provided by gnulib if not present. */
+#include <stdbool.h>
+
 typedef grub_ssize_t ssize_t;
-#ifndef GRUB_POSIX_BOOL_DEFINED
-typedef enum { false = 0, true = 1 } bool;
-#define GRUB_POSIX_BOOL_DEFINED 1
-#endif
 
 typedef grub_uint8_t uint8_t;
 typedef grub_uint16_t uint16_t;
index f7b32d80032daf9c1debb631b6d9e63708c1db96..d1417039aa4aa108a467f2b931ba23ab1feb3a1d 100644 (file)
 #include <unistd.h>
 #include <string.h>
 #include <grub/misc.h>
-
-#ifndef GRUB_POSIX_BOOL_DEFINED
-typedef enum { false = 0, true = 1 } bool;
-#endif
+#include <stdbool.h>
 
 /**
  * enum xz_ret - Return codes