Update gnulib version and drop most gnulib patches
v9 cover Update gnulib version and drop most gnulib patches
This update adds two patches (dkiper's __set_errno() and my autotools warnings fix). There are not changes to other patches in the series (except maybe things introduced by git rebase).
Be well,
--Robbie
Daniel Kiper (1):
lib/posix_wrap/errno.h: Add __set_errno() macro
Robbie Harwood (7):
Use visual indentation in config.h.in
Where present, ensure config-util.h precedes config.h Drop gnulib fix-base64.patch
Drop gnulib no-abort.patch
Update gnulib version and drop most gnulib patches Handle warnings introduced by updated gnulib Fix various new autotools warnings
INSTALL | 4 +- bootstrap | 319 ++++++++++-------- bootstrap.conf | 23 +- conf/Makefile.extra-dist | 8 - config.h.in | 142 ++++++-- configure.ac | 8 +- grub-core/Makefile.core.def | 3 + grub-core/disk/host.c | 2 +- grub-core/disk/luks2.c | 4 +- grub-core/gensymlist.sh | 1 + grub-core/kern/emu/argp_common.c | 2 +- grub-core/kern/emu/main.c | 2 +- grub-core/lib/gnulib-patches/fix-base64.patch | 21 -- .../lib/gnulib-patches/fix-null-deref.patch | 13 - .../gnulib-patches/fix-null-state-deref.patch | 12 - .../fix-regcomp-uninit-token.patch | 15 - .../fix-regexec-null-deref.patch | 12 - .../gnulib-patches/fix-uninit-structure.patch | 11 - .../lib/gnulib-patches/fix-unused-value.patch | 14 - grub-core/lib/gnulib-patches/no-abort.patch | 26 -- grub-core/lib/posix_wrap/errno.h | 4 + grub-core/lib/posix_wrap/limits.h | 6 +- grub-core/lib/posix_wrap/sys/types.h | 7 +- grub-core/lib/xzembed/xz.h | 5 +- grub-core/osdep/aros/config.c | 2 +- grub-core/osdep/basic/emunet.c | 2 +- grub-core/osdep/basic/init.c | 2 +- grub-core/osdep/haiku/getroot.c | 2 +- grub-core/osdep/linux/emunet.c | 2 +- grub-core/osdep/unix/config.c | 2 +- grub-core/osdep/unix/cputime.c | 2 +- grub-core/osdep/unix/dl.c | 2 +- grub-core/osdep/unix/emuconsole.c | 2 +- grub-core/osdep/unix/getroot.c | 2 +- grub-core/osdep/windows/config.c | 2 +- grub-core/osdep/windows/cputime.c | 2 +- grub-core/osdep/windows/dl.c | 2 +- grub-core/osdep/windows/emuconsole.c | 2 +- grub-core/osdep/windows/init.c | 2 +- include/grub/compiler.h | 4 +- include/grub/list.h | 2 +- 41 files changed, 354 insertions(+), 346 deletions(-) delete mode 100644 grub-core/lib/gnulib-patches/fix-base64.patch delete mode 100644 grub-core/lib/gnulib-patches/fix-null-deref.patch delete mode 100644 grub-core/lib/gnulib-patches/fix-null-state-deref.patch delete mode 100644 grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch delete mode 100644 grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch delete mode 100644 grub-core/lib/gnulib-patches/fix-uninit-structure.patch delete mode 100644 grub-core/lib/gnulib-patches/fix-unused-value.patch delete mode 100644 grub-core/lib/gnulib-patches/no-abort.patch
Signature · 1 line
2.35.1
PATCH v9 1/8 Use visual indentation in config.h.in
--- config.h.in | 56 ++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 28 deletions(-)
config.h.in +28 -28
@@ -26,46 +26,46 @@ #define MINILZO_CFG_SKIP_LZO1X_DECOMPRESS 1 #if defined (GRUB_BUILD) -#undef ENABLE_NLS -#define BUILD_SIZEOF_LONG @BUILD_SIZEOF_LONG@ -#define BUILD_SIZEOF_VOID_P @BUILD_SIZEOF_VOID_P@ -#if defined __APPLE__ -# if defined __BIG_ENDIAN__ -# define BUILD_WORDS_BIGENDIAN 1 -# else -# define BUILD_WORDS_BIGENDIAN 0 -# endif -#else -#define BUILD_WORDS_BIGENDIAN @BUILD_WORDS_BIGENDIAN@ -#endif +# undef ENABLE_NLS +# define BUILD_SIZEOF_LONG @BUILD_SIZEOF_LONG@ +# define BUILD_SIZEOF_VOID_P @BUILD_SIZEOF_VOID_P@ +# if defined __APPLE__ +# if defined __BIG_ENDIAN__ +# define BUILD_WORDS_BIGENDIAN 1 +# else +# define BUILD_WORDS_BIGENDIAN 0 +# endif +# else /* !defined __APPLE__ */ +# define BUILD_WORDS_BIGENDIAN @BUILD_WORDS_BIGENDIAN@ +# endif /* !defined __APPLE__ */ #elif defined (GRUB_UTIL) || !defined (GRUB_MACHINE) -#include <config-util.h> -#else -#define HAVE_FONT_SOURCE @HAVE_FONT_SOURCE@ +# include <config-util.h> +#else /* !defined GRUB_UTIL && defined GRUB_MACHINE */ +# define HAVE_FONT_SOURCE @HAVE_FONT_SOURCE@ /* Define if C symbols get an underscore after compilation. */ -#define HAVE_ASM_USCORE @HAVE_ASM_USCORE@ +# define HAVE_ASM_USCORE @HAVE_ASM_USCORE@ /* Define it to one of __bss_start, edata and _edata. */ -#define BSS_START_SYMBOL @BSS_START_SYMBOL@ +# define BSS_START_SYMBOL @BSS_START_SYMBOL@ /* Define it to either end or _end. */ -#define END_SYMBOL @END_SYMBOL@ +# define END_SYMBOL @END_SYMBOL@ /* Name of package. */ -#define PACKAGE "@PACKAGE@" +# define PACKAGE "@PACKAGE@" /* Version number of package. */ -#define VERSION "@VERSION@" +# define VERSION "@VERSION@" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "@PACKAGE_STRING@" +# define PACKAGE_STRING "@PACKAGE_STRING@" /* Define to the version of this package. */ -#define PACKAGE_VERSION "@PACKAGE_VERSION@" +# define PACKAGE_VERSION "@PACKAGE_VERSION@" /* Define to the full name of this package. */ -#define PACKAGE_NAME "@PACKAGE_NAME@" +# define PACKAGE_NAME "@PACKAGE_NAME@" /* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" +# define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" -#define GRUB_TARGET_CPU "@GRUB_TARGET_CPU@" -#define GRUB_PLATFORM "@GRUB_PLATFORM@" +# define GRUB_TARGET_CPU "@GRUB_TARGET_CPU@" +# define GRUB_PLATFORM "@GRUB_PLATFORM@" -#define RE_ENABLE_I18N 1 +# define RE_ENABLE_I18N 1 -#define _GNU_SOURCE 1 +# define _GNU_SOURCE 1 #endif
Signature · 1 line
2.35.1
PATCH v9 2/8 Where present, ensure config-util.h precedes config.h
In reply to Robbie Harwoodgnulib defines go in config-util.h, and we need to know whether to provide duplicates in config.h or not.
--- grub-core/disk/host.c | 2 +- grub-core/gensymlist.sh | 1 + grub-core/kern/emu/argp_common.c | 2 +- grub-core/kern/emu/main.c | 2 +- grub-core/osdep/aros/config.c | 2 +- grub-core/osdep/basic/emunet.c | 2 +- grub-core/osdep/basic/init.c | 2 +- grub-core/osdep/haiku/getroot.c | 2 +- grub-core/osdep/linux/emunet.c | 2 +- grub-core/osdep/unix/config.c | 2 +- grub-core/osdep/unix/cputime.c | 2 +- grub-core/osdep/unix/dl.c | 2 +- grub-core/osdep/unix/emuconsole.c | 2 +- grub-core/osdep/unix/getroot.c | 2 +- grub-core/osdep/windows/config.c | 2 +- grub-core/osdep/windows/cputime.c | 2 +- grub-core/osdep/windows/dl.c | 2 +- grub-core/osdep/windows/emuconsole.c | 2 +- grub-core/osdep/windows/init.c | 2 +- 19 files changed, 19 insertions(+), 18 deletions(-)
grub-core/disk/host.c +1 -1
@@ -20,8 +20,8 @@/* When using the disk, make a reference to this module. Otherwise the user will end up with a useless module :-). */ -#include <config.h> #include <config-util.h> +#include <config.h> #include <grub/dl.h> #include <grub/disk.h>
grub-core/gensymlist.sh +1 -0
@@ -31,6 +31,7 @@ cat <<EOF * along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ +#include <../config-util.h> EOF for i in $*; do
grub-core/kern/emu/argp_common.c +1 -1
@@ -17,8 +17,8 @@* along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ -#include <config.h> #include <config-util.h> +#include <config.h> #pragma GCC diagnostic ignored "-Wmissing-prototypes"#pragma GCC diagnostic ignored "-Wmissing-declarations"
grub-core/kern/emu/main.c +1 -1
@@ -16,8 +16,8 @@* along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ -#include <config.h> #include <config-util.h> +#include <config.h> #include <time.h> #include <stdio.h>
grub-core/osdep/aros/config.c +1 -1
@@ -16,8 +16,8 @@* along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ -#include <config.h> #include <config-util.h> +#include <config.h> #include <grub/emu/hostdisk.h> #include <grub/emu/exec.h>
grub-core/osdep/basic/emunet.c +1 -1
@@ -16,8 +16,8 @@* along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ -#include <config.h> #include <config-util.h> +#include <config.h> #include <grub/i18n.h> #include <grub/emu/net.h>
grub-core/osdep/basic/init.c +1 -1
@@ -16,8 +16,8 @@* along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ -#include <config.h> #include <config-util.h> +#include <config.h> #include <grub/util/misc.h> #include <grub/i18n.h>
grub-core/osdep/haiku/getroot.c +1 -1
@@ -1,5 +1,5 @@ -#include <config.h> #include <config-util.h> +#include <config.h> #include <sys/types.h> #include <sys/stat.h> #include <string.h>
grub-core/osdep/linux/emunet.c +1 -1
@@ -16,8 +16,8 @@* along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ -#include <config.h> #include <config-util.h> +#include <config.h> #include <sys/socket.h> #include <sys/types.h>
grub-core/osdep/unix/config.c +1 -1
@@ -16,8 +16,8 @@* along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ -#include <config.h> #include <config-util.h> +#include <config.h> #include <grub/emu/hostdisk.h> #include <grub/emu/exec.h>
grub-core/osdep/unix/cputime.c +1 -1
@@ -1,5 +1,5 @@ -#include <config.h> #include <config-util.h> +#include <config.h> #include <sys/times.h> #include <unistd.h>
grub-core/osdep/unix/dl.c +1 -1
@@ -16,8 +16,8 @@* along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ -#include <config.h> #include <config-util.h> +#include <config.h> #include <grub/dl.h> #include <grub/misc.h>
grub-core/osdep/unix/emuconsole.c +1 -1
@@ -17,8 +17,8 @@* along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ -#include <config.h> #include <config-util.h> +#include <config.h> #include <grub/term.h> #include <grub/types.h>
grub-core/osdep/unix/getroot.c +1 -1
@@ -16,8 +16,8 @@* along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ -#include <config-util.h> #include <config.h> +#include <config-util.h> #include <sys/stat.h> #include <sys/types.h>
grub-core/osdep/windows/config.c +1 -1
@@ -16,8 +16,8 @@* along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ -#include <config.h> #include <config-util.h> +#include <config.h> #include <grub/emu/hostfile.h> #include <grub/emu/config.h>
grub-core/osdep/windows/cputime.c +1 -1
@@ -1,5 +1,5 @@ -#include <config.h> #include <config-util.h> +#include <config.h> #include <grub/emu/misc.h> #include <windows.h>
grub-core/osdep/windows/dl.c +1 -1
@@ -16,8 +16,8 @@* along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ -#include <config.h> #include <config-util.h> +#include <config.h> #include <grub/dl.h> #include <grub/misc.h>
grub-core/osdep/windows/emuconsole.c +1 -1
@@ -16,8 +16,8 @@* along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ -#include <config.h> #include <config-util.h> +#include <config.h> #include <grub/term.h> #include <grub/misc.h>
grub-core/osdep/windows/init.c +1 -1
@@ -16,8 +16,8 @@* along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ -#include <config.h> #include <config-util.h> +#include <config.h> #include <grub/util/misc.h> #include <grub/osdep/hostfile.h> #include <grub/util/windows.h>
Signature · 1 line
2.35.1
PATCH v9 3/8 Drop gnulib fix-base64.patch
In reply to Robbie HarwoodOriginally added in 9fbdec2f6b4fa8b549daa4d49134d1fe89d95ef9 and subsequently modified in 552c9fd08122a3036c724ce96dfe68aa2f75705f, fix-base64.patch handled two problems we have using gnulib, which are exerciesd by the base64 module but not directly caused by it.
First, grub2 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.
--- bootstrap.conf | 3 ++- conf/Makefile.extra-dist | 1 - config.h.in | 4 ++++ grub-core/lib/gnulib-patches/fix-base64.patch | 21 ------------------- grub-core/lib/posix_wrap/sys/types.h | 7 +++---- grub-core/lib/xzembed/xz.h | 5 +---- 6 files changed, 10 insertions(+), 31 deletions(-) delete mode 100644 grub-core/lib/gnulib-patches/fix-base64.patch
bootstrap.conf +2 -1
@@ -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"
conf/Makefile.extra-dist +0 -1
@@ -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
config.h.in +4 -0
@@ -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
grub-core/lib/gnulib-patches/fix-base64.patch deleted +0 -21
@@ -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" {
grub-core/lib/posix_wrap/sys/types.h +3 -4
@@ -23,11 +23,10 @@#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 ;
grub-core/lib/xzembed/xz.h +1 -4
@@ -29,10 +29,7 @@#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
Signature · 1 line
2.35.1
PATCH v9 4/8 Drop gnulib no-abort.patch
In reply to Robbie HarwoodOriginally added in db7337a3d353a817ffe9eb4a3702120527100be9, this patched out all relevant invocations of abort() in gnulib. While it was not documented why at the time, testing suggests that there's no abort() implementation available for gnulib to use.
gnulib's position is that the use of abort() is correct here, since it happens when input violates a "shall" from POSIX. Additionally, the code in question is probably not reachable. Since abort() is more friendly to user-space, they prefer to make no change, so we can just carry a define instead. (Suggested by Paul Eggert.)
--- bootstrap.conf | 2 +- conf/Makefile.extra-dist | 1 - config.h.in | 10 ++++++++ grub-core/lib/gnulib-patches/no-abort.patch | 26 --------------------- 4 files changed, 11 insertions(+), 28 deletions(-) delete mode 100644 grub-core/lib/gnulib-patches/no-abort.patch
bootstrap.conf +1 -1
@@ -82,7 +82,7 @@ cp -a INSTALL INSTALL.grub bootstrap_post_import_hook () { set -e 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 + fix-regexec-null-deref fix-uninit-structure fix-unused-value fix-width; do patch -d grub-core/lib/gnulib -p2 \ < "grub-core/lib/gnulib-patches/$patchname.patch" done
conf/Makefile.extra-dist +0 -1
@@ -35,7 +35,6 @@ EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch EXTRA_DIST += grub-core/lib/gnulib-patches/fix-uninit-structure.patch EXTRA_DIST += grub-core/lib/gnulib-patches/fix-unused-value.patch EXTRA_DIST += grub-core/lib/gnulib-patches/fix-width.patch -EXTRA_DIST += grub-core/lib/gnulib-patches/no-abort.patch EXTRA_DIST += grub-core/lib/libgcrypt EXTRA_DIST += grub-core/lib/libgcrypt-grub/mpi/generic
config.h.in +10 -0
@@ -70,6 +70,16 @@ # ifndef _GL_INLINE_HEADER_BEGIN # define _GL_ATTRIBUTE_CONST __attribute__ ((const)) + +/* + * We don't have an abort() for gnulib to call in regexp. Because gnulib is + * built as a separate object that is then linked with, it doesn't have any + * of our headers or functions around to use - so we unfortunately can't + * print anything. Builds of emu include the system's stdlib, which includes + * a prototype for abort(), so leave this as a macro that doesn't take + * arguments. + */ +# define abort __builtin_trap # endif /* !_GL_INLINE_HEADER_BEGIN */ #endif
grub-core/lib/gnulib-patches/no-abort.patch deleted +0 -26
@@ -1,26 +0,0 @@ -diff --git a/lib/regcomp.c b/lib/regcomp.c -index cc85f35ac..de45ebb5c 100644 ---- a/lib/regcomp.c -+++ b/lib/regcomp.c -@@ -528,9 +528,9 @@ regerror (int errcode, const regex_t *__restrict preg, char *__restrict errbuf, - to this routine. If we are given anything else, or if other regex - code generates an invalid error code, then the program has a bug. - Dump core so we can fix it. */ -- abort (); -- -- msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]); -+ msg = gettext ("unknown regexp error"); -+ else -+ msg = gettext (__re_error_msgid + __re_error_msgid_idx[errcode]); - - msg_size = strlen (msg) + 1; /* Includes the null. */ - -@@ -1136,7 +1136,7 @@ optimize_utf8 (re_dfa_t *dfa) - } - break; - default: -- abort (); -+ break; - } - - if (mb_chars || has_period)
Signature · 1 line
2.35.1
PATCH v9 5/8 Update gnulib version and drop most gnulib patches
In reply to Robbie HarwoodIn addition to the changes carried in our gnulib patches, several Coverity and code hygiene fixes that were previously downstream are also included in this 3-year gnulib increment.
Unfortunately, fix-width.patch is retained.
Bump minimum autoconf version from 2.63 to 2.64 and automake from 1.11 to 1.14, as required by gnulib.
Sync bootstrap script itself with gnulib.
Update regexp module for new dynarray dependency.
--- INSTALL | 4 +- bootstrap | 319 ++++++++++-------- bootstrap.conf | 22 +- conf/Makefile.extra-dist | 6 - config.h.in | 67 ++++ configure.ac | 2 +- grub-core/Makefile.core.def | 3 + .../lib/gnulib-patches/fix-null-deref.patch | 13 - .../gnulib-patches/fix-null-state-deref.patch | 12 - .../fix-regcomp-uninit-token.patch | 15 - .../fix-regexec-null-deref.patch | 12 - .../gnulib-patches/fix-uninit-structure.patch | 11 - .../lib/gnulib-patches/fix-unused-value.patch | 14 - 13 files changed, 266 insertions(+), 234 deletions(-) delete mode 100644 grub-core/lib/gnulib-patches/fix-null-deref.patch delete mode 100644 grub-core/lib/gnulib-patches/fix-null-state-deref.patch delete mode 100644 grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch delete mode 100644 grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch delete mode 100644 grub-core/lib/gnulib-patches/fix-uninit-structure.patch delete mode 100644 grub-core/lib/gnulib-patches/fix-unused-value.patch
INSTALL +2 -2
@@ -46,8 +46,8 @@ If you use a development snapshot or want to hack on GRUB you may need the following. * Python 3 (NOTE: python 2.6 should still work, but it's not tested) -* Autoconf 2.63 or later -* Automake 1.11 or later +* Autoconf 2.64 or later +* Automake 1.14 or later Your distro may package cross-compiling toolchains such as the following incomplete list on Debian: gcc-aarch64-linux-gnu, gcc-arm-linux-gnueabihf,
bootstrap +182 -137
403 lines not on this page · raw message
bootstrap.conf +11 -11
@@ -1,6 +1,6 @@ # Bootstrap configuration. -# Copyright (C) 2006-2019 Free Software Foundation, Inc. +# Copyright (C) 2006-2022 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by
@@ -16,11 +16,10 @@ # along with this program. If not, see <https://www.gnu.org/licenses/>. -GNULIB_REVISION=d271f868a8df9bbec29049d01e056481b7a1a263 +GNULIB_REVISION=9f48fb992a3d7e96610c4ce8be969cff2d61a01b # gnulib modules used by this package. -# mbswidth is used by gnulib-fix-width.diff's changes to argp rather than -# directly. +# mbswidth is used by fix-width.diff's changes to argp rather than directly. gnulib_modules=" argp base64
@@ -67,8 +66,8 @@ SKIP_PO=t # Build prerequisites buildreq="\ -autoconf 2.63 -automake 1.11 +autoconf 2.64 +automake 1.14 gettext 0.18.3 git 1.5.5 patch -
@@ -81,11 +80,12 @@ cp -a INSTALL INSTALL.grub bootstrap_post_import_hook () { set -e - 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; do - patch -d grub-core/lib/gnulib -p2 \ - < "grub-core/lib/gnulib-patches/$patchname.patch" - done + + # Instead of patching our gnulib and therefore maintaining a fork, submit + # 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 + for patchname in \ 0001-Support-POTFILES-shell \ 0002-Handle-gettext_printf-shell-function \
conf/Makefile.extra-dist +0 -6
@@ -28,12 +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-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 -EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch -EXTRA_DIST += grub-core/lib/gnulib-patches/fix-uninit-structure.patch -EXTRA_DIST += grub-core/lib/gnulib-patches/fix-unused-value.patch EXTRA_DIST += grub-core/lib/gnulib-patches/fix-width.patch EXTRA_DIST += grub-core/lib/libgcrypt
config.h.in +67 -0
74 lines not on this page · raw message
configure.ac +1 -1
@@ -49,7 +49,7 @@ AC_CANONICAL_TARGET program_prefix="${save_program_prefix}" AM_INIT_AUTOMAKE([1.11]) -AC_PREREQ(2.63) +AC_PREREQ(2.64) AC_CONFIG_SRCDIR([include/grub/dl.h]) AC_CONFIG_HEADER([config-util.h])
grub-core/Makefile.core.def +3 -0
@@ -743,6 +743,9 @@ module = { name = regexp; common = commands/regexp.c; common = commands/wildcard.c; + common = lib/gnulib/malloc/dynarray_finalize.c; + common = lib/gnulib/malloc/dynarray_emplace_enlarge.c; + common = lib/gnulib/malloc/dynarray_resize.c; common = lib/gnulib/regex.c; cflags = '$(CFLAGS_POSIX) $(CFLAGS_GNULIB)'; cppflags = '$(CPPFLAGS_POSIX) $(CPPFLAGS_GNULIB)';
grub-core/lib/gnulib-patches/fix-null-deref.patch deleted +0 -13
@@ -1,13 +0,0 @@ -diff --git a/lib/argp-parse.c b/lib/argp-parse.c -index 6dec57310..900adad54 100644 ---- a/lib/argp-parse.c -+++ b/lib/argp-parse.c -@@ -940,7 +940,7 @@ weak_alias (__argp_parse, argp_parse) - void * - __argp_input (const struct argp *argp, const struct argp_state *state) - { -- if (state) -+ if (state && state->pstate) - { - struct group *group; - struct parser *parser = state->pstate;
grub-core/lib/gnulib-patches/fix-null-state-deref.patch deleted +0 -12
@@ -1,12 +0,0 @@ ---- a/lib/argp-help.c 2020-10-28 14:32:19.189215988 +0000 -+++ b/lib/argp-help.c 2020-10-28 14:38:21.204673940 +0000 -@@ -145,7 +145,8 @@ - if (*(int *)((char *)upptr + up->uparams_offs) >= upptr->rmargin) - { - __argp_failure (state, 0, 0, -- dgettext (state->root_argp->argp_domain, -+ dgettext (state == NULL ? NULL -+ : state->root_argp->argp_domain, - "\ - ARGP_HELP_FMT: %s value is less than or equal to %s"), - "rmargin", up->name);
grub-core/lib/gnulib-patches/fix-regcomp-uninit-token.patch deleted +0 -15
@@ -1,15 +0,0 @@ ---- a/lib/regcomp.c 2020-11-24 17:06:08.159223858 +0000 -+++ b/lib/regcomp.c 2020-11-24 17:06:15.630253923 +0000 -@@ -3808,11 +3808,7 @@ - create_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right, - re_token_type_t type) - { -- re_token_t t; --#if defined GCC_LINT || defined lint -- memset (&t, 0, sizeof t); --#endif -- t.type = type; -+ re_token_t t = { .type = type }; - return create_token_tree (dfa, left, right, &t); - } -
grub-core/lib/gnulib-patches/fix-regexec-null-deref.patch deleted +0 -12
@@ -1,12 +0,0 @@ ---- a/lib/regexec.c 2020-10-21 14:25:35.310195912 +0000 -+++ b/lib/regexec.c 2020-11-05 10:55:09.621542984 +0000 -@@ -1692,6 +1692,9 @@ - { - Idx top = mctx->state_log_top; - -+ if (mctx->state_log == NULL) -+ return REG_NOERROR; -+ - if ((next_state_log_idx >= mctx->input.bufs_len - && mctx->input.bufs_len < mctx->input.len) - || (next_state_log_idx >= mctx->input.valid_len
grub-core/lib/gnulib-patches/fix-uninit-structure.patch deleted +0 -11
@@ -1,11 +0,0 @@ ---- a/lib/regcomp.c 2020-10-22 13:49:06.770168928 +0000 -+++ b/lib/regcomp.c 2020-10-22 13:50:37.026528298 +0000 -@@ -3662,7 +3662,7 @@ - Idx alloc = 0; - #endif /* not RE_ENABLE_I18N */ - reg_errcode_t ret; -- re_token_t br_token; -+ re_token_t br_token = {0}; - bin_tree_t *tree; - - sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1);
grub-core/lib/gnulib-patches/fix-unused-value.patch deleted +0 -14
@@ -1,14 +0,0 @@ ---- a/lib/regexec.c 2020-10-21 14:25:35.310195912 +0000 -+++ b/lib/regexec.c 2020-10-21 14:32:07.961765604 +0000 -@@ -828,7 +828,11 @@ - break; - if (__glibc_unlikely (err != REG_NOMATCH)) - goto free_return; -+#ifdef DEBUG -+ /* Only used for assertion below when DEBUG is set, otherwise -+ it will be over-written when we loop around. */ - match_last = -1; -+#endif - } - else - break; /* We found a match. */
Signature · 1 line
2.35.1
PATCH v9 6/8 Handle warnings introduced by updated gnulib
In reply to Robbie Harwood- Fix type of size variable in luks2_verify_key()
- Avoid redefinition of SIZE_MAX and ATTRIBUTE_ERROR
- Work around gnulib's int types on older compilers
--- config.h.in | 5 +++++ grub-core/disk/luks2.c | 4 ++-- grub-core/lib/posix_wrap/limits.h | 6 +++++- include/grub/compiler.h | 4 ++-- include/grub/list.h | 2 +- 5 files changed, 15 insertions(+), 6 deletions(-)
config.h.in +5 -0
@@ -149,4 +149,9 @@ typedef __UINT_FAST32_TYPE__ uint_fast32_t; # define abort __builtin_trap # endif /* !_GL_INLINE_HEADER_BEGIN */ +/* gnulib doesn't build cleanly with older compilers. */ +# if __GNUC__ < 11 +_Pragma ("GCC diagnostic ignored \"-Wtype-limits\"") +# endif + #endif
grub-core/disk/luks2.c +2 -2
@@ -390,7 +390,7 @@ luks2_verify_key (grub_luks2_digest_t *d, grub_uint8_t *candidate_key, {grub_uint8_t candidate_digest[GRUB_CRYPTODISK_MAX_KEYLEN ];grub_uint8_t digest[GRUB_CRYPTODISK_MAX_KEYLEN ], salt[GRUB_CRYPTODISK_MAX_KEYLEN ]; -grub_size_t saltlen =sizeof (salt), digestlen =sizeof (digest); +idx_t saltlen =sizeof (salt), digestlen =sizeof (digest);const gcry_md_spec_t *hash;gcry_err_code_t gcry_ret;
@@ -429,7 +429,7 @@ luks2_decrypt_key (grub_uint8_t *out_key,grub_uint8_t area_key[GRUB_CRYPTODISK_MAX_KEYLEN ];grub_uint8_t salt[GRUB_CRYPTODISK_MAX_KEYLEN ];grub_uint8_t *split_key =NULL ; -grub_size_t saltlen =sizeof (salt); +idx_t saltlen =sizeof (salt);char cipher[32 ], *p;const gcry_md_spec_t *hash;gcry_err_code_t gcry_ret;
grub-core/lib/posix_wrap/limits.h +5 -1
@@ -25,7 +25,11 @@#define USHRT_MAX GRUB_USHRT_MAX#define UINT_MAX GRUB_UINT_MAX#define ULONG_MAX GRUB_ULONG_MAX -#define SIZE_MAX GRUB_SIZE_MAX + +/* gnulib also defines this type */ +#ifndef SIZE_MAX +# define SIZE_MAX GRUB_SIZE_MAX +#endif #define SCHAR_MIN GRUB_SCHAR_MIN#define SCHAR_MAX GRUB_SCHAR_MAX
include/grub/compiler.h +2 -2
@@ -30,10 +30,10 @@/* Does this compiler support compile-time error attributes? */ #if GNUC_PREREQ (4 ,3 ) -# define ATTRIBUTE_ERROR (msg) \ +# define GRUB_ATTRIBUTE_ERROR (msg) \ __attribute__ ((__error__ (msg)))#else -# define ATTRIBUTE_ERROR (msg) __attribute__ ((noreturn)) +# define GRUB_ATTRIBUTE_ERROR (msg) __attribute__ ((noreturn))#endif #if GNUC_PREREQ (4 ,4 )
include/grub/list.h +1 -1
@@ -40,7 +40,7 @@ void EXPORT_FUNC(grub_list_remove) (grub_list_t item); static inline void * grub_bad_type_cast_real (int line, const char *file) - ATTRIBUTE_ERROR ("bad type cast between incompatible grub types"); + GRUB_ATTRIBUTE_ERROR ("bad type cast between incompatible grub types");static inline void *grub_bad_type_cast_real (int line,const char *file)
Signature · 1 line
2.35.1
PATCH v9 7/8 Fix various new autotools warnings
In reply to Robbie Harwood--- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
configure.ac +3 -3
@@ -36,6 +36,7 @@ dnl description of the relationships between them. AC_INIT([GRUB],[2.11],[[email protected]]) +AC_USE_SYSTEM_EXTENSIONS AC_CONFIG_AUX_DIR([build-aux]) # We don't want -g -O2 by default in CFLAGS
@@ -51,7 +52,7 @@ program_prefix="${save_program_prefix}" AM_INIT_AUTOMAKE([1.11]) AC_PREREQ(2.64) AC_CONFIG_SRCDIR([include/grub/dl.h]) -AC_CONFIG_HEADER([config-util.h]) +AC_CONFIG_HEADERS([config-util.h]) # Explicitly check for pkg-config early on, since otherwise conditional # calls are problematic.
@@ -333,7 +334,7 @@ fi AC_PROG_RANLIB AC_PROG_INSTALL AC_PROG_AWK -AC_PROG_LEX +AC_PROG_LEX([noyywrap]) AC_PROG_YACC AC_PROG_MAKE_SET AC_PROG_MKDIR_P
@@ -369,7 +370,6 @@ test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required]) AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no) -AC_GNU_SOURCE AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.18.3]) AC_SYS_LARGEFILE
Signature · 1 line
2.35.1
PATCH v9 8/8 lib/posix_wrap/errno.h: Add __set_errno() macro
In reply to Robbie HarwoodFrom: Daniel Kiper <[email protected]>
$ ./configure --target=x86_64-w64-mingw32 --with-platform=efi --host=x86_64-w64-mingw32 $ make
[...]
cat syminfo.lst | sort | gawk -f ./genmoddep.awk > moddep.lst || (rm -f moddep.lst; exit 1) __imp__errno in regexp is not defined
This happens because grub-core/lib/gnulib/malloc/dynarray_resize.c and grub-core/lib/gnulib/malloc/dynarray_emplace_enlarge.c (both are used by regexp module) from the latest Gnulib call __set_errno() which originally sets errno variable (Windows builds add __imp__ prefix). Of course it is not defined and grub_errno should be used instead.
--- grub-core/lib/posix_wrap/errno.h | 4 ++++ 1 file changed, 4 insertions(+)
grub-core/lib/posix_wrap/errno.h +4 -0
@@ -26,4 +26,8 @@#define EINVAL GRUB_ERR_BAD_NUMBER#define ENOMEM GRUB_ERR_OUT_OF_MEMORY +/* From glibc <errno.h>. */ +#ifndef __set_errno +# define __set_errno (val) (grub_errno = (val)) +#endif #endif
Signature · 1 line
2.35.1
Quoted 10 lines · Robbie Harwood
This update adds two patches (dkiper's
__set_errno()and my autotools warnings fix). There are not changes to other patches in the series (except maybe things introduced by git rebase).Be well,
--RobbieDaniel Kiper (1):
lib/posix_wrap/errno.h: Add__set_errno()macro
Quoted 8 lines
Robbie Harwood (7):
Use visual indentation in config.h.in
Where present, ensureconfig-util.hprecedesconfig.hDrop gnulib fix-base64.patch
Drop gnulib no-abort.patch
Update gnulib version and drop most gnulib patches Handle warnings introduced by updated gnulib Fix various new autotools warnings
For all the patches Reviewed-by: Daniel Kiper <[email protected]>...
Thank you for patiently fixing all reported issues!
Daniel