Previously the eclass featured its own GOARCH mapping, that took care
of less cases than the dev-lang/go ebuild did, and broke Go packages on
arches like loong (GOARCH=loong64), mips (4 GOARCHes supported in total)
or riscv (GOARCH=riscv64).
This patch adds a copy of the go_arch() helper from dev-lang/go to the
eclass and switches the go-env_set_compile_environment() function to use
that, to fix the problem at hand.
Fixes: 878d04daaf34765e6224e58139a9c45921d7a0c3
Closes:
https://bugs.gentoo.org/917750
Signed-off-by: WANG Xuerui <
xen0n@gentoo.org>
---
eclass/go-env.eclass | 40 ++++++++++++++++++++++++++--------------
1 file changed, 26 insertions(+), 14 deletions(-)
diff --git a/eclass/go-env.eclass b/eclass/go-env.eclass
index ba4f6c3fbb59..08e3cf498a70 100644
--- a/eclass/go-env.eclass
+++ b/eclass/go-env.eclass
@@ -8,7 +8,7 @@
# Flatcar Linux Maintainers <
infra@flatcar-linux.org>
# @BLURB: Helper eclass for setting the Go compile environment. Required for cross-compiling.
# @DESCRIPTION:
-# This eclass includes a helper function for setting the compile environment for Go ebuilds.
+# This eclass includes helper functions for setting the compile environment for Go ebuilds.
# Intended to be called by other Go eclasses in an early build stage, e.g. src_unpack.
if [[ -z ${_GO_ENV_ECLASS} ]]; then
@@ -25,24 +25,36 @@ inherit toolchain-funcs
# (e.g. "emerge-aarch64-cross-linux-gnu foo" run on x86_64 will emerge "foo" for x86_64
# instead of aarch64)
go-env_set_compile_environment() {
- local arch="$(tc-arch)"
- case "${ar