diff --git a/internal/fakecgo/threadentry_test.go b/internal/fakecgo/threadentry_test.go index 9314e095..4595d5be 100644 --- a/internal/fakecgo/threadentry_test.go +++ b/internal/fakecgo/threadentry_test.go @@ -3,7 +3,7 @@ // 386/arm are excluded: the standalone fakecgo test binary resolves pthread // from libpthread.so.0, which fails the dynamic symbol lookup on 32-bit linux. -//go:build !cgo && (linux || darwin || freebsd || illumos || netbsd) && !386 && !arm +//go:build !cgo && !(go1.28 && goexperiment.runtimecgopurego) && !go1.29 && (linux || darwin || freebsd || illumos || netbsd) && !386 && !arm package fakecgo diff --git a/nocgo.go b/nocgo.go index a98ecb6f..6858dd38 100644 --- a/nocgo.go +++ b/nocgo.go @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: 2022 The Ebitengine Authors -//go:build !cgo && (darwin || freebsd || illumos || linux || netbsd) +//go:build !cgo && !(go1.28 && goexperiment.runtimecgopurego) && !go1.29 && (darwin || freebsd || illumos || linux || netbsd) package purego diff --git a/nocgo_go128.go b/nocgo_go128.go new file mode 100644 index 00000000..967271c0 --- /dev/null +++ b/nocgo_go128.go @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2026 The Ebitengine Authors + +//go:build !cgo && ((go1.28 && goexperiment.runtimecgopurego) || go1.29) && (darwin || freebsd || illumos || linux || netbsd) + +package purego + +// Go 1.28 introduces a pure-Go and assembly implementation of runtime/cgo, +// so there's no longer a need for fakecgo and we can implement the true +// runtime/cgo. +import _ "runtime/cgo"