|
libInit runs before rt0_go, which is where TLS setup occurs. Thus the
contents of the TLS may not be defined, so the g lookup in asmcgocall is
not safe.
Concretely, android-386 c-shared builds crash without this change
because asmcgocall reads an invalid non-zero g from the TLS.
Move libInit to a file limited to GOARCH that support c-archive or
c-shared so that only those require asmcgocall_no_g. In addition,
loong64 and s390x need asmcgocall_no_g implementations.
Fixes #78480.
Cq-Include-Trybots: luci.golang.try:gotip-linux-loong64,gotip-linux-s390x
Change-Id: I175e6d020339af89c9b576535d79c1e76a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/761541
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
|