]> Cypherpunks repositories - gostls13.git/commit
runtime/cgo: make cgo work with openbsd ABI changes
authorJoel Sing <joel@sing.id.au>
Wed, 18 May 2016 13:39:23 +0000 (23:39 +1000)
committerJoel Sing <joel@sing.id.au>
Thu, 19 May 2016 15:43:37 +0000 (15:43 +0000)
commit0dcd330bc8ab19db15b4517b80e940cf154071bc
treef5d54571a08e2ec297c938d2944e5884a5b35998
parentd603c27c6b462f044a7079ce5113d90bb3ca4814
runtime/cgo: make cgo work with openbsd ABI changes

OpenBSD 6.0 (due out November 2016) will support PT_TLS, which will
allow for the OpenBSD cgo pthread_create() workaround to be removed.

However, in order for Go to continue working on supported OpenBSD
releases (the current release and the previous release - 5.9 and 6.0,
once 6.0 is released), we cannot enable PT_TLS immediately. Instead,
adjust the existing code so that it works with the previous TCB
allocation and the new TIB allocation. This allows the same Go
runtime to work on 5.8, 5.9 and later 6.0.

Once OpenBSD 5.9 is no longer supported (May 2017, when 6.1 is
released), PT_TLS can be enabled and the additional cgo runtime
code removed.

Change-Id: I3eed5ec593d80eea78c6656cb12557004b2c0c9a
Reviewed-on: https://go-review.googlesource.com/23197
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Joel Sing <joel@sing.id.au>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/runtime/cgo/gcc_openbsd_386.c
src/runtime/cgo/gcc_openbsd_amd64.c