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

Issue 88300045: code review 88300045: build: remove tmp dir names from objects, support GOROO... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years ago by rsc
Modified:
10 years ago
Reviewers:
gobot, dave, iant
CC:
r, iant, golang-codereviews
Visibility:
Public.

Description

build: remove tmp dir names from objects, support GOROOT_FINAL again If we compile a generated file stored in a temporary directory - let's say /tmp/12345/work/x.c - then by default 6c stores the full path and then the pcln table in the final binary includes the full path. This makes repeated builds (using different temporary directories) produce different binaries, even if the inputs are the same. In the old 'go tool pack', the P flag specified a prefix to remove from all stored paths (if present), and cmd/go invoked 'go tool pack grcP $WORK' to remove references to the temporary work directory. We've changed the build to avoid pack as much as possible, under the theory that instead of making pack convert from .6 to .a, the tools should just write the .a directly and save a round of I/O. Instead of going back to invoking pack always, define a common flag -trimpath in the assemblers, C compilers, and Go compilers, implemented in liblink, and arrange for cmd/go to use the flag. Then the object files being written out have the shortened paths from the start. While we are here, reimplement pcln support for GOROOT_FINAL. A build in /tmp/go uses GOROOT=/tmp/go, but if GOROOT_FINAL=/usr/local/go is set, then a source file named /tmp/go/x.go is recorded instead as /usr/local/go/x.go. We use this so that we can prepare distributions to be installed in /usr/local/go without actually working in that directory. The conversion to liblink deleted all the old file name handling code, including the GOROOT_FINAL translation. Bring the GOROOT_FINAL translation back. Before this CL, using GOROOT_FINAL=/goroot make.bash: g% strings $(which go) | grep -c $TMPDIR 6 g% strings $(which go) | grep -c $GOROOT 793 g% After this CL: g% strings $(which go) | grep -c $TMPDIR 0 g% strings $(which go) | grep -c $GOROOT 0 g% (The references to $TMPDIR tend to be cgo-generated source files.) Adding the -trimpath flag to the assemblers required converting them to the new Go-semantics flag parser. The text in go1.3.html is copied and adjusted from go1.1.html, which is when we applied that conversion to the compilers and linkers. Fixes issue 6989.

Patch Set 1 #

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

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

Total comments: 1

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+160 lines, -113 lines) Patch
M doc/go1.3.html View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
M include/link.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/cmd/5a/a.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/5a/lex.c View 1 2 chunks +29 lines, -38 lines 0 comments Download
M src/cmd/6a/a.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/6a/lex.c View 1 2 chunks +29 lines, -34 lines 0 comments Download
M src/cmd/8a/a.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/8a/lex.c View 1 2 chunks +28 lines, -33 lines 0 comments Download
M src/cmd/cc/lex.c View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/gc/lex.c View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/go/build.go View 1 4 chunks +4 lines, -4 lines 0 comments Download
M src/liblink/obj.c View 1 2 3 3 chunks +45 lines, -1 line 0 comments Download
M src/liblink/sym.c View 1 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 10
rsc
Hello r (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
10 years ago (2014-04-15 23:47:02 UTC) #1
r
i would expect to see changes to the flag parser too https://codereview.appspot.com/88300045/diff/30001/src/liblink/obj.c File src/liblink/obj.c (right): ...
10 years ago (2014-04-15 23:56:26 UTC) #2
rsc
On Tue, Apr 15, 2014 at 7:56 PM, <r@golang.org> wrote: > i would expect to ...
10 years ago (2014-04-16 00:03:10 UTC) #3
rsc
For anyone who finds this CL later, if you want to do more aggressive file ...
10 years ago (2014-04-16 00:05:13 UTC) #4
rsc
PTAL Fixed the grammar in obj.c. // Does s have t as a path prefix? ...
10 years ago (2014-04-16 00:06:44 UTC) #5
iant
LGTM
10 years ago (2014-04-16 00:26:28 UTC) #6
rsc
*** Submitted as https://code.google.com/p/go/source/detail?r=e5edcb7742c7 *** build: remove tmp dir names from objects, support GOROOT_FINAL again ...
10 years ago (2014-04-16 00:46:51 UTC) #7
gobot
This CL appears to have broken the openbsd-386-rootbsd builder. See http://build.golang.org/log/c61b33ce505a47bb603c6f1ba6b18cf70656b2c1
10 years ago (2014-04-16 01:12:13 UTC) #8
dave_cheney.net
Looks real, fatal error: unexpected signal during runtime execution [signal 0xb code=0x1 addr=0x18 pc=0x805aa29] runtime ...
10 years ago (2014-04-16 01:18:31 UTC) #9
rsc
10 years ago (2014-04-16 01:50:01 UTC) #10
didn't happen on the next build. openbsd-386 seems flaky.
Sign in to reply to this message.

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