go icon indicating copy to clipboard operation
go copied to clipboard

runtime: openbsd/arm fails when compiled with GOARM=5

Open 4a6f656c opened this issue 3 years ago • 1 comments

When the arm architecture is compiled with GOARM=5, the linker rewrites TLS register loads from MRC with a call to runtime.read_tls_fallback - on OpenBSD post 6.9, this fails since runtime.read_tls_fallback is still a direct system call:

https://github.com/golang/go/blob/master/src/runtime/sys_openbsd_arm.s#L90

This code path is generally never hit, since the minimum ARM CPU supported by OpenBSD is v7 and hence GOARM=7 is the default.

We should either:

  1. Revise runtime.read_tls_fallback to use a libc-based system call.

  2. Prevent GOARM < 7 from being used on openbsd/arm and remove the fallback code entirely.

4a6f656c avatar Aug 05 '22 19:08 4a6f656c

I think we only support GOARM=5 on Linux. On other OSes we only support GOARM=6 or 7.

I think it is okay to have a check with better error message (and remove fallback code). Thanks.

cherrymui avatar Aug 08 '22 17:08 cherrymui

Change https://go.dev/cl/443276 mentions this issue: cmd/dist,internal/buildcfg,runtime: only allow GOARM=7 for openbsd/arm

gopherbot avatar Oct 17 '22 03:10 gopherbot