From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E034C158089 for ; Wed, 8 Nov 2023 06:45:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 305632BC029; Wed, 8 Nov 2023 06:45:10 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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) by pigeon.gentoo.org (Postfix) with ESMTPS id D70E02BC01D for ; Wed, 8 Nov 2023 06:45:09 +0000 (UTC) References: <20231106222527.25833-1-chewi@gentoo.org> User-agent: mu4e 1.10.7; emacs 30.0.50 From: Sam James To: gentoo-dev@lists.gentoo.org Cc: James Le Cuirot Cc: toolchain@gentoo.org Subject: Re: [gentoo-dev] [PATCH] toolchain-funcs.eclass: Add functions to get pointer size in bytes Date: Wed, 08 Nov 2023 06:44:51 +0000 Organization: Gentoo In-reply-to: <20231106222527.25833-1-chewi@gentoo.org> Message-ID: <87edh0n3pp.fsf@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain X-Archives-Salt: ef599f93-6ec5-4ac4-8bd7-0a0e45787727 X-Archives-Hash: 2d02c791e55847f741404eaec3d40261 James Le Cuirot writes: > tc-get-ptr-size for CHOST and tc-get-build-ptr-size for CBUILD. > > Closes: https://bugs.gentoo.org/328401 > Signed-off-by: James Le Cuirot > --- lgtm > eclass/toolchain-funcs.eclass | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass > index 8fef764ad597..5da93063866b 100644 > --- a/eclass/toolchain-funcs.eclass > +++ b/eclass/toolchain-funcs.eclass > @@ -1216,4 +1216,18 @@ tc-get-c-rtlib() { > return 0 > } > > +# @FUNCTION: tc-get-ptr-size > +# @RETURN: Size of a pointer in bytes for CHOST (e.g. 4 or 8). > +tc-get-ptr-size() { > + $(tc-getCPP) -P - <<< __SIZEOF_POINTER__ || > + die "Could not determine CHOST pointer size" > +} > + > +# @FUNCTION: tc-get-build-ptr-size > +# @RETURN: Size of a pointer in bytes for CBUILD (e.g. 4 or 8). > +tc-get-build-ptr-size() { > + $(tc-getBUILD_CPP) -P - <<< __SIZEOF_POINTER__ || > + die "Could not determine CBUILD pointer size" > +} > + > fi