summaryrefslogtreecommitdiff
path: root/src/cmd/dist
Commit message (Collapse)AuthorAgeFilesLines
* all: power64 is now ppc64Russ Cox2014-12-052-4/+4
| | | | | | | | | Fixes issue 8654. LGTM=austin R=austin CC=golang-codereviews https://codereview.appspot.com/180600043
* runtime: generate windows callback list with go generateRuss Cox2014-12-052-52/+8
| | | | | | | | | | | | | | | | | | This is the last system-dependent file written by cmd/dist. They are all now written by go generate. cmd/dist is not needed to start building package runtime for a different system anymore. Now all the generated files can be assumed generated, so delete the clumsy hacks in cmd/api. Re-enable api check in run.bash. LGTM=bradfitz R=bradfitz CC=golang-codereviews https://codereview.appspot.com/185040044
* [dev.cc] all: merge dev.power64 (f57928630b36) into dev.ccRuss Cox2014-11-202-479/+49
|\ | | | | | | | | | | | | | | This will be the last dev.power64 merge; we'll finish on dev.cc. TBR=austin CC=golang-codereviews https://codereview.appspot.com/175420043
| * [dev.cc] runtime: generate GOOS- and GOARCH-specific files with go generateRuss Cox2014-11-182-64/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eventually I'd like almost everything cmd/dist generates to be done with 'go generate' and checked in, to simplify the bootstrap process. The only thing cmd/dist really needs to do is write things like the current experiment info and the current version. This is a first step toward that. It replaces the _NaCl etc constants with generated ones goos_nacl, goos_darwin, goarch_386, and so on. LGTM=dave, austin R=austin, dave, bradfitz CC=golang-codereviews, iant, r https://codereview.appspot.com/174290043
| * [dev.cc] all: merge dev.power64 (7667e41f3ced) into dev.ccRuss Cox2014-11-142-415/+46
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to reduce the delta between dev.cc and dev.garbage to just garbage collector changes. These are the files that had merge conflicts and have been edited by hand: malloc.go mem_linux.go mgc.go os1_linux.go proc1.go panic1.go runtime1.go LGTM=austin R=austin CC=golang-codereviews https://codereview.appspot.com/174180043
| | * [dev.cc] cmd/dist: adjust for build process without cmd/ccRuss Cox2014-11-112-393/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [This CL is part of the removal of C code from package runtime. See golang.org/s/dev.cc for an overview.] - Remove references to C compiler directories. - Remove generation of special header files. - Remove generation of Go source files from C declarations. - Compile Go sources before rest of package (was after), so that Go compiler can write go_asm.h for use in assembly. - Move TLS information from cmd/dist (was embedding in output) to src/runtime/go_tls.h, which it can be maintained directly. LGTM=r R=r, dave CC=austin, golang-codereviews, iant, khr https://codereview.appspot.com/172960043
| | * cmd/dist: remove old misc/pprofRuss Cox2014-11-091-9/+0
| | | | | | | | | | | | | | | | | | | | | LGTM=dave, bradfitz, r, alex.brainman R=r, dave, bradfitz, alex.brainman CC=golang-codereviews https://codereview.appspot.com/167350043
* | | [dev.power64] 6g,9g: formatters for Prog and Addr detailsAustin Clements2014-11-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pretty printers for these make it hard to understand what's actually in the fields of these structures. These "ugly printers" show exactly what's in each field, which can be useful for understanding and debugging code. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/175780043
* | | [dev.power64] liblink: generate dnames[5689] for D_* constantsAustin Clements2014-11-141-3/+82
|/ / | | | | | | | | | | | | | | | | | | | | | | This is more complicated than the other enums because the D_* enums are full of explicit initializers and repeated values. This tries its best. (This will get much cleaner once we tease these constants apart better.) LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/166700043
* | [dev.power64] all: merge default into dev.power64Austin Clements2014-10-224-6/+56
|\ \ | |/ |/| | | | | | | | | | | | | | | | | This brings dev.power64 up-to-date with the current tip of default. go_bootstrap is still panicking with a bad defer when initializing the runtime (even on amd64). LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/152570049
| * build: merge the great pkg/ rename into dev.power64Austin Clements2014-10-223-100/+112
| |\ | | | | | | | | | | | | | | | | | | | | | | | | This also removes pkg/runtime/traceback_lr.c, which was ported to Go in an earlier commit and then moved to runtime/traceback.go. Reviewer: rsc@golang.org rsc: LGTM
| * \ [dev.power64] build: merge default into dev.power64Austin Clements2014-10-228-886/+84
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/160200044
| * | | [dev.power64] cmd/dist: tell goc2c that power64 is 64-bit systemRuss Cox2014-08-141-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | LGTM=minux R=minux CC=golang-codereviews https://codereview.appspot.com/125300043
| * | | [dev.power64] cmd/dist: power64/power64le support.Shenghou Ma2014-08-062-4/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | LGTM=rsc R=rsc, iant CC=golang-codereviews https://codereview.appspot.com/117670045
| * | | [dev.power64] cmd/dist: recognize power64 and power64le as GOHOSTARCHShenghou Ma2014-08-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | LGTM=rsc R=rsc, iant CC=golang-codereviews https://codereview.appspot.com/125760043
| * | | cmd/dist: generate anames9.cRuss Cox2014-08-062-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | LGTM=minux R=minux CC=golang-codereviews https://codereview.appspot.com/120690043
| * | | cmd/dist, go/build: add power64, power64le to known GOARCH listsRuss Cox2014-08-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | LGTM=dave, minux, aram R=minux, dave, bradfitz, aram CC=golang-codereviews https://codereview.appspot.com/119470043
* | | | cmd/cc, cmd/ld, runtime: disallow conservative data/bss objectsRuss Cox2014-09-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In linker, refuse to write conservative (array of pointers) as the garbage collection type for any variable in the data/bss GC program. In the linker, attach the Go type to an already-read C declaration during dedup. This gives us Go types for C globals for free as long as the cmd/dist-generated Go code contains the declaration. (Most runtime C declarations have a corresponding Go declaration. Both are bss declarations and so the linker dedups them.) In cmd/dist, add a few more C files to the auto-Go-declaration list in order to get Go type information for the C declarations into the linker. In C compiler, mark all non-pointer-containing global declarations and all string data as NOPTR. This allows them to exist in C files without any corresponding Go declaration. Count C function pointers as "non-pointer-containing", since we have no heap-allocated C functions. In runtime, add NOPTR to the remaining pointer-containing declarations, none of which refer to Go heap objects. In runtime, also move os.Args and syscall.envs data into runtime-owned variables. Otherwise, in programs that do not import os or syscall, the runtime variables named os.Args and syscall.envs will be missing type information. I believe that this CL eliminates the final source of conservative GC scanning in non-SWIG Go programs, and therefore... Fixes issue 909. LGTM=iant R=iant CC=golang-codereviews https://codereview.appspot.com/149770043
* | | | runtime: remove duplicated Go constantsRuss Cox2014-09-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The C header files are the single point of truth: every C enum constant Foo is available to Go as _Foo. Remove or redirect duplicate Go declarations so they cannot be out of sync. Eventually we will need to put constants in Go, but for now having them be out of sync with C is too risky. These predate the build support for auto-generating Go constants from the C definitions. LGTM=iant R=iant CC=golang-codereviews https://codereview.appspot.com/141510043
* | | | cmd/gc: turn Go prototypes into ptr liveness maps for assembly functionsRuss Cox2014-09-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal here is to allow assembly functions to appear in the middle of a Go stack (having called other code) and still record enough information about their pointers so that stack copying and garbage collection can handle them precisely. Today, these frames are handled only conservatively. If you write func myfunc(x *float64) (y *int) (with no body, an 'extern' declaration), then the Go compiler now emits a liveness bitmap for use from the assembly definition of myfunc. The bitmap symbol is myfunc.args_stackmap and it contains two bitmaps. The first bitmap, in effect at function entry, marks all inputs as live. The second bitmap, not in effect at function entry, marks the outputs live as well. In funcdata.h, define new assembly macros: GO_ARGS opts in to using the Go compiler-generated liveness bitmap for the current function. GO_RESULTS_INITIALIZED indicates that the results have been initialized and need to be kept live for the remainder of the function; it causes a switch to the second generated bitmap for the assembly code that follows. NO_LOCAL_POINTERS indicates that there are no pointers in the local variables being stored in the function's stack frame. LGTM=khr R=khr CC=golang-codereviews https://codereview.appspot.com/137520043
* | | | runtime: assume precisestack, copystack, StackCopyAlways, ScanStackByFramesRuss Cox2014-09-091-0/+2
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit to stack copying for stack growth. We're carrying around a surprising amount of cruft from older schemes. I am confident that precise stack scans and stack copying are here to stay. Delete fallback code for when precise stack info is disabled. Delete fallback code for when copying stacks is disabled. Delete fallback code for when StackCopyAlways is disabled. Delete Stktop chain - there is only one stack segment now. Delete M.moreargp, M.moreargsize, M.moreframesize, M.cret. Delete G.writenbuf (unrelated, just dead). Delete runtime.lessstack, runtime.oldstack. Delete many amd64 morestack variants. Delete initialization of morestack frame/arg sizes (shortens split prologue!). Replace G's stackguard/stackbase/stack0/stacksize/ syscallstack/syscallguard/forkstackguard with simple stack bounds (lo, hi). Update liblink, runtime/cgo for adjustments to G. LGTM=khr R=khr, bradfitz CC=golang-codereviews, iant, r https://codereview.appspot.com/137410043
* | | build: adjustments for move from src/pkg to srcRuss Cox2014-09-083-100/+112
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adjusts code referring to src/pkg to refer to src. Immediately after submitting this CL, I will submit a change doing 'hg mv src/pkg/* src'. That change will be too large to review with Rietveld but will contain only the 'hg mv'. This CL will break the build. The followup 'hg mv' will fix it. For more about the move, see golang.org/s/go14nopkg. LGTM=r R=r CC=golang-codereviews https://codereview.appspot.com/134570043
* | cmd/dist: remove goc2cRuss Cox2014-09-073-860/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | After the three pending CLs listed below, there will be no more .goc files. 134580043 runtime: move stubs.goc code into runtime.c 133670043 runtime: fix windows syscalls for copying stacks 141180043 runtime: eliminate Go -> C -> block paths for Solaris LGTM=bradfitz R=golang-codereviews, bradfitz, dave CC=golang-codereviews, iant, r https://codereview.appspot.com/132680043
* | runtime: use reflect.call during panic instead of newstackcallRuss Cox2014-09-051-0/+2
| | | | | | | | | | | | | | | | | | | | newstackcall creates a new stack segment, and we want to be able to throw away all that code. LGTM=khr R=khr, iant CC=dvyukov, golang-codereviews, r https://codereview.appspot.com/139270043
* | cmd/dist: another attempt at textflag.hRuss Cox2014-09-043-14/+23
| | | | | | | | | | | | | | | | | | The old change worked fine in my client, but my client must not have been in a completely clean state. TBR=r CC=golang-codereviews https://codereview.appspot.com/138100043
* | cmd/dist: make textflag.h available in runtime, avoid android/linux conflictsRuss Cox2014-09-043-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) cmd/dist was copying textflag.h to the build include directory, but only after compiling package runtime. So other packages could use it, just not runtime. Copy earlier, so that runtime can use it too. 2) We decided for android that anything marked linux is also included in the build. The generated linux-specific files in cmd/dist must therefore have explicit +build !android tags, or else you can't have simultaneous linux/arm and android/arm builds in a single client. The tag was already there for at least one file, but it was missing from many others. LGTM=r R=r CC=golang-codereviews https://codereview.appspot.com/134500043
* | runtime: convert mprof.goc to mprof.goRuss Cox2014-09-011-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The exported Go definitions appearing in mprof.go are copied verbatim from debug.go. The unexported Go funcs and types are new. The C Bucket type used a union and was not a line-for-line translation. LGTM=remyoudompheng R=golang-codereviews, remyoudompheng CC=dvyukov, golang-codereviews, iant, khr, r https://codereview.appspot.com/137040043
* | runtime: include constants and defs_*_*.h types in generated Go defsRuss Cox2014-08-291-3/+18
| | | | | | | | | | | | | | | | | | | | I had to rename Kevent and Sigaction to avoid the functions of the same (lowercase) name. LGTM=iant, r R=golang-codereviews, r, iant, aram.h CC=dvyukov, golang-codereviews, khr https://codereview.appspot.com/140740043
* | runtime: convert NewCallback and NewCallbackCDecl to GoAlex Brainman2014-08-251-0/+5
| | | | | | | | | | | | | | LGTM=khr R=khr, remyoudompheng CC=golang-codereviews https://codereview.appspot.com/132820043
* | cmd/dist: goc2c ignores GOROOT_FINALHenning Schmiedehausen2014-08-153-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building golang, the environment variable GOROOT_FINAL can be set to indicate a different installation location from the build location. This works fine, except that the goc2c build step embeds line numbers in the resulting c source files that refer to the build location, no the install location. This would not be a big deal, except that in turn the linker uses the location of runtime/string.goc to embed the gdb script in the resulting binary and as a net result, the debugger now complains that the script is outside its load path (it has the install location configured). See https://code.google.com/p/go/issues/detail?id=8524 for the full description. Fixes issue 8524. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/128230046 Committer: Ian Lance Taylor <iant@golang.org>
* | cmd/dist: Reuse streq whenever possible.Thiago Fransosi Farina2014-08-133-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Basically this cleanup replaces all the usage usages of strcmp() == 0, found by the following command line: $ grep -R strcmp cmd/dist | grep "0" LGTM=iant R=iant CC=golang-codereviews https://codereview.appspot.com/123330043 Committer: Ian Lance Taylor <iant@golang.org>
* | all: copy cmd/ld/textflag.h into pkg/GOOS_GOARCHRob Pike2014-08-121-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The file is used by assembly code to define symbols like NOSPLIT. Having it hidden inside the cmd directory makes it hard to access outside the standard repository. Solution: As with a couple of other files used by cgo, copy the file into the pkg directory and add a -I argument to the assembler to access it. Thus one can write just #include "textflag.h" in .s files. The names in runtime are not updated because in the boot sequence the file has not been copied yet when runtime is built. All other .s files in the repository are updated. Changes to doc/asm.html, src/cmd/dist/build.c, and src/cmd/go/build.go are hand-made. The rest are just the renaming done by a global substitution. (Yay sam). LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/128050043
* | dist: Make vaddn private to buf.cThiago Fransosi Farina2014-08-121-1/+1
|/ | | | | | | | | | | | | This function does not have a declaration/prototype in a.h, and it is used only in buf.c, so it is local to it and thus can be marked as private by adding 'static' to it. LGTM=iant R=rsc, iant CC=golang-codereviews https://codereview.appspot.com/122300043 Committer: Ian Lance Taylor <iant@golang.org>
* dist: fix Plan 9 buildDavid du Colombier2014-08-061-2/+5
| | | | | | | | | | | | | | | | | | | Since CL 115060044, mkanames declares an empty array in anames8.c and anames6.c, which is not valid for the Plan 9 compiler. char* cnames8[] = { }; This change makes mkanames not declaring the cnames array when no C_ constants are found. LGTM=iant R=minux, iant CC=golang-codereviews https://codereview.appspot.com/117680043 Committer: Ian Lance Taylor <iant@golang.org>
* liblink, cmd/dist, cmd/5l: introduce %^ and move C_* constants.Shenghou Ma2014-08-061-1/+21
| | | | | | | | | The helps certain diagnostics and also removed duplicated enums as a side effect. LGTM=dave, rsc R=rsc, dave CC=golang-codereviews https://codereview.appspot.com/115060044
* runtime: keep build version around in binariesKeith Randall2014-07-211-1/+2
| | | | | | | | | | So we can tell from a binary which version of Go built it. LGTM=minux, rsc R=golang-codereviews, minux, khr, rsc, dave CC=golang-codereviews https://codereview.appspot.com/117040043
* runtime: convert map implementation to Go.Keith Randall2014-07-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a bit slower, but not painfully so. There is still room for improvement (saving space so we can use nosplit, and removing the requirement for hash/eq stubs). benchmark old ns/op new ns/op delta BenchmarkMegMap 23.5 24.2 +2.98% BenchmarkMegOneMap 14.9 15.7 +5.37% BenchmarkMegEqMap 71668 72234 +0.79% BenchmarkMegEmptyMap 4.05 4.93 +21.73% BenchmarkSmallStrMap 21.9 22.5 +2.74% BenchmarkMapStringKeysEight_16 23.1 26.3 +13.85% BenchmarkMapStringKeysEight_32 21.9 25.0 +14.16% BenchmarkMapStringKeysEight_64 21.9 25.1 +14.61% BenchmarkMapStringKeysEight_1M 21.9 25.0 +14.16% BenchmarkIntMap 21.8 12.5 -42.66% BenchmarkRepeatedLookupStrMapKey32 39.3 30.2 -23.16% BenchmarkRepeatedLookupStrMapKey1M 322353 322675 +0.10% BenchmarkNewEmptyMap 129 136 +5.43% BenchmarkMapIter 137 107 -21.90% BenchmarkMapIterEmpty 7.14 8.71 +21.99% BenchmarkSameLengthMap 5.24 6.82 +30.15% BenchmarkBigKeyMap 34.5 35.3 +2.32% BenchmarkBigValMap 36.1 36.1 +0.00% BenchmarkSmallKeyMap 26.9 26.7 -0.74% LGTM=rsc R=golang-codereviews, dave, dvyukov, rsc, gobot, khr CC=golang-codereviews https://codereview.appspot.com/99380043
* cmd/dist: always use GOARM=7 for nacl/armShenghou Ma2014-07-101-1/+2
| | | | | | | LGTM=dave, rsc R=rsc, iant, dave CC=golang-codereviews https://codereview.appspot.com/101590044
* build: annotations and modifications for c2goRuss Cox2014-07-021-1/+10
| | | | | | | | | | | | | | | | | | | | | | | The main changes fall into a few patterns: 1. Replace #define with enum. 2. Add /*c2go */ comment giving effect of #define. This is necessary for function-like #defines and non-enum-able #defined constants. (Not all compilers handle negative or large enums.) 3. Add extra braces in struct initializer. (c2go does not implement the full rules.) This is enough to let c2go typecheck the source tree. There may be more changes once it is doing other semantic analyses. LGTM=minux, iant R=minux, dave, iant CC=golang-codereviews https://codereview.appspot.com/106860045
* all: add GOOS=androidDavid Crawshaw2014-07-012-3/+8
| | | | | | | | | | | | | | | | As android and linux have significant overlap, and because build tags are a poor way to represent an OS target, this CL introduces an exception into go/build: linux is treated as a synonym for android when matching files. http://golang.org/s/go14android https://groups.google.com/forum/#!topic/golang-dev/P1ATVp1mun0 LGTM=rsc, minux R=golang-codereviews, mikioh.mikioh, dave, aram, minux, gobot, rsc, aram.h, elias.naur, iant CC=golang-codereviews, rsc https://codereview.appspot.com/105270043
* all: remove 'extern register M *m' from runtimeRuss Cox2014-06-261-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The runtime has historically held two dedicated values g (current goroutine) and m (current thread) in 'extern register' slots (TLS on x86, real registers backed by TLS on ARM). This CL removes the extern register m; code now uses g->m. On ARM, this frees up the register that formerly held m (R9). This is important for NaCl, because NaCl ARM code cannot use R9 at all. The Go 1 macrobenchmarks (those with per-op times >= 10 ?s) are unaffected: BenchmarkBinaryTree17 5491374955 5471024381 -0.37% BenchmarkFannkuch11 4357101311 4275174828 -1.88% BenchmarkGobDecode 11029957 11364184 +3.03% BenchmarkGobEncode 6852205 6784822 -0.98% BenchmarkGzip 650795967 650152275 -0.10% BenchmarkGunzip 140962363 141041670 +0.06% BenchmarkHTTPClientServer 71581 73081 +2.10% BenchmarkJSONEncode 31928079 31913356 -0.05% BenchmarkJSONDecode 117470065 113689916 -3.22% BenchmarkMandelbrot200 6008923 5998712 -0.17% BenchmarkGoParse 6310917 6327487 +0.26% BenchmarkRegexpMatchMedium_1K 114568 114763 +0.17% BenchmarkRegexpMatchHard_1K 168977 169244 +0.16% BenchmarkRevcomp 935294971 914060918 -2.27% BenchmarkTemplate 145917123 148186096 +1.55% Minux previous reported larger variations, but these were caused by run-to-run noise, not repeatable slowdowns. Actual code changes by Minux. I only did the docs and the benchmarking. LGTM=dvyukov, iant, minux R=minux, josharian, iant, dave, bradfitz, dvyukov CC=golang-codereviews https://codereview.appspot.com/109050043
* cmd/dist: only use beta tag in version string for the exact revisionAndrew Gerrand2014-06-021-3/+2
| | | | | | | | | | | Right now, any revision on the default branch after go1.3beta2 is described by "go verson" as go1.3beta2 plus some revision. That's OK for now, but once go1.3 is released, that will seem wrong. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/98650046
* undo CL 84040045 / 5302b4c58aa0Shenghou Ma2014-05-201-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This idea was rejected in CL 5731059. We should fix the runtime docs instead. ??? original CL description cmd/dist: reflect local changes to tree in goversion runtime.Version() requires a trailing "+" when tree had local modifications at time of build. Fixes issue 7701 LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/84040045 Committer: Ian Lance Taylor <iant@golang.org> ??? LGTM=rsc, mra R=iant, rsc, mra CC=golang-codereviews https://codereview.appspot.com/100520043
* cmd/dist: permit go* tag in main branch when it includes "beta"Andrew Gerrand2014-05-011-1/+1
| | | | | | | | | | | | | This change allows us to give an hg tag such as "go1.3beta1" to revisions in the main branch without breaking the build. This is helpful for community members who want to build the beta from source. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/90190044
* liblink: introduce TLS register on 386 and amd64Russ Cox2014-04-151-88/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I did the original 386 ports on Linux and OS X, I chose to define GS-relative expressions like 4(GS) as relative to the actual thread-local storage base, which was usually GS but might not be (it might be FS, or it might be a different constant offset from GS or FS). The original scope was limited but since then the rewrites have gotten out of control. Sometimes GS is rewritten, sometimes FS. Some ports do other rewrites to enable shared libraries and other linking. At no point in the code is it clear whether you are looking at the real GS/FS or some synthesized thing that will be rewritten. The code manipulating all these is duplicated in many places. The first step to fixing issue 7719 is to make the code intelligible again. This CL adds an explicit TLS pseudo-register to the 386 and amd64. As a register, TLS refers to the thread-local storage base, and it can only be loaded into another register: MOVQ TLS, AX An offset from the thread-local storage base is written off(reg)(TLS*1). Semantically it is off(reg), but the (TLS*1) annotation marks this as indexing from the loaded TLS base. This emits a relocation so that if the linker needs to adjust the offset, it can. For example: MOVQ TLS, AX MOVQ 8(AX)(TLS*1), CX // load m into CX On systems that support direct access to the TLS memory, this pair of instructions can be reduced to a direct TLS memory reference: MOVQ 8(TLS), CX // load m into CX The 2-instruction and 1-instruction forms correspond roughly to ELF TLS initial exec mode and ELF TLS local exec mode, respectively. Liblink applies this rewrite on systems that support the 1-instruction form. The decision is made using only the operating system (and probably the -shared flag, eventually), not the link mode. If some link modes on a particular operating system require the 2-instruction form, then all builds for that operating system will use the 2-instruction form, so that the link mode decision can be delayed to link time. Obviously it is late to be making changes like this, but I despair of correcting issue 7719 and issue 7164 without it. To make sure I am not changing existing behavior, I built a "hello world" program for every GOOS/GOARCH combination we have and then worked to make sure that the rewrite generates exactly the same binaries, byte for byte. There are a handful of TODOs in the code marking kludges to get the byte-for-byte property, but at least now I can explain exactly how each binary is handled. The targets I tested this way are: darwin-386 darwin-amd64 dragonfly-386 dragonfly-amd64 freebsd-386 freebsd-amd64 freebsd-arm linux-386 linux-amd64 linux-arm nacl-386 nacl-amd64p32 netbsd-386 netbsd-amd64 openbsd-386 openbsd-amd64 plan9-386 plan9-amd64 solaris-amd64 windows-386 windows-amd64 There were four exceptions to the byte-for-byte goal: windows-386 and windows-amd64 have a time stamp at bytes 137 and 138 of the header. darwin-386 and plan9-386 have five or six modified bytes in the middle of the Go symbol table, caused by editing comments in runtime/sys_{darwin,plan9}_386.s. Fixes issue 7164. LGTM=iant R=iant, aram, minux.ma, dave CC=golang-codereviews https://codereview.appspot.com/87920043
* cmd/dist: use GOHOSTARCH/GOHOSTOS instead of GOOS/GOARCH for host libraries ↵Jan Ziak2014-04-151-9/+11
| | | | | | | | | | | and binaries Fixes issue 6559 LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/81330045
* cmd/dist: mark cmd/link and debug/goobj as unreleasedRuss Cox2014-04-141-0/+2
| | | | | | | | | | | These are not ready and will not be in Go 1.3. Fixes issue 6932. LGTM=bradfitz R=golang-codereviews, bradfitz, minux.ma CC=golang-codereviews, iant, r https://codereview.appspot.com/87630043
* cmd/prof, libmach: deleteRuss Cox2014-04-141-29/+0
| | | | | | | | | | | | | | | We have never released cmd/prof and don't plan to. Now that nm, addr2line, and objdump have been rewritten in Go, cmd/prof is the only thing keeping us from deleting libmach. Delete cmd/prof, and then since nothing is using libmach, delete libmach. 13,000 lines of C deleted. LGTM=minux.ma R=golang-codereviews, minux.ma CC=golang-codereviews, iant, r https://codereview.appspot.com/87020044
* cmd/objdump: rewrite in GoRuss Cox2014-04-141-2/+0
| | | | | | | | | | | | | | | | | | | | Update cmd/dist not to build the C version. Update cmd/go to install the Go version to the tool directory. Update issue 7452 This is the basic logic needed for objdump, and it works well enough to support the pprof list and weblist commands. A real disassembler needs to be added in order to support the pprof disasm command and the per-line assembly displays in weblist. That's still to come. Probably objdump will move to go.tools when the disassembler is added, but it can stay here for now. LGTM=minux.ma R=golang-codereviews, minux.ma CC=golang-codereviews, iant, r https://codereview.appspot.com/87580043
* cmd/dist: reflect local changes to tree in goversionMike Andrews2014-04-031-1/+8
| | | | | | | | | | | | | | runtime.Version() requires a trailing "+" when tree had local modifications at time of build. Fixes issue 7701 LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/84040045 Committer: Ian Lance Taylor <iant@golang.org>