go/doc
Russ Cox e97b3ab1f9 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 #6989.

LGTM=iant
R=r, iant
CC=golang-codereviews
https://golang.org/cl/88300045
2014-04-15 20:46:46 -04:00
..
articles build: remove depdenency on GNU make 2014-04-07 11:34:35 +10:00
codewalk doc: fix small HTML problems 2013-10-12 18:40:41 -04:00
devel doc: document Go 1.2.1 2014-03-03 11:26:18 +11:00
gopher doc/gopher: fix typo in README 2014-03-26 11:23:33 +11:00
play doc: remove godocs.js and playground.js from core repo 2013-08-01 15:09:18 +10:00
progs doc/progs: don't try building cgo tests if CGO_ENABLED=0 2013-10-11 08:55:13 -07:00
Makefile doc/progs: use test/run.go for testing on Windows 2012-09-03 03:49:03 +08:00
asm.html doc/asm.html: remove mention of 6l -a 2014-04-15 16:27:48 -07:00
cmd.html doc: re-organize golang.org site content 2013-09-16 15:47:13 +10:00
code.html doc: update installation instructions 2013-11-21 07:55:29 +11:00
contrib.html doc/contrib.html: fix some tags 2013-10-15 18:41:23 +11:00
contribute.html doc: Revise Contribution Guidelines. 2014-03-17 09:35:04 +11:00
debugging_with_gdb.html doc: correct some minor HTML errors found by tidy 2013-02-28 13:32:36 -08:00
docs.html doc: restore race detector manual 2014-02-11 09:26:34 +11:00
effective_go.html doc: allow buffered channel as semaphore without initialization 2014-03-24 19:11:21 -04:00
gccgo_contribute.html doc: update gccgo docs 2013-06-20 14:49:15 -07:00
gccgo_install.html doc: update list of gccgo import search paths 2013-12-06 13:33:10 -08:00
go-logo-black.png doc: pngcrush and remove old, unused images 2012-03-08 14:18:28 +11:00
go-logo-blue.png doc: pngcrush and remove old, unused images 2012-03-08 14:18:28 +11:00
go-logo-white.png doc: pngcrush and remove old, unused images 2012-03-08 14:18:28 +11:00
go1.1.html doc: fix a few broken links 2013-10-09 07:05:43 +11:00
go1.2.html encoding/gob: do not use MarshalText, UnmarshalText 2013-11-13 21:29:19 -05:00
go1.3.html build: remove tmp dir names from objects, support GOROOT_FINAL again 2014-04-15 20:46:46 -04:00
go1.html doc: re-organize golang.org site content 2013-09-16 15:47:13 +10:00
go1compat.html doc: re-organize golang.org site content 2013-09-16 15:47:13 +10:00
go_faq.html doc/go_faq.html: update description of stack management 2014-03-21 13:59:30 +11:00
go_mem.html doc: allow buffered channel as semaphore without initialization 2014-03-24 19:11:21 -04:00
go_spec.html spec: clarify when constant slice indices must be in range 2014-03-06 17:11:13 -08:00
help.html doc/help.html: fix typo in word order 2014-04-14 13:03:03 -07:00
ie.css
install-source.html doc: document DragonFly BSD port 2014-03-26 14:06:18 +09:00
install.html doc/install.html: FreeBSD 8 and higher only are supported 2014-04-15 16:40:48 -07:00
logo-153x55.png doc: pngcrush and remove old, unused images 2012-03-08 14:18:28 +11:00
root.html doc: remove "Code that grows with grace" video from front page 2014-02-11 16:00:44 +11:00
share.png godoc: change link styles, add 'pop out' button 2012-03-13 11:00:11 +11:00
sieve.gif
tos.html doc: add Terms of Service 2012-03-27 09:27:43 +11:00