cgo: enable cgo on openbsd

Enable cgo on OpenBSD.

The OpenBSD ld.so(1) does not currently support PT_TLS sections. Work
around this by fixing up the TCB that has been provided by librthread
and reallocating a TCB with additional space for TLS. Also provide a
wrapper for pthread_create, allowing zeroed TLS to be allocated for
threads created externally to Go.

Joint work with Shenghou Ma (minux).

Requires change 6846064.

Fixes #3205.

R=golang-dev, minux.ma, iant, rsc, iant
CC=golang-dev
https://golang.org/cl/6853059
This commit is contained in:
Joel Sing 2012-12-21 01:43:19 +11:00
parent e6ca125f14
commit 708db79011
9 changed files with 390 additions and 3 deletions

View file

@ -45,6 +45,10 @@ fi
if [ "$goos" == "netbsd" ]; then
c_go_cgo=""
fi
# cgo3 and cgo4 don't run on openbsd, since cgo cannot handle stdout correctly
if [ "$goos" == "openbsd" ]; then
c_go_cgo="cgo1 cgo2"
fi
timeout="
timeout1