golang/go

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

Open

#54.305 aperta il 5 ago 2022

Vedi su GitHub
 (2 commenti) (0 reazioni) (1 assegnatario)Go (19.008 fork)batch import
NeedsFixarch-armcompiler/runtimehelp wanted

Metriche repository

Star
 (133.883 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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.

Guida contributor