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) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BD8E8158099 for ; Thu, 23 Nov 2023 23:01:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 053AC2BC025; Thu, 23 Nov 2023 23:01:15 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 902472BC018 for ; Thu, 23 Nov 2023 23:01:14 +0000 (UTC) Date: Thu, 23 Nov 2023 18:01:10 -0500 From: Ionen Wolkens To: gentoo-dev@lists.gentoo.org Cc: WANG Xuerui , Thilo Fromm , Flatcar Linux Maintainers Subject: Re: [gentoo-dev] [PATCH 2/2] go-env.eclass: also set GOARM & GO386 when applicable Message-ID: Mail-Followup-To: gentoo-dev@lists.gentoo.org, WANG Xuerui , Thilo Fromm , Flatcar Linux Maintainers References: <20231123093159.1228864-1-xen0n@gentoo.org> <20231123093159.1228864-3-xen0n@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: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="07ruYaBJPjaUXKBP" Content-Disposition: inline In-Reply-To: <20231123093159.1228864-3-xen0n@gentoo.org> X-Archives-Salt: 40431c30-953e-4e27-ae96-866fa4b2169d X-Archives-Hash: e7c39e28c5f9ff7b89f6dfc11c8f81a6 --07ruYaBJPjaUXKBP Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 23, 2023 at 05:31:59PM +0800, WANG Xuerui wrote: > This is necessary for the build artifact to conform to the configured > ISA level and features on those arches. The logic is also taken from > the dev-lang/go ebuild. >=20 > Signed-off-by: WANG Xuerui > --- > eclass/go-env.eclass | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) >=20 > diff --git a/eclass/go-env.eclass b/eclass/go-env.eclass > index 08e3cf498a70..4bc8c4b15c65 100644 > --- a/eclass/go-env.eclass > +++ b/eclass/go-env.eclass > @@ -19,6 +19,8 @@ inherit toolchain-funcs > # @FUNCTION: go-env_set_compile_environment > # @DESCRIPTION: > # Set up basic compile environment: CC, CXX, and GOARCH. > +# Necessary platform-specific settings such as GOARM or GO386 are also s= et > +# according to the Portage configuration when building for those archite= ctures. > # Also carry over CFLAGS, LDFLAGS and friends. > # Required for cross-compiling with crossdev. > # If not set, host defaults will be used and the resulting binaries are = host arch. > @@ -28,6 +30,9 @@ go-env_set_compile_environment() { > tc-export CC CXX > =20 > export GOARCH=3D"$(go-env_goarch)" > + use arm && export GOARM=3D$(go-env_goarm) > + use x86 && export GO386=3D$(usex cpu_flags_x86_sse2 '' 'softfloat') cpu_flags_x86_sse2 is not an IUSE_IMPLICIT, meaning that emerging a package without it in IUSE for x86 will result in: * ERROR: x11-terms/kitty-0.31.0::gentoo failed (compile phase): * USE Flag 'cpu_flags_x86_sse2' not in IUSE for x11-terms/kitty-0.31.0 > + > export CGO_CFLAGS=3D"${CGO_CFLAGS:-$CFLAGS}" > export CGO_CPPFLAGS=3D"${CGO_CPPFLAGS:-$CPPFLAGS}" > export CGO_CXXFLAGS=3D"${CGO_CXXFLAGS:-$CXXFLAGS}" > @@ -57,4 +62,20 @@ go-env_goarch() { > esac > } > =20 > +# @FUNCTION: go-env_goarm > +# @USAGE: [CHOST-value] > +# @DESCRIPTION: > +# Returns the appropriate GOARM setting for the CHOST given, or the defa= ult > +# CHOST. > +go-env_goarm() { > + case "${1:-${CHOST}}" in > + armv5*) echo 5;; > + armv6*) echo 6;; > + armv7*) echo 7;; > + *) > + die "unknown GOARM for ${1:-${CHOST}}" > + ;; > + esac > +} > + > fi > --=20 > 2.42.1 >=20 >=20 --=20 ionen --07ruYaBJPjaUXKBP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmVf2bYACgkQskQGsLCs QzQN1QgAlTqE2ZNYRVcDtp4WTAytF55MgVr3mYMI+uLR0OjtxH+k2tEJd5941ZZr GrTO38VXDv7M7XfioozX0TZZLCODpeI5dyiwpCR5yZGvMIFg8zGIvFVR8rFb5fuV eBhb7npUbP+0ylSqaq/cARlx1Qol5tpaDEIsAciC43BL10AhHQfbx9gwNmhsEusi MCDURc4R9Tpls/uQxSZI+iLFmS80u54goKg1V+rlvCUpnDoqT/Mda47I2QXP3FVn 6CbVMHno8BBNqIVdiYTsVhtBw3avKXaBp0HuEonOOWCn4skGX+Yy0Cx8JtOtLkrd dBfd08Y0URDvs3uosejs0ZPt0RvIOg== =zV7z -----END PGP SIGNATURE----- --07ruYaBJPjaUXKBP--