From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 7E+tJ2hk/WpUnxsAWB0awg (envelope-from ) for ; Wed, 18 Nov 2026 03:40:08 -0500 Received: by simark.ca (Postfix, from userid 112) id 5E1F91E0BC; Wed, 18 Nov 2026 03:40:08 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1FC221E087 for ; Wed, 18 Nov 2026 03:40:07 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4B64A4BA2E38 for ; Wed, 18 Nov 2026 08:40:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B64A4BA2E38 Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 89E754BA2E18; Wed, 18 Nov 2026 08:39:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 89E754BA2E18 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 89E754BA2E18 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794991175; cv=none; b=cN3QhMDEpWusyg1xeT3q3lRCyvez9o2nlemDcBeiigYK+1zdYTLQ5ajEFn06bywrHyuU+eFBHWfySFN4PcpqlvpIGs9gH5iLB2hEpVLhwowZdFGaOJuSLi3WYpTEFN30ZvaLcqqobC7TMoO0VCMBOM9io/RF1EMppbilzV3DRzk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794991175; c=relaxed/simple; bh=3M91hAAT5qWaQVrBHE3LkQoxGpIdsC6U/3u3WYymhJQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=YPV1fEmTchSgk1FFt3hncIaNq6NHmHOH4lrC9mdjGMJZqPHKkYCf+nq85y0zdYb1PyIsl3TP1BZEbz/EWIRnNKvkygWzroPg+b1q5VFOkAko0hQzSSK/cV9z3B6Q5rxWcGhB4DljwQldXPXbSaW6yaB0JwOLoCukQgmn65KD8t0= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 89E754BA2E18 Received: from mop.sam.mop (unknown [IPv6:2001:8b0:19dc:dc5a::a1c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sam) by smtp.gentoo.org (Postfix) with ESMTPSA id 17161342AB6; Wed, 18 Nov 2026 08:39:33 +0000 (UTC) From: Sam James To: Nick Alcock Cc: binutils@sourceware.org, gdb-patches@sourceware.org, iain@sandoe.co.uk Subject: Re: [PATCH] Fix libiberty.h inclusion on non-glibc hosts tree-wide In-Reply-To: <20261118004926.6404-1-nix@esperi.org.uk> Organization: Gentoo References: <20261118004926.6404-1-nix@esperi.org.uk> User-Agent: mu4e 1.14.4; emacs 32.0.50 Date: Wed, 18 Nov 2026 08:39:25 +0000 Message-ID: <8733syzg76.fsf@gentoo.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org --=-=-= Content-Type: text/plain Nick Alcock writes: > In 2025, Iain Sandoe added memrchr support to libiberty.h. This requires > a new AC_CHECK_FUNCS of memrchr in every project that transitively > includes it, or builds on non-glibc, non-Linux hosts will fail (observed > on FreeBSD 15). That doesn't sound right to me as stated: it would mean nobody has reported or tested that in over a year, even for say musl? Or do you mean 'non-glibc and non-Linux'? (I guess you do based on the condition in libiberty.h now I look). Anyway, does it really require that? include/libiberty.h has: /* Make memrchr available on systems that do not have it. */ #if !defined (__GNU_LIBRARY__ ) && !defined (__linux__) && \ !defined (HAVE_MEMRCHR) extern void *memrchr(const void *, int, size_t); #endif so on say, FreeBSD, I would expect this to be used. Then you get the link-time definition from libiberty? Can you show me what the failure is please? > > Fix trivial, but a tad invasive, since a lot of projects include > libiberty.h, and it shows up a few places that don't include config.h at > all (including some that include ansidecl.h, which requires config.h for > proper operation). > > All relevant configury regenerated. > > Also touches GDB machinery, so gdb-patches is Cc:ed. > > Iain Sandoe Cc:ed: Iain, if you disagree with my rather nasty approach > here, I'd be interested in anything better. (The need to use %top in > binutils/arlex.l is slightly worrying. It's not in POSIX, but > we need something like it or we can't include config.h before the > system headers it must precede. (Including config.h in libiberty.h > won't work for the same reason.) > > But if you don't do this, you can't compile binutils/arlex.c on > FreeBSD any more (or any non-Linux, non-glibc system). > Sorry if I'm missing something obvious here, it's a busy fortnight for me but I wanted to reply before we do something that may be the wrong direction. sam --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEBBAEWCgCpFiEEJaa7iN2bdkxrVUHCc4QJ9SDfkZAFAmr9ZD0bFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMiwyXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25z Lm9wZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQyNUE2QkI4OEREOUI3NjRDNkI1NTQx QzI3Mzg0MDlGNTIwREY5MTkwDxxzYW1AZ2VudG9vLm9yZwAKCRBzhAn1IN+RkB19 AP4iiovLbzpplWpUYCr9Q3R8qvY919nQbPHnHB/OmsrSrAD/dWSoXXdYsVkvXGtG YLe0p1zskT3z54Oi/eHztq2YfgQ= =OxWk -----END PGP SIGNATURE----- --=-=-=--