Commit 108707de74 for golang
commit 108707de74caa9920b224aaec66a6386b7639e06
Author: Michael Matloob <matloob@golang.org>
Date: Fri Dec 4 10:37:21 2026 -0500
cmd/cgo,cmd/go: remove broken builder check from cgobindings check
For #83648
Change-Id: Ia8037dbae9017b6f3ab80096651975616a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/869302
Auto-Submit: Michael Matloob <matloob@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/src/cmd/cgo/main.go b/src/cmd/cgo/main.go
index 26609368ae..e19daae811 100644
--- a/src/cmd/cgo/main.go
+++ b/src/cmd/cgo/main.go
@@ -397,7 +397,7 @@ func main() {
if !buildcfg.Experiment.CgoBindings {
fatalf("-binding requires GOEXPERIMENT=cgobindings")
}
- if !platform.CgoSupported(goos, goarch) || platform.Broken(goos, goarch) {
+ if !platform.CgoSupported(goos, goarch) {
fatalf("-binding is not supported on %s/%s", goos, goarch)
}
p.processBinding(goFiles)
@@ -408,7 +408,7 @@ func main() {
if !buildcfg.Experiment.CgoBindings {
fatalf("-gen-binding requires GOEXPERIMENT=cgobindings")
}
- if !platform.CgoSupported(goos, goarch) || platform.Broken(goos, goarch) {
+ if !platform.CgoSupported(goos, goarch) {
fatalf("-gen-binding is not supported on %s/%s", goos, goarch)
}
}
diff --git a/src/cmd/go/internal/work/init.go b/src/cmd/go/internal/work/init.go
index 1bcfc51946..6faf8892db 100644
--- a/src/cmd/go/internal/work/init.go
+++ b/src/cmd/go/internal/work/init.go
@@ -93,7 +93,7 @@ func BuildInit(ld *modload.Loader) {
// commands like go env, go version, and go help keep working with a
// saved CGO_ENABLED=bindings setting.
if cfg.BuildContext.CgoEnabled == build.CgoBindings {
- if !platform.CgoSupported(cfg.Goos, cfg.Goarch) || platform.Broken(cfg.Goos, cfg.Goarch) {
+ if !platform.CgoSupported(cfg.Goos, cfg.Goarch) {
base.Fatalf("go: CGO_ENABLED=bindings is not supported on %s/%s", cfg.Goos, cfg.Goarch)
}
if cfg.Experiment != nil && !cfg.Experiment.CgoBindings {
diff --git a/src/cmd/go/testdata/script/cgo_binding.txt b/src/cmd/go/testdata/script/cgo_binding.txt
index 21616505ab..4f87813e67 100644
--- a/src/cmd/go/testdata/script/cgo_binding.txt
+++ b/src/cmd/go/testdata/script/cgo_binding.txt
@@ -7,8 +7,6 @@ env GOEXPERIMENT=$GOEXPERIMENT,runtimecgopurego,cgobindings
[GOOS:js] skip
[GOOS:wasip1] skip
[GOOS:openbsd] [GOARCH:ppc64] skip
-[GOOS:freebsd] [GOARCH:riscv64] skip
-[GOOS:linux] [GOARCH:sparc64] skip
env CGO_ENABLED=bindings
# Make any use of the C compiler or external linker by the go command fail.
diff --git a/src/cmd/go/testdata/script/cgo_bindings_index.txt b/src/cmd/go/testdata/script/cgo_bindings_index.txt
index 321b343415..dce55ca649 100644
--- a/src/cmd/go/testdata/script/cgo_bindings_index.txt
+++ b/src/cmd/go/testdata/script/cgo_bindings_index.txt
@@ -8,8 +8,6 @@ env GOEXPERIMENT=$GOEXPERIMENT,runtimecgopurego,cgobindings
[GOOS:js] skip
[GOOS:wasip1] skip
[GOOS:openbsd] [GOARCH:ppc64] skip
-[GOOS:freebsd] [GOARCH:riscv64] skip
-[GOOS:linux] [GOARCH:sparc64] skip
env CGO_ENABLED=bindings
[!GOOS:windows] [!cgolinkext] env CC=/bin/false
diff --git a/src/cmd/go/testdata/script/list_export_cgo_bindings.txt b/src/cmd/go/testdata/script/list_export_cgo_bindings.txt
index 38ed1f216a..854f13407b 100644
--- a/src/cmd/go/testdata/script/list_export_cgo_bindings.txt
+++ b/src/cmd/go/testdata/script/list_export_cgo_bindings.txt
@@ -8,8 +8,6 @@ env GOEXPERIMENT=$GOEXPERIMENT,runtimecgopurego,cgobindings,golistexportnewforma
[GOOS:js] skip
[GOOS:wasip1] skip
[GOOS:openbsd] [GOARCH:ppc64] skip
-[GOOS:freebsd] [GOARCH:riscv64] skip
-[GOOS:linux] [GOARCH:sparc64] skip
# Build the pure-Go verifier under the host GOEXPERIMENT in parallel so it
# reuses the warm standard library GOCACHE instead of rebuilding go/importer