https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126144
Bug ID: 126144
Summary: libgo doesn't build on NetBSD libgomp/125951
libgomp.c/omp-get-device-distances.
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: go
Assignee: ian at airs dot com
Reporter: ro at gcc dot gnu.org
Target Milestone: ---
Target: amd64-pc-netbsd10.1
While working to fix the FreeBSD build of libgo, I tried to check NetBSD which
seems to be in far better shape. However, even that doesn't build on current
trunk, although with way less issues:
* libgo.so doesn't run due to an undefined reference to syscall.sysctl. This
is from go/golang.org/x/net/route/syscall.go and easily fixed by changing
go:linkname.
* go/runtime/os_netbsd.go doesn't compile:
go/runtime/os_netbsd.go:8:21: error: imported and not used: abi
8 | "internal/abi"
| ^
* There are more compile errors:
go/runtime/proc.go:4324:9: error: reference to undefined name
'setThreadCPUProfiler'
4324 | setThreadCPUProfiler(0)
| ^
go/runtime/proc.go:4330:17: error: reference to undefined name
'setProcessCPUProfiler'
4330 | setProcessCPUProfiler(hz)
| ^
go/runtime/proc.go:4340:17: error: reference to undefined name
'setThreadCPUProfiler'
4340 | setThreadCPUProfiler(hz)
| ^
go/runtime/signal_unix.go:418:28: error: reference to undefined
name'validSIGPROF'
418 | if validSIGPROF(nil, &c) {
| ^
runtime/signal_unix.go:512:20: error: reference to undefined name
'validSIGPROF'
512 | if validSIGPROF(_g_.m, c) {
| ^
The attached patch takes the definitions from upstream go1.18.
With those changes, libgo.so links and libgo test results look reasonable:
FAIL: math
FAIL: net
FAIL: syscall
=== libgo Summary ===
# of expected passes 193
# of unexpected failures 3