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 2178D15817D for ; Thu, 13 Jun 2024 17:06:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 104A6E2B5F; Thu, 13 Jun 2024 17:06:26 +0000 (UTC) Received: from smtp.gentoo.org (smtp.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 BAEA1E2B51 for ; Thu, 13 Jun 2024 17:06:25 +0000 (UTC) Message-ID: Subject: Re: [gentoo-dev] [PATCH] toolchain-funcs.eclass: Add tc-has-64bit-time_t From: =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Date: Thu, 13 Jun 2024 19:06:20 +0200 In-Reply-To: References: <20240613152401.47691-1-mgorny@gentoo.org> Organization: Gentoo Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-aCt8LGlrgJg+IhigkZJG" User-Agent: Evolution 3.52.2 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 X-Archives-Salt: 450be211-e3d2-43d5-9f71-dd4a9a9af4b7 X-Archives-Hash: 1bf68e6ac80d848ecf0fd63bdb7f17e4 --=-aCt8LGlrgJg+IhigkZJG Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2024-06-13 at 17:44 +0100, James Le Cuirot wrote: > On Thu, 2024-06-13 at 17:23 +0200, Micha=C5=82 G=C3=B3rny wrote: > > Add a helper function to check whether time_t is 64-bit. This could > > be used e.g. to deselect tests that rely on timestamps exceeding Y2k38. > > It is meant to be more future-proof than hardcoding a list of 32-bit > > architectures, given the necessity of switching to 64-bit time_t > > in the future. > >=20 > > Signed-off-by: Micha=C5=82 G=C3=B3rny > > --- > > eclass/toolchain-funcs.eclass | 12 +++++++++++- > > 1 file changed, 11 insertions(+), 1 deletion(-) > >=20 > > Pull-Request: https://github.com/gentoo/gentoo/pull/37142 > >=20 > > diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.ecl= ass > > index cde84e6f34c8..3e20e956e9c2 100644 > > --- a/eclass/toolchain-funcs.eclass > > +++ b/eclass/toolchain-funcs.eclass > > @@ -1,4 +1,4 @@ > > -# Copyright 2002-2023 Gentoo Authors > > +# Copyright 2002-2024 Gentoo Authors > > # Distributed under the terms of the GNU General Public License v2 > > =20 > > # @ECLASS: toolchain-funcs.eclass > > @@ -1251,4 +1251,14 @@ tc-is-lto() { > > return 1 > > } > > =20 > > +# @FUNCTION: tc-has-64bit-time_t > > +# @RETURN: Shell true if time_t is at least 64 bits long, false otherw= ise > > +tc-has-64bit-time_t() { > > + "$(tc-getCC)" ${CFLAGS} ${CPPFLAGS} -c -x c - -o /dev/null <<-EOF &>/= dev/null > > + #include > > + int test[sizeof(time_t) >=3D 8 ? 1 : -1]; > > + EOF > > + return $? > > +} > > + > > fi >=20 > I take it this can't be done with tc-cpp-is-true because you need more th= an > just the preprocessor? >=20 > Please don't quote $(tc-getCC), CC can have additional arguments in some > cases. We don't quote $(tc-getTARGET_CPP) in tc-cpp-is-true. Right, thx. --=20 Best regards, Micha=C5=82 G=C3=B3rny --=-aCt8LGlrgJg+IhigkZJG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQFGBAABCgAwFiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAmZrJwwSHG1nb3JueUBn ZW50b28ub3JnAAoJEGOa2uIyniQOWrIH/38GIAzq+Y71OXp4K8rsd8MkIFBbGngt g5ZAkAu7ze8qUXeMlqEiAhtEoa/J+gLTNQwEBqfVJulBzKhtX1PkMjDV4nFHfech OmFViyuKRUO8DqkHqaV9SRqW3Ns/QcrzE8fvtBvOxND7QSB4zb+QeKtDDhbLX052 xXvuMa51T9jBiIJiA1r7QlU7/XBgCaFdmFRmPouyqGuQW6IIPcwbB2aV9UIthHA8 v1h3O1jHwWHUiWWjsfN4j99Y4TeLr+EV7Bs5m/cfYKLep2n72i5LKEnb1zg6EDl6 iCjv8tOmas+AIHBT6ebGZBhOYWsET2K9oRkAHB6Hl0xhijVVv4xLGO4= =hc5W -----END PGP SIGNATURE----- --=-aCt8LGlrgJg+IhigkZJG--