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 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index 2b57fc118705..8299c103c8dc 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -369,6 +369,13 @@ tc-export_build_env() { : "${BUILD_CXXFLAGS:=${CXXFLAGS}}" : "${BUILD_CPPFLAGS:=${CPPFLAGS}}" : "${BUILD_LDFLAGS:=${LDFLAGS}}" + + if has go-env ${INHERITED}; then + : "${BUILD_GOAMD64:=${GOAMD64}}" + : "${BUILD_GOARM64:=${GOARM64}}" + : "${BUILD_GOPPC64:=${GOPPC64}}" + : "${BUILD_GORISCV64:=${GORISCV64}}" + fi fi export BUILD_{C,CXX,CPP,LD}FLAGS @@ -388,6 +395,13 @@ tc-export_build_env() { # the target build system does not check. tc-env_build() { tc-export_build_env + + has go-env ${INHERITED} && local -x \ + GOAMD64=${BUILD_GOAMD64} \ + GOARM64=${BUILD_GOARM64} \ + GOPPC64=${BUILD_GOPPC64} \ + GORISCV64=${BUILD_GORISCV64} + CFLAGS=${BUILD_CFLAGS} \ CXXFLAGS=${BUILD_CXXFLAGS} \ CPPFLAGS=${BUILD_CPPFLAGS} \ -- 2.53.0
