Re: [PATCH 11/14] toolchain-funcs.eclass: Set some Go arch-specific vars in tc-env_build

James Le Cuirot <[email protected]>
Newsgroups gmane.linux.gentoo.devel
Message-ID <[email protected]>
On Sun, 2026-03-15 at 00:37 -0400, Eli Schwartz wrote:
> On 3/14/26 5:31 AM, James Le Cuirot wrote:
> > Some Go arch-specific variables can be set automatically based on the
> > tuple alone. Others cannot feasibly be determined automatically and must
> > therefore be set by the user. It is sometimes necessary to build Go code
> > for CBUILD, so use BUILD_GO* variables in case CHOST is a more advanced
> > model of CBUILD's architecture.
> > 
> > Signed-off-by: James Le Cuirot <[email protected]>
> > ---
> >  eclass/toolchain-funcs.eclass | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
> > index 2b57fc118705..85d90f4579ef 100644
> > --- a/eclass/toolchain-funcs.eclass
> > +++ b/eclass/toolchain-funcs.eclass
> > @@ -369,6 +369,10 @@ tc-export_build_env() {
> >  		: "${BUILD_CXXFLAGS:=${CXXFLAGS}}"
> >  		: "${BUILD_CPPFLAGS:=${CPPFLAGS}}"
> >  		: "${BUILD_LDFLAGS:=${LDFLAGS}}"
> > +		: "${BUILD_GOAMD64:=${GOAMD64}}"
> > +		: "${BUILD_GOARM64:=${GOARM64}}"
> > +		: "${BUILD_GOPPC64:=${GOPPC64}}"
> > +		: "${BUILD_GORISCV64:=${GORISCV64}}"
> 
> 
> Would it make sense to only do this when go-env has been inherited, to
> avoid cluttering the env?
> 
> 
> >  	fi
> >  	export BUILD_{C,CXX,CPP,LD}FLAGS
> >  
> > @@ -392,6 +396,10 @@ tc-env_build() {
> >  	CXXFLAGS=${BUILD_CXXFLAGS} \
> >  	CPPFLAGS=${BUILD_CPPFLAGS} \
> >  	LDFLAGS=${BUILD_LDFLAGS} \
> > +	GOAMD64=${BUILD_GOAMD64} \
> > +	GOARM64=${BUILD_GOARM64} \
> > +	GOPPC64=${BUILD_GOPPC64} \
> > +	GORISCV64=${BUILD_GORISCV64} \
> >  	AR=$(tc-getBUILD_AR) \
> >  	AS=$(tc-getBUILD_AS) \
> >  	CC=$(tc-getBUILD_CC) \
> 

I didn't think cluttering the env was really an issue, but that wouldn't hurt,
so okay. Ideally, I would have handled it in go-env.eclass, but there didn't
seem to be a nice way to do that.
signature.asc (application/pgp-signature, 1 KB)
-----BEGIN PGP SIGNATURE-----

iQLBBAABCgCrFiEEPxcZ3tkwcedKm2a8EiZBXQDdMTcFAmm2cIUbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwyXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25z
Lm9wZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQzRjE3MTlERUQ5MzA3MUU3NEE5QjY2
QkMxMjI2NDE1RDAwREQzMTM3ERxjaGV3aUBnZW50b28ub3JnAAoJEBImQV0A3TE3
7D8P/0SOcaRK9TMsi+ZN++o2ZuP95iEGGy1uuC6Gsp9WIBJUgZH96M2SbdfzqvsP
hVr0aHSdobtf41c3S+CljfNciwepEgI1P9wHL5K/Xx+H8FNPSOtvmrj6BQgXJmNH
Rhl4BXMt/iZWM9emaCQ+9YJZCAaXlwQoiOTTUorWIfUUISR5KBp9NlGn18PkhOQM
BUlBr/uYcanrvcRpDn6xWsv83MelJ5gXCIcseA9M3xeoJ0Fkbff9+BD9/kjN5BNP
hFBvTheBlhrWkOncWbk3sGasTxd8rFuiTihPVnKZhk83EizJ/S0PxnDLUFx83M0M
DeKAQqlHZO9Bf6MdbD9lmhadogGbTM3ONYjtvz+0UMlsTiD0JlnF/Z3OMyJCYi9p
bFk8iTFLsh2zbgRD8mWyxE2uBgkKGyDjRKb4k6PBOSCgfl9SA8MeRxVFeaAGjG7W
HEhfAfZs6tGB2hfklD243qfWLwnh6O23V302zxvPVFVKUBsmj6xgrmyswus9A4I1
cIioNxFKXRZEAJwF9EXxTyZBpJRk1+DCxq4o0mNcWCScIZorFQ9A8H6iI7pUUiJL
/tEzbleoITK/86pfoKngSH+VMp7sy8GNOKpB5A1WN3E3SYFqqxOuGu1gLpKZI/nF
VZRkK8ILTs4aB7lGRU66+CpYqcUnTQ328reo485j/fru06Je
=kDuC
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.