From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id f2+6OhDpfWAsfgAAWB0awg (envelope-from ) for ; Mon, 19 Apr 2021 16:33:20 -0400 Received: by simark.ca (Postfix, from userid 112) id E5A0B1F104; Mon, 19 Apr 2021 16:33:20 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=MAILING_LIST_MULTI, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 113881E01F for ; Mon, 19 Apr 2021 16:33:20 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 625F63959CBE; Mon, 19 Apr 2021 20:33:19 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id A900D3947404 for ; Mon, 19 Apr 2021 20:33:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A900D3947404 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B9643B02E; Mon, 19 Apr 2021 20:33:07 +0000 (UTC) MIME-Version: 1.0 Date: Mon, 19 Apr 2021 22:33:07 +0200 From: tdevries To: Tom Tromey Subject: Re: [PATCH][gdb/build] Hardcode --with-included-regex In-Reply-To: <87k0oycazs.fsf@tromey.com> References: <20210413153447.GA21719@delia> <87k0oycazs.fsf@tromey.com> User-Agent: Roundcube Webmail Message-ID: <77a676bcd18e5603a4597fee89dc4269@suse.de> X-Sender: tdevries@suse.de Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-04-19 21:47, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries writes: > > Tom> A note on the latter: it's actually a bug to compile a regex > using regcomp and > Tom> then pass it to re_search. The GNU regex interface requires one > to use > Tom> re_compile_pattern or re_compile_fastmap. But as long we're > using one of the > Tom> GNU regex incarnations in gnulib, glibc or libiberty, we get away > with this. > > Tom> The PR could be fixed by adding -lc in a specific position in the > link line, > Tom> to force regcomp to be bound to glibc. But this solution was > considered > Tom> in the discussion in the PR as being brittle, and possibly causing > problems > Tom> elsewhere. > > Tom> Another solution offered was to restrict regex usage to posix, > and no longer > Tom> use the GNU regex API. This however could mean having to > reproduce some of > Tom> that functionality locally, which would mean maintaining the same > Tom> functionality in more than one place. > > Just to be clear, using the GNU extensions isn't currently done, I > think. In gdb_regex.{c,h}, we have compiled_regex::search, which uses GNU regex function re_search. The functionality is actually used, removing it breaks the gdb build. So I don't quite understand your remark. Thanks, - Tom > I'd like to use them so GDB can avoid copying some strings to > ensure they are \0-terminated; but this isn't done at the moment. > > So, it would also be equivalent, right now, to switch GDB to conform to > POSIX here. > > Personally I'm fine with just requiring the libiberty regexp. > That said we should probably see if there are differing opinions, or > some reason to keep the flag. > > thanks, > Tom