Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nPULG-0000E8-DH for mharc-grub-devel@gnu.org; Wed, 02 Mar 2022 14:08:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPULE-0008V4-8A for grub-devel@gnu.org; Wed, 02 Mar 2022 14:08:52 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:58995) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPUL8-0003Yn-Uy for grub-devel@gnu.org; Wed, 02 Mar 2022 14:08:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646248125; 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=FDH41Wi36+RRto1ii/cGgsWjH3umgV5Nz05mZ2lxP1k=; b=ZIY3kSjFbQ5E4oZ6QrXkcDZVWhLE4SGihpq3Pz3NZi/XIxJdKRDf2yc1eAOY8jbkzup+ex W5VVN+I9NpdMxfrkgggLCEXUiOPJ/qNszAPDskgnrGL84J8/IQ0YJ2T+bg7bF/LGB9skGQ 0UQUQ05q9iwdh4NJ1EikNCWxMZdj9kA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-513-Cp3x2ND6OJyF53AOmc3yyg-1; Wed, 02 Mar 2022 14:08:44 -0500 X-MC-Unique: Cp3x2ND6OJyF53AOmc3yyg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8B495501E1; Wed, 2 Mar 2022 19:08:43 +0000 (UTC) Received: from eesha.redhat.com (unknown [10.22.48.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB6DF60BD8; Wed, 2 Mar 2022 19:08:42 +0000 (UTC) From: Robbie Harwood To: grub-devel@gnu.org Cc: dkiper@net-space.pl, Robbie Harwood Subject: [PATCH v8 4/6] Drop gnulib no-abort.patch Date: Wed, 2 Mar 2022 14:08:27 -0500 Message-Id: <20220302190829.195337-5-rharwood@redhat.com> In-Reply-To: <20220302190829.195337-1-rharwood@redhat.com> References: <20220302190829.195337-1-rharwood@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H5=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: Wed, 02 Mar 2022 19:08:52 -0000 Originally 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.) Signed-off-by: Robbie Harwood --- 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 diff --git a/bootstrap.conf b/bootstrap.conf index 21a8cf15d..71acbeeb1 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -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 diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist index 15a9b74e9..4ddc3c8f7 100644 --- a/conf/Makefile.extra-dist +++ b/conf/Makefile.extra-dist @@ -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 diff --git a/config.h.in b/config.h.in index 965eaffce..209e27449 100644 --- a/config.h.in +++ b/config.h.in @@ -66,6 +66,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 diff --git a/grub-core/lib/gnulib-patches/no-abort.patch b/grub-core/lib/gnulib-patches/no-abort.patch deleted file mode 100644 index e469c4762..000000000 --- a/grub-core/lib/gnulib-patches/no-abort.patch +++ /dev/null @@ -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) -- 2.34.1