From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mmBwX-0008Gf-3e for mharc-grub-devel@gnu.org; Sun, 14 Nov 2021 04:36:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmBwV-0008GW-J1 for grub-devel@gnu.org; Sun, 14 Nov 2021 04:36:55 -0500 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:58751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmBwT-0002NE-3f for grub-devel@gnu.org; Sun, 14 Nov 2021 04:36:55 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 3BB7332009C3; Sun, 14 Nov 2021 04:36:43 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 14 Nov 2021 04:36:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=Ewli/GJCRN8wGqTxDeWsZO/r42p DifN8boDftJq3tw4=; b=Le9gtiVFJ0OFksUFS5qfS5xPy0F1qtRnvnobMPxxCHX 6L4wQbOnNqRD2IMppgbiVTNEphrpresF+SRuOOiZxAckZ56bBPwlex2zHCrnkz5Z P+Of63DR0NCiLBvbdEDSPVUIC6i2ZYWDzKnI34xVIUoimf1VZ2X2OzSV4mOO4Sc/ WqUgm42B6rx6v9V3XOxwQeDeMHft7vfGTyGXxXlFUvrAFVg9ZXjYehAQD6zeGDyL RsK7WzB1Gs9QzQoAr8cYIZzE0t7yeNwOnGTkULhUbzeSLn0pJKNFaOicQ0gJB4BV XLA/UeT3zrZH9HdhaG14hhTB3X4zLlDtg22pcRItxpg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Ewli/G JCRN8wGqTxDeWsZO/r42pDifN8boDftJq3tw4=; b=WtJ/objlkpFPpOKfEXru+b 0j8EH4PV2nG/Yt21/A21wlkXRRdWovJXRdL1YjnDaTfe5X2LoYcQnB+v1oZ44JlX EIoY1KmDZPzkzgIZwNkHzZK/YH9QU62LJxthHbcdLp+JsHXhFDcL15vULO7I0R9i qjIXAQkqEQlVOVeyHxIvVrMp8b+yv0L7YnW/nc39TW6Il/zx1X11/FADONQJSIkL isjAslUC+XXJKYLN4pzmwVfWTAJdJeg0lsjx2a2Dy8it4mWcTskqiRlRZ99cMem4 x0bUz+Xamz0sBcjIm4MY8lGjnwF6RKccUOX1Ju/tOhgo5d9oXSB1yWepUdlzwtkA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrvdejgddthecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomheprfgrthhrihgt khcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnh epudegieeuffefgfegudeiueduhfdvffelvdfhkedvleetfeffudegveekieejieeinecu ffhomhgrihhnpehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 14 Nov 2021 04:36:41 -0500 (EST) Received: from localhost (ncase [10.192.0.11]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id 705472f7 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 14 Nov 2021 11:19:57 +0000 (UTC) Date: Sun, 14 Nov 2021 10:36:16 +0100 From: Patrick Steinhardt To: The development of GNU GRUB Cc: Robbie Harwood Subject: Re: [PATCH] Drop gnulib fix-base64.patch Message-ID: References: <20211028192227.351582-1-rharwood@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="JRpIW9A+eljbSCs2" Content-Disposition: inline In-Reply-To: <20211028192227.351582-1-rharwood@redhat.com> Received-SPF: pass client-ip=64.147.123.20; envelope-from=ps@pks.im; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Nov 2021 09:36:55 -0000 --JRpIW9A+eljbSCs2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 28, 2021 at 03:22:27PM -0400, Robbie Harwood wrote: > Originally 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. >=20 > 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.) >=20 > 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. >=20 > Signed-off-by: Robbie Harwood I agree this looks a lot cleaner than patching in support for booleans. Thanks for the patch! Reviewed-by: Patrick Steinhardt Patrick > --- > bootstrap.conf | 3 ++- > config.h.in | 3 +++ > 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 +---- > 5 files changed, 9 insertions(+), 30 deletions(-) > delete mode 100644 grub-core/lib/gnulib-patches/fix-base64.patch >=20 > diff --git a/bootstrap.conf b/bootstrap.conf > index 0dd893c5c..21a8cf15d 100644 > --- a/bootstrap.conf > +++ b/bootstrap.conf > @@ -35,6 +35,7 @@ gnulib_modules=3D" > realloc-gnu > regex > save-cwd > + stdbool > " > =20 > gnulib_tool_option_extras=3D"\ > @@ -80,7 +81,7 @@ cp -a INSTALL INSTALL.grub > =20 > bootstrap_post_import_hook () { > set -e > - for patchname in fix-base64 fix-null-deref fix-null-state-deref fix-re= gcomp-uninit-token \ > + for patchname in fix-null-deref fix-null-state-deref fix-regcomp-unini= t-token \ > fix-regexec-null-deref fix-uninit-structure fix-unused-value fix-w= idth no-abort; do > patch -d grub-core/lib/gnulib -p2 \ > < "grub-core/lib/gnulib-patches/$patchname.patch" > diff --git a/config.h.in b/config.h.in > index 9e8f9911b..2b65c86c4 100644 > --- a/config.h.in > +++ b/config.h.in > @@ -64,4 +64,7 @@ > =20 > #define _GNU_SOURCE 1 > =20 > +/* For gnulib's base64 code. */ > +#define _GL_ATTRIBUTE_CONST /* empty */ > + > #endif > diff --git a/grub-core/lib/gnulib-patches/fix-base64.patch b/grub-core/li= b/gnulib-patches/fix-base64.patch > deleted file mode 100644 > index 985db1279..000000000 > --- a/grub-core/lib/gnulib-patches/fix-base64.patch > +++ /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 > -=20 > --/* Get bool. */ > --# include > -+#ifndef GRUB_POSIX_BOOL_DEFINED > -+typedef enum { false =3D 0, true =3D 1 } bool; > -+#define GRUB_POSIX_BOOL_DEFINED 1 > -+#endif > -+ > -+#ifndef _GL_ATTRIBUTE_CONST > -+# define _GL_ATTRIBUTE_CONST /* empty */ > -+#endif > -=20 > - # ifdef __cplusplus > - extern "C" { > diff --git a/grub-core/lib/posix_wrap/sys/types.h b/grub-core/lib/posix_w= rap/sys/types.h > index 854eb0122..eeda543c4 100644 > --- a/grub-core/lib/posix_wrap/sys/types.h > +++ b/grub-core/lib/posix_wrap/sys/types.h > @@ -23,11 +23,10 @@ > =20 > #include > =20 > +/* Provided by gnulib if not present. */ > +#include > + > typedef grub_ssize_t ssize_t; > -#ifndef GRUB_POSIX_BOOL_DEFINED > -typedef enum { false =3D 0, true =3D 1 } bool; > -#define GRUB_POSIX_BOOL_DEFINED 1 > -#endif > =20 > typedef grub_uint8_t uint8_t; > typedef grub_uint16_t uint16_t; > diff --git a/grub-core/lib/xzembed/xz.h b/grub-core/lib/xzembed/xz.h > index f7b32d800..d1417039a 100644 > --- a/grub-core/lib/xzembed/xz.h > +++ b/grub-core/lib/xzembed/xz.h > @@ -29,10 +29,7 @@ > #include > #include > #include > - > -#ifndef GRUB_POSIX_BOOL_DEFINED > -typedef enum { false =3D 0, true =3D 1 } bool; > -#endif > +#include > =20 > /** > * enum xz_ret - Return codes > --=20 > 2.33.0 >=20 >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel --JRpIW9A+eljbSCs2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAmGQ2I8ACgkQVbJhu7ck PpS60Q//UE6wqR3MLFf8w2QCgN0hOMQFUutYg7gWuh3KJ+qyMnfJU4P3y3xFe8M7 vybR8H1w4/Vz4NYzrNURpZnUGyaykRNScPZsVArupBH9uVWgUL28z4jQwUeL1Ieg Co8nCTukb6immZu7BgUGn1wfWaeIOgjVxsm69524Q17oRmbkX9kG3xI9b5Gj88Xr RW7jYtccohZXc9Cnl25JAndIAcp9754xCRDG4tkVg7swIUXvLmtXXhJMnEeqJYwi mzLOFHDKoVKRA1PaxNR/BdPVRCYokS4kdSyw6yzw5OGGRkd4+Iqm7fTS8h4Xb54X ehF3CB41DUzKXLiQrP4cHfD4WRC4OD/R+Pm5lP1Ru1Ru7CV5ufZ0dEhDXqZkeOEc q05UPobeKAjxhFqV/X6J1Y11VtM1xh7FS5lZjcMMtY4/TpmenVQi9Dqt5CfsIfFR 8SIREFznR8/FrKJSaThSSDaqkI0acGaX/lbxqML10wkffCfYiB+CJp5Xl3dlOb8i wG4IfvSFk0H2TwAMKMVzB/8HqcUwz4I3lyeJAc8vLulQtrFmJ01SIMWSosmQ+0O3 2+8Gj1gaoctJa5p4hiNVCcz2jadYtTQVPOuE/3F3DOjVg3ZED+IbcqMzDyPgz+hp HPu4E7PbnOTTDM0qIhHHYFJbGgDnO9kla3LWKxEXIQuIdb49wW0= =Aa7A -----END PGP SIGNATURE----- --JRpIW9A+eljbSCs2--