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

Issue 5822049: code review 5822049: cmd/go: new cgo build procedure (Closed)

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

Description

cmd/go: new cgo build procedure This CL adds a step to the build procedure for cgo programs. It uses 'ld -r' to combine all gcc compiled object file and generate a relocatable object file for our ld. Additionally, this linking step will combine some static linking gcc library into the relocatable object file, so that we can use libgcc, libmingwex and libmingw32 without problem. Fixes issue 3261. Fixes issue 1741. Added a testcase for linking in libgcc. TODO: 1. still need to fix the INDIRECT_SYMBOL_LOCAL problem on Darwin/386. 2. still need to enable the libgcc test on Linux/ARM, because 5l can't deal with thumb libgcc. Tested on Darwin/amd64, Darwin/386, FreeBSD/amd64, FreeBSD/386, Linux/amd64, Linux/386, Linux/ARM, Windows/amd64, Windows/386

Patch Set 1 #

Patch Set 2 : diff -r 2fedbe9d1cc7 https://code.google.com/p/go/ #

Patch Set 3 : diff -r aea57cb8c227 https://code.google.com/p/go/ #

Patch Set 4 : diff -r 0e9f12b156cf https://code.google.com/p/go/ #

Patch Set 5 : diff -r 0e9f12b156cf https://code.google.com/p/go/ #

Patch Set 6 : diff -r d77371d5c280 https://code.google.com/p/go/ #

Patch Set 7 : diff -r a303acb0a5f2 https://code.google.com/p/go/ #

Patch Set 8 : diff -r a303acb0a5f2 https://code.google.com/p/go/ #

Patch Set 9 : diff -r a303acb0a5f2 https://code.google.com/p/go/ #

Patch Set 10 : diff -r c47b0caa500e https://code.google.com/p/go/ #

Patch Set 11 : diff -r 316890203045 https://code.google.com/p/go/ #

Patch Set 12 : diff -r 362b760ecfc7 https://code.google.com/p/go/ #

Patch Set 13 : diff -r 362b760ecfc7 https://code.google.com/p/go/ #

Patch Set 14 : diff -r 362b760ecfc7 https://code.google.com/p/go/ #

Patch Set 15 : diff -r 2d97f35f53e1 https://code.google.com/p/go/ #

Patch Set 16 : diff -r 6a62349f0bf8 https://code.google.com/p/go/ #

Patch Set 17 : diff -r d3dd48c73d6d https://code.google.com/p/go/ #

Patch Set 18 : diff -r d3dd48c73d6d https://code.google.com/p/go/ #

Patch Set 19 : diff -r 9a3c164b3231 https://code.google.com/p/go/ #

Patch Set 20 : diff -r 9a3c164b3231 https://code.google.com/p/go/ #

Patch Set 21 : diff -r 9a3c164b3231 https://code.google.com/p/go/ #

Patch Set 22 : diff -r 9a3c164b3231 https://code.google.com/p/go/ #

Patch Set 23 : diff -r 9a3c164b3231 https://code.google.com/p/go/ #

Patch Set 24 : diff -r 9a3c164b3231 https://code.google.com/p/go/ #

Patch Set 25 : diff -r 9a3c164b3231 https://code.google.com/p/go/ #

Patch Set 26 : diff -r 9a3c164b3231 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -2 lines) Patch
M misc/cgo/test/cgo_test.go View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A misc/cgo/test/issue3261.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +43 lines, -0 lines 0 comments Download
M misc/cgo/test/sleep_windows_386.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +4 lines, -0 lines 0 comments Download
M src/cmd/go/build.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +32 lines, -1 line 0 comments Download
M src/run.bat View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +7 lines, -1 line 0 comments Download

Messages

Total messages: 21
minux1
Hello iant@golang.org, rsc@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
13 years, 5 months ago (2012-03-16 10:32:17 UTC) #1
rsc
LGTM but wait for iant
13 years, 5 months ago (2012-03-16 16:25:16 UTC) #2
iant
LGTM once the prerequisites are settled. Thanks.
13 years, 5 months ago (2012-03-16 18:01:20 UTC) #3
minux1
To be safe, I retested all three CLs on all systems I can access: On ...
13 years, 4 months ago (2012-04-17 19:15:30 UTC) #4
minux1
On 2012/04/17 19:15:30, minux wrote: > To be safe, I retested all three CLs on ...
13 years, 4 months ago (2012-04-19 20:52:56 UTC) #5
iant
I'm not a Darwin user. How would you change the test to avoid the "scattered ...
13 years, 4 months ago (2012-04-19 21:10:17 UTC) #6
minux1
PTAL. I changed src/cmd/go/build.go and misc/cgo/test/issue3261.go. On 2012/04/19 21:10:17, iant wrote: > I'm not a ...
13 years, 4 months ago (2012-04-20 09:21:29 UTC) #7
iant
LGTM The libgcc interface is fixed for a given architecture, but the libgcc code is ...
13 years, 4 months ago (2012-04-20 20:38:48 UTC) #8
rsc
LGTM
13 years, 4 months ago (2012-05-03 21:59:24 UTC) #9
rsc
This wouldn't help for Windows necessarily, but one thing we have been considering in an ...
13 years, 4 months ago (2012-05-03 22:01:15 UTC) #10
minux1
On Fri, May 4, 2012 at 6:00 AM, Russ Cox <rsc@golang.org> wrote: > This wouldn't ...
13 years, 4 months ago (2012-05-04 17:00:29 UTC) #11
rsc
On Fri, May 4, 2012 at 1:00 PM, minux <minux.ma@gmail.com> wrote: > I think the ...
13 years, 4 months ago (2012-05-04 17:03:20 UTC) #12
minux1
On Sat, May 5, 2012 at 1:02 AM, Russ Cox <rsc@golang.org> wrote: > On Fri, ...
13 years, 4 months ago (2012-05-04 17:24:05 UTC) #13
rsc
On Fri, May 4, 2012 at 1:23 PM, minux <minux.ma@gmail.com> wrote: > I will try ...
13 years, 4 months ago (2012-05-04 17:25:45 UTC) #14
minux1
I have a order problem here. Once I submit this CL and its prerequisite, Linux/ARM ...
13 years, 3 months ago (2012-05-18 22:06:36 UTC) #15
bradfitz
Keeping build green seems preferred. I don't want to become a project that accepts red ...
13 years, 3 months ago (2012-05-18 23:11:41 UTC) #16
rsc
On Fri, May 18, 2012 at 6:06 PM, <minux.ma@gmail.com> wrote: > Once I submit this ...
13 years, 3 months ago (2012-05-21 17:19:13 UTC) #17
ry
This patch makes the build of the go repository hang at "net/rpc/jsonrpc". Top shows two ...
13 years, 3 months ago (2012-06-06 07:28:33 UTC) #18
ry
Using gdb, it seems to be spinning at src/cmd/ld/data.c:1094
13 years, 3 months ago (2012-06-06 08:58:36 UTC) #19
ry
Nevermind - I wasn't on tip. Sorry.
13 years, 3 months ago (2012-06-06 09:29:07 UTC) #20
minux1
13 years ago (2012-08-16 19:43:04 UTC) #21
*** Submitted as http://code.google.com/p/go/source/detail?r=5334356f42b3 ***

cmd/go: new cgo build procedure
   This CL adds a step to the build procedure for cgo programs. It uses 'ld -r'
to combine all gcc compiled object file and generate a relocatable object file
for our ld. Additionally, this linking step will combine some static linking
gcc library into the relocatable object file, so that we can use libgcc, 
libmingwex and libmingw32 without problem.

   Fixes issue 3261.
   Fixes issue 1741.
   Added a testcase for linking in libgcc.

TODO: 
1. still need to fix the INDIRECT_SYMBOL_LOCAL problem on Darwin/386.
2. still need to enable the libgcc test on Linux/ARM, because 5l can't deal
with thumb libgcc.

Tested on Darwin/amd64, Darwin/386, FreeBSD/amd64, FreeBSD/386, Linux/amd64,
Linux/386, Linux/ARM, Windows/amd64, Windows/386

R=iant, rsc, bradfitz, coldredlemur
CC=golang-dev
http://codereview.appspot.com/5822049
Sign in to reply to this message.

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