Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(6737)

Issue 6853059: code review 6853059: cgo: enable cgo on openbsd (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 5 months ago by jsing
Modified:
11 years, 4 months ago
Reviewers:
CC:
golang-dev, minux1, iant2, rsc, iant
Visibility:
Public.

Description

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 issue 3205.

Patch Set 1 #

Patch Set 2 : diff -r bb031a90ceea https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r bb031a90ceea https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r bb031a90ceea https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r bb031a90ceea https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r a26a8ada8f6e https://go.googlecode.com/hg/ #

Patch Set 7 : diff -r 03a6b8c9c396 https://go.googlecode.com/hg/ #

Patch Set 8 : diff -r 9050012c9765 https://go.googlecode.com/hg/ #

Total comments: 4

Patch Set 9 : diff -r e08535d6901d https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+207 lines, -9 lines) Patch
M doc/progs/run View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M misc/cgo/test/basic.go View 1 2 3 2 chunks +7 lines, -1 line 0 comments Download
src/pkg/go/build/build.go View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/net/cgo_openbsd.go View 1 0 chunks +-1 lines, --1 lines 0 comments Download
M src/pkg/net/cgo_unix.go View 1 1 chunk +1 line, -1 line 0 comments Download
src/pkg/os/user/lookup_unix.go View 1 1 chunk +1 line, -1 line 0 comments Download
src/pkg/runtime/cgo/gcc_openbsd_386.c View 1 2 3 4 5 6 5 chunks +91 lines, -2 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_openbsd_amd64.c View 1 2 3 4 5 6 5 chunks +91 lines, -2 lines 0 comments Download
M src/pkg/runtime/cgo/openbsd.c View 1 2 3 4 5 6 7 1 chunk +11 lines, -3 lines 0 comments Download

Messages

Total messages: 29
jsing
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
11 years, 5 months ago (2012-11-16 16:00:37 UTC) #1
minux1
what if extern c code creates a thread, and a signal is accidentally delivered to ...
11 years, 5 months ago (2012-11-16 17:38:11 UTC) #2
jsing
On 17 November 2012 04:38, minux <minux.ma@gmail.com> wrote: > what if extern c code creates ...
11 years, 5 months ago (2012-11-17 14:33:18 UTC) #3
minux1
On Sat, Nov 17, 2012 at 10:33 PM, Joel Sing <jsing@google.com> wrote: > On 17 ...
11 years, 5 months ago (2012-11-17 17:06:27 UTC) #4
jsing
On 18 November 2012 04:06, minux <minux.ma@gmail.com> wrote: > > On Sat, Nov 17, 2012 ...
11 years, 5 months ago (2012-11-22 12:37:47 UTC) #5
minux1
On Thu, Nov 22, 2012 at 8:37 PM, Joel Sing <jsing@google.com> wrote: > On 18 ...
11 years, 5 months ago (2012-11-23 19:03:45 UTC) #6
iant2
On Fri, Nov 23, 2012 at 11:03 AM, minux <minux.ma@gmail.com> wrote: > > On Thu, ...
11 years, 5 months ago (2012-11-24 18:49:49 UTC) #7
minux1
On Sun, Nov 25, 2012 at 2:49 AM, Ian Lance Taylor <iant@google.com> wrote: > > ...
11 years, 5 months ago (2012-11-24 19:32:29 UTC) #8
minux1
my proposal: https://codereview.appspot.com/6855086/ (only tested on openbsd/amd64). My CL doesn't need to store a special ...
11 years, 5 months ago (2012-11-24 21:03:05 UTC) #9
jsing
On 25 November 2012 08:02, minux <minux.ma@gmail.com> wrote: > my proposal: https://codereview.appspot.com/6855086/ > (only tested ...
11 years, 5 months ago (2012-11-26 15:31:53 UTC) #10
jsing
On 27 November 2012 02:31, Joel Sing <jsing@google.com> wrote: > On 25 November 2012 08:02, ...
11 years, 5 months ago (2012-11-26 16:40:49 UTC) #11
iant2
On Mon, Nov 26, 2012 at 8:40 AM, Joel Sing <jsing@google.com> wrote: > On 27 ...
11 years, 5 months ago (2012-11-26 17:02:02 UTC) #12
minux1
On Tue, Nov 27, 2012 at 1:02 AM, Ian Lance Taylor <iant@google.com> wrote: > On ...
11 years, 5 months ago (2012-11-26 17:10:29 UTC) #13
jsing
On 27 November 2012 04:10, minux <minux.ma@gmail.com> wrote: > > On Tue, Nov 27, 2012 ...
11 years, 5 months ago (2012-11-27 16:19:00 UTC) #14
iant2
On Tue, Nov 27, 2012 at 8:18 AM, Joel Sing <jsing@google.com> wrote: > > The ...
11 years, 5 months ago (2012-11-27 16:48:43 UTC) #15
jsing
On 28 November 2012 03:48, Ian Lance Taylor <iant@google.com> wrote: > On Tue, Nov 27, ...
11 years, 5 months ago (2012-11-27 17:15:34 UTC) #16
iant2
On Tue, Nov 27, 2012 at 9:15 AM, Joel Sing <jsing@google.com> wrote: > > So ...
11 years, 4 months ago (2012-11-27 18:45:03 UTC) #17
minux1
On Wed, Nov 28, 2012 at 2:45 AM, Ian Lance Taylor <iant@google.com> wrote: > On ...
11 years, 4 months ago (2012-11-27 20:54:19 UTC) #18
iant2
On Tue, Nov 27, 2012 at 12:53 PM, minux <minux.ma@gmail.com> wrote: > > On Wed, ...
11 years, 4 months ago (2012-11-27 21:06:29 UTC) #19
rsc
I like what Ian said. If for some reason that doesn't work let's just make ...
11 years, 4 months ago (2012-11-27 21:07:51 UTC) #20
minux1
On Wed, Nov 28, 2012 at 5:06 AM, Ian Lance Taylor <iant@google.com> wrote: > On ...
11 years, 4 months ago (2012-11-27 21:45:31 UTC) #21
minux1
On Wed, Nov 28, 2012 at 5:45 AM, minux <minux.ma@gmail.com> wrote: > > On Wed, ...
11 years, 4 months ago (2012-11-27 21:51:04 UTC) #22
jsing
On 28 November 2012 08:50, minux <minux.ma@gmail.com> wrote: > > On Wed, Nov 28, 2012 ...
11 years, 4 months ago (2012-11-28 00:30:34 UTC) #23
minux1
do you want to fix various docs in this CL or in a subsequent CL?
11 years, 4 months ago (2012-12-18 15:06:08 UTC) #24
minux1
This CL is ready to go! LGTM assuming you will fix docs and related things ...
11 years, 4 months ago (2012-12-18 15:28:29 UTC) #25
iant
LGTM https://codereview.appspot.com/6853059/diff/13003/src/pkg/runtime/cgo/gcc_openbsd_386.c File src/pkg/runtime/cgo/gcc_openbsd_386.c (right): https://codereview.appspot.com/6853059/diff/13003/src/pkg/runtime/cgo/gcc_openbsd_386.c#newcode61 src/pkg/runtime/cgo/gcc_openbsd_386.c:61: free(arg); I think it would be a lot ...
11 years, 4 months ago (2012-12-19 20:19:33 UTC) #26
minux1
https://codereview.appspot.com/6853059/diff/13003/src/pkg/runtime/cgo/gcc_openbsd_386.c File src/pkg/runtime/cgo/gcc_openbsd_386.c (right): https://codereview.appspot.com/6853059/diff/13003/src/pkg/runtime/cgo/gcc_openbsd_386.c#newcode61 src/pkg/runtime/cgo/gcc_openbsd_386.c:61: free(arg); On 2012/12/19 20:19:33, iant wrote: > I think ...
11 years, 4 months ago (2012-12-19 20:21:11 UTC) #27
iant
https://codereview.appspot.com/6853059/diff/13003/src/pkg/runtime/cgo/gcc_openbsd_386.c File src/pkg/runtime/cgo/gcc_openbsd_386.c (right): https://codereview.appspot.com/6853059/diff/13003/src/pkg/runtime/cgo/gcc_openbsd_386.c#newcode61 src/pkg/runtime/cgo/gcc_openbsd_386.c:61: free(arg); On 2012/12/19 20:21:11, minux wrote: > On 2012/12/19 ...
11 years, 4 months ago (2012-12-19 20:27:32 UTC) #28
jsing
11 years, 4 months ago (2012-12-20 14:43:28 UTC) #29
*** Submitted as https://code.google.com/p/go/source/detail?r=220ddfb20066 ***

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 issue 3205.

R=golang-dev, minux.ma, iant, rsc, iant
CC=golang-dev
https://codereview.appspot.com/6853059
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b