Remove cross compilation support from go packages
Go packages supported cross-compilation (to linux_musl at least), but
go binaries did not. Go packages also add a reverse dependency onto
the binary packages, which would cause a missing dependency error,
except that all non-primary variants of go modules essentially disable
themselves and reuse outputs from the primary variants. However, in
mac builds, for some reason the primary variant is arm64 but the binary
is only created for x86_64. This causes the missing dependency, but
mac sets AllowMissingDependencies, but the missing dependencies still
cause problems when generating soong documentation.
After we submit this cl, we can potentially make the go modules not
copy outputs from the primary variation, and instead have all variations
work independently.
Bug: 369916167
Test: m soong_docs on mac
Change-Id: I967e63fc16f3b2a5cc1fa00ab62f5626b268c087
diff --git a/golang/golang.go b/golang/golang.go
index 618a085..6ee924f 100644
--- a/golang/golang.go
+++ b/golang/golang.go
@@ -22,6 +22,7 @@
import (
"android/soong/android"
+
"github.com/google/blueprint"
"github.com/google/blueprint/bootstrap"
)
@@ -46,7 +47,7 @@
func goPackageModuleFactory() android.Module {
module := &GoPackage{}
module.AddProperties(module.Properties()...)
- android.InitAndroidArchModule(module, android.HostSupported, android.MultilibFirst)
+ android.InitAndroidArchModule(module, android.HostSupportedNoCross, android.MultilibFirst)
return module
}