From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nUBYX-0002Q0-2q for mharc-grub-devel@gnu.org; Tue, 15 Mar 2022 14:06:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nUBYT-0002J7-Ms for grub-devel@gnu.org; Tue, 15 Mar 2022 14:05:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:53921) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nUBYQ-0008Rc-OO for grub-devel@gnu.org; Tue, 15 Mar 2022 14:05:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647367554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q4P+o9aZ3t1vL0l73qgSP1LDs/zTOzIev8rnXWx1DWA=; b=hjvTcbyT4qK9vgEGGo/kPE32wE6GuOjCC8MJf/GGl+Dk1OTJGcaB4kBVSAEqMqU832NCaa xbYqF99n89JL7oRivRyHAkqzDbDJr/2qvtLIPA61+lR4MJAl1fIKLeUHzC+0b3fudTeqzj qmFaEYxdxXVwifWgUyeEdkCSlt/wUFI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-35-TtsdWRWmOLyc_feQj3tjVA-1; Tue, 15 Mar 2022 14:05:50 -0400 X-MC-Unique: TtsdWRWmOLyc_feQj3tjVA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A0DBE804183; Tue, 15 Mar 2022 18:05:50 +0000 (UTC) Received: from eesha.redhat.com (unknown [10.22.50.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F6A7141DEDA; Tue, 15 Mar 2022 18:05:50 +0000 (UTC) From: Robbie Harwood To: grub-devel@gnu.org Cc: dkiper@net-space.pl, Robbie Harwood Subject: [PATCH v9 3/8] Drop gnulib fix-base64.patch Date: Tue, 15 Mar 2022 14:05:40 -0400 Message-Id: <20220315180545.54989-4-rharwood@redhat.com> In-Reply-To: <20220315180545.54989-1-rharwood@redhat.com> References: <20220315180545.54989-1-rharwood@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=rharwood@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Received-SPF: pass client-ip=170.10.129.124; envelope-from=rharwood@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: Tue, 15 Mar 2022 18:05:57 -0000 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. 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. Signed-off-by: Robbie Harwood --- 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 diff --git a/bootstrap.conf b/bootstrap.conf index 0dd893c5c..21a8cf15d 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -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" diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist index 8f1485d52..15a9b74e9 100644 --- a/conf/Makefile.extra-dist +++ b/conf/Makefile.extra-dist @@ -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 diff --git a/config.h.in b/config.h.in index 4d4cc74cb..8808d7272 100644 --- a/config.h.in +++ b/config.h.in @@ -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 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 - --/* Get bool. */ --# include -+#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" { diff --git a/grub-core/lib/posix_wrap/sys/types.h b/grub-core/lib/posix_wrap/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 @@ #include +/* Provided by gnulib if not present. */ +#include + 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; 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 = 0, true = 1 } bool; -#endif +#include /** * enum xz_ret - Return codes -- 2.35.1