From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zimbra.cs.ucla.edu (zimbra.cs.ucla.edu [131.179.128.68]) by sourceware.org (Postfix) with ESMTPS id 4166B398544A for ; Sat, 9 Jan 2021 01:21:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4166B398544A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cs.ucla.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=eggert@cs.ucla.edu Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 7E33C1600CD; Fri, 8 Jan 2021 17:21:01 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id bV_whwzoA1bY; Fri, 8 Jan 2021 17:21:00 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 5CFA31600F1; Fri, 8 Jan 2021 17:21:00 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id stlqxjOlGmEP; Fri, 8 Jan 2021 17:21:00 -0800 (PST) Received: from [192.168.1.9] (cpe-23-243-218-95.socal.res.rr.com [23.243.218.95]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 2F8971600CD; Fri, 8 Jan 2021 17:21:00 -0800 (PST) Subject: Re: [PATCH 3/3] posix: Remove alloca definition from regex To: Adhemerval Zanella References: <20210106181707.1738066-1-adhemerval.zanella@linaro.org> <20210106181707.1738066-3-adhemerval.zanella@linaro.org> Cc: libc-alpha@sourceware.org, bug-gnulib@gnu.org From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Fri, 8 Jan 2021 17:20:59 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20210106181707.1738066-3-adhemerval.zanella@linaro.org> Content-Type: multipart/mixed; boundary="------------B7E25A2FB195387A2EEF2D08" Content-Language: en-US X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2021 01:21:03 -0000 This is a multi-part message in MIME format. --------------B7E25A2FB195387A2EEF2D08 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit This patch looks good for glibc, once the previous two regex patches are done. I installed it into Gnulib by applying the attached, so that regex_internal.h can stay in lock-step between Gnulib and glibc. --------------B7E25A2FB195387A2EEF2D08 Content-Type: text/x-patch; charset=UTF-8; name="0001-regex-stop-using-alloca.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-regex-stop-using-alloca.patch" >From 87ed1f9c4bc4ae9e98e1293465a5b3a929b9c3f9 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 8 Jan 2021 17:17:32 -0800 Subject: [PATCH] regex: stop using alloca * lib/regex_internal.h: Do not include or define __libc_use_alloca or alloca. Patch written by Adhemerval Zanella: https://sourceware.org/pipermail/libc-alpha/2021-January/121374.html * modules/regex (Depends-on): Remove alloca-opt. --- ChangeLog | 6 ++++++ lib/regex_internal.h | 19 ------------------- modules/regex | 1 - 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 708a266b0..a2787f59a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2021-01-08 Paul Eggert + regex: stop using alloca + * lib/regex_internal.h: Do not include or define + __libc_use_alloca or alloca. Patch written by Adhemerval Zanella: + https://sourceware.org/pipermail/libc-alpha/2021-January/121374.html + * modules/regex (Depends-on): Remove alloca-opt. + regexec: remove alloca usage in build_trtable Prompted by this different change proposed by Adhemerval Zanella: https://sourceware.org/pipermail/libc-alpha/2021-January/121373.html diff --git a/lib/regex_internal.h b/lib/regex_internal.h index 5d4d5fe2b..b4f91d9ec 100644 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -445,25 +445,6 @@ typedef struct re_dfa_t re_dfa_t; #define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx)) #define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx)) -#if defined _LIBC || HAVE_ALLOCA -# include -#endif - -#ifndef _LIBC -# if HAVE_ALLOCA -/* The OS usually guarantees only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - allocate anything larger than 4096 bytes. Also care for the possibility - of a few compiler-allocated temporary stack slots. */ -# define __libc_use_alloca(n) ((n) < 4032) -# else -/* alloca is implemented with malloc, so just use malloc. */ -# define __libc_use_alloca(n) 0 -# undef alloca -# define alloca(n) malloc (n) -# endif -#endif - #ifdef _LIBC # define MALLOC_0_IS_NONNULL 1 #elif !defined MALLOC_0_IS_NONNULL diff --git a/modules/regex b/modules/regex index 39297dfe3..20cbe375a 100644 --- a/modules/regex +++ b/modules/regex @@ -16,7 +16,6 @@ Depends-on: c99 extensions ssize_t -alloca-opt [test $ac_use_included_regex = yes] btowc [test $ac_use_included_regex = yes] builtin-expect [test $ac_use_included_regex = yes] dynarray [test $ac_use_included_regex = yes] -- 2.27.0 --------------B7E25A2FB195387A2EEF2D08--