We might be cross-compiling for another OS.

Signed-off-by: James Le Cuirot <[email protected]>
---
 eclass/go-env.eclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/eclass/go-env.eclass b/eclass/go-env.eclass
index 1c0a4be56005..a38c208d7bf1 100644
--- a/eclass/go-env.eclass
+++ b/eclass/go-env.eclass
@@ -44,7 +44,8 @@ go-env_set_compile_environment() {
        export \
                GOFLAGS="-x -v -modcacherw -buildvcs=false" \
                GOMAXPROCS=$(get_makeopts_jobs) \
-               GOARCH=$(go-env_goarch)
+               GOARCH=$(go-env_goarch) \
+               GOOS=$(go-env_goos)
 
        case ${GOARCH} in
                386|amd64|arm*|ppc64le|s390*) GOFLAGS+=" -buildmode=pie" ;;
-- 
2.53.0


Reply via email to