]> Cypherpunks repositories - gostls13.git/log
gostls13.git
10 years agocmd/6l: call runtime.addmoduledata from .init_array
Michael Hudson-Doyle [Wed, 1 Apr 2015 01:17:43 +0000 (14:17 +1300)]
cmd/6l: call runtime.addmoduledata from .init_array

Change-Id: I09e84161d106960a69972f5fc845a1e40c28e58f
Reviewed-on: https://go-review.googlesource.com/8331
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agocmd/go: support -buildmode=shared
Michael Hudson-Doyle [Sun, 22 Mar 2015 23:30:18 +0000 (12:30 +1300)]
cmd/go: support -buildmode=shared

You can now do 'go install -buildmode=shared std' and get yourself
a nice (33 meg) libstd.so (which is not useful until there is -linkshared
support as well, of course).

Change-Id: Ie9b7e7f72abc7d369a6e3ecc98903a9d197bd6e6
Reviewed-on: https://go-review.googlesource.com/8300
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agointernal/syscall: move to unix subdirectory
Ian Lance Taylor [Wed, 15 Apr 2015 23:28:00 +0000 (16:28 -0700)]
internal/syscall: move to unix subdirectory

Move the single file from internal/syscall to internal/syscall/unix,
to match the golang.org/x/sys layout.

Change-Id: I2fb2832b4cb22efc7666bd276f5401ac3e73dc40
Reviewed-on: https://go-review.googlesource.com/8972
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
10 years agocmd/test: require external linking for c-archive
David Crawshaw [Wed, 15 Apr 2015 18:47:08 +0000 (14:47 -0400)]
cmd/test: require external linking for c-archive

Change-Id: I9ceceb29291ea9f5d7b675dfabd665c5e3618471
Reviewed-on: https://go-review.googlesource.com/8955
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agogo/build: support -installsuffix with gccgo
Michael Hudson-Doyle [Tue, 14 Apr 2015 08:22:23 +0000 (10:22 +0200)]
go/build: support -installsuffix with gccgo

Fixes #10449

Change-Id: I1dc2d0213e6a46f3609222d5460c1a54081e2471
Reviewed-on: https://go-review.googlesource.com/8931
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agocmd/go, go/build: add build.Package.PkgTargetRoot
Michael Hudson-Doyle [Tue, 14 Apr 2015 08:20:18 +0000 (10:20 +0200)]
cmd/go, go/build: add build.Package.PkgTargetRoot

This is $GOPATH/pkg/linux_amd64 or similar.  cmd/go already had a grotty calculation
of this and I need to add another one for -buildmode=shared.

Change-Id: Ied28c9b7cce671da8d45920e124a3e0c2501258a
Reviewed-on: https://go-review.googlesource.com/8930
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

10 years agocmd/internal/ld: allow -r to override rpath when -linkshared
Michael Hudson-Doyle [Sun, 12 Apr 2015 00:31:28 +0000 (02:31 +0200)]
cmd/internal/ld: allow -r to override rpath when -linkshared

Including having -r "" preventing rpath from being set at all.

Change-Id: Ib40d7bf93a6e9ef21985c4a05b5703e4fbd1cd1b
Reviewed-on: https://go-review.googlesource.com/8806
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agocmd/6g, runtime: improve duffzero throughput
Josh Bleecher Snyder [Wed, 15 Apr 2015 18:05:01 +0000 (11:05 -0700)]
cmd/6g, runtime: improve duffzero throughput

It is faster to execute

MOVQ AX,(DI)
MOVQ AX,8(DI)
MOVQ AX,16(DI)
MOVQ AX,24(DI)
ADDQ $32,DI

than

STOSQ
STOSQ
STOSQ
STOSQ

However, in order to be able to jump into
the middle of a block of MOVQs, the call
site needs to pre-adjust DI.

If we're clearing a small area, the cost
of that DI pre-adjustment isn't repaid.

This CL switches the DUFFZERO implementation
to use a hybrid strategy, in which small
clears use STOSQ as before, but large clears
use mostly MOVQ/ADDQ blocks.

benchmark                 old ns/op     new ns/op     delta
BenchmarkClearFat8        0.55          0.55          +0.00%
BenchmarkClearFat12       0.82          0.83          +1.22%
BenchmarkClearFat16       0.55          0.55          +0.00%
BenchmarkClearFat24       0.82          0.82          +0.00%
BenchmarkClearFat32       2.20          1.94          -11.82%
BenchmarkClearFat40       1.92          1.66          -13.54%
BenchmarkClearFat48       2.21          1.93          -12.67%
BenchmarkClearFat56       3.03          2.20          -27.39%
BenchmarkClearFat64       3.26          2.48          -23.93%
BenchmarkClearFat72       3.57          2.76          -22.69%
BenchmarkClearFat80       3.83          3.05          -20.37%
BenchmarkClearFat88       4.14          3.30          -20.29%
BenchmarkClearFat128      5.54          4.69          -15.34%
BenchmarkClearFat256      9.95          9.09          -8.64%
BenchmarkClearFat512      18.7          17.9          -4.28%
BenchmarkClearFat1024     36.2          35.4          -2.21%

Change-Id: Ic786406d9b3cab68d5a231688f9e66fcd1bd7103
Reviewed-on: https://go-review.googlesource.com/2585
Reviewed-by: Keith Randall <khr@golang.org>
10 years agocmd/internal/gc, cmd/gc: move Reg from Val to Node
Josh Bleecher Snyder [Mon, 13 Apr 2015 17:28:57 +0000 (10:28 -0700)]
cmd/internal/gc, cmd/gc: move Reg from Val to Node

Val is used to hold constant values.
Reg was the odd duck out.

Generated using eg.

No functional changes. Passes toolstash -cmp.

Change-Id: Ic1de769a1f92bb02e09a4428d998b716f307e2f6
Reviewed-on: https://go-review.googlesource.com/8912
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoruntime: merge slice and sliceStruct
Michael Hudson-Doyle [Fri, 10 Apr 2015 22:01:54 +0000 (10:01 +1200)]
runtime: merge slice and sliceStruct

By removing type slice, renaming type sliceStruct to type slice and
whacking until it compiles.

Has a pleasing net reduction of conversions.

Fixes #10188

Change-Id: I77202b8df637185b632fd7875a1fdd8d52c7a83c
Reviewed-on: https://go-review.googlesource.com/8770
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

10 years agocmd/dist: fix bootstrapping with gccgo on 386
Michael Hudson-Doyle [Wed, 15 Apr 2015 13:18:00 +0000 (15:18 +0200)]
cmd/dist: fix bootstrapping with gccgo on 386

We forgot to add the !gccgo tag to cpuid_386.s.

Change-Id: I2de2ed92ac9686c9365cb37cd29121fa98c2bf37
Reviewed-on: https://go-review.googlesource.com/8960
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agodoc/go1.5.txt: io.CopyBuffer and new reflect.Value handling in fmt
Rob Pike [Wed, 15 Apr 2015 16:01:38 +0000 (09:01 -0700)]
doc/go1.5.txt: io.CopyBuffer and new reflect.Value handling in fmt

Change-Id: Ia0d7c2f08f8f124bcd62c7f9744227812d68903d
Reviewed-on: https://go-review.googlesource.com/8941
Reviewed-by: Rob Pike <r@golang.org>
10 years agofmt: treat reflect.Value specially - as the value it holds
Rob Pike [Thu, 9 Apr 2015 23:30:48 +0000 (16:30 -0700)]
fmt: treat reflect.Value specially - as the value it holds

When a reflect.Value is passed to Printf (etc.), fmt called the
String method, which does not disclose its contents. To get the
contents, one could call Value.Interface(), but that is illegal
if the Value is not exported or otherwise forbidden.

This CL improves the situation with a trivial change to the
fmt package: when we see a reflect.Value as an argument,
we treat it exactly as we treat a reflect.Value we make inside
the package. This means that we always print the
contents of the Value as if _that_ was the argument to Printf.

This is arguably a breaking change but I think it is a genuine
improvement and no greater a break than many other tweaks
we have made to formatted output from this package.

Fixes #8965.

Change-Id: Ifc2a4ce3c1134ad5160e101d2196c22f1542faab
Reviewed-on: https://go-review.googlesource.com/8731
Reviewed-by: roger peppe <rogpeppe@gmail.com>
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agoio: add CopyBuffer, a version of Copy in which the user provides a buffer
Rob Pike [Thu, 9 Apr 2015 23:03:12 +0000 (16:03 -0700)]
io: add CopyBuffer, a version of Copy in which the user provides a buffer

This trivial addition to the io package makes it easy to control the
buffer size and allocation properties of io.Copy.

Change-Id: Ica1a6bd015e429d4e655bc0c6f66cea21c454acf
Reviewed-on: https://go-review.googlesource.com/8730
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agocmd/internal/gc, cmd/7g: use zero register in Componentgen
Dave Cheney [Thu, 9 Apr 2015 11:25:48 +0000 (21:25 +1000)]
cmd/internal/gc, cmd/7g: use zero register in Componentgen

Fixes #9855

Use an architectural zero register as the source for zeroing, if available.

Change-Id: Ie5b4ba4e3d356c6f892bfd1cebd14d5152bdeeb0
Reviewed-on: https://go-review.googlesource.com/8722
Reviewed-by: Keith Randall <khr@golang.org>
10 years agonet: add Listen system call hook for testing
Mikio Hara [Wed, 8 Apr 2015 11:21:24 +0000 (20:21 +0900)]
net: add Listen system call hook for testing

Change-Id: I63053c45081f47ba736720a78d85c31c13767891
Reviewed-on: https://go-review.googlesource.com/8642
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

10 years agonet/internal/socktest: add hook for Listen, failed system call counters
Mikio Hara [Wed, 8 Apr 2015 11:13:36 +0000 (20:13 +0900)]
net/internal/socktest: add hook for Listen, failed system call counters

Change-Id: Icaac9a48a3b9a3c5542235162e21ab8303592965
Reviewed-on: https://go-review.googlesource.com/8641
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agoruntime: mark all runtime.cputicks implementations NOSPLIT
Dave Cheney [Wed, 15 Apr 2015 09:11:47 +0000 (19:11 +1000)]
runtime: mark all runtime.cputicks implementations NOSPLIT

Fixes #10450

runtime.cputicks is called from runtime.exitsyscall and must not
split the stack. cputicks is implemented in several ways and the
NOSPLIT annotation was missing from a few of these.

Change-Id: I5cbbb4e5888c5d298fe2fef240782d0e49f59af8
Reviewed-on: https://go-review.googlesource.com/8939
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
10 years agoruntime: really pass return value to Windows in externalthreadhandler
Alex Brainman [Tue, 14 Apr 2015 00:48:05 +0000 (10:48 +1000)]
runtime: really pass return value to Windows in externalthreadhandler

When Windows calls externalthreadhandler it expects to receive
return value in AX. We don't set AX anywhere. Change that.
Store ctrlhandler1 and profileloop1 return values into AX before
returning from externalthreadhandler.

Fixes #10215.

Change-Id: Ied04542cc3ebe7d4a26660e970f9f78098143591
Reviewed-on: https://go-review.googlesource.com/8901
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

10 years agoimage/png: reject multiple tRNS chunks.
Nigel Tao [Wed, 15 Apr 2015 03:03:24 +0000 (13:03 +1000)]
image/png: reject multiple tRNS chunks.

http://www.w3.org/TR/PNG/#5ChunkOrdering disallows them.

Fixes #10423

Change-Id: I3399ce53dc8b41b1b5f0b906a5912e6efd80418f
Reviewed-on: https://go-review.googlesource.com/8905
Reviewed-by: Rob Pike <r@golang.org>
10 years agogo/importer: added go/importer package, adjusted go/types
Robert Griesemer [Sat, 11 Apr 2015 00:50:06 +0000 (17:50 -0700)]
go/importer: added go/importer package, adjusted go/types

- The go/importer package provides access to compiler-specific importers.
- Adjusted go/internal/gcimporter and go/types as needed.
- types.Check was removed - not much simpler than calling types.Config.Check.
- Package "unsafe" is now handled by the type checker; importers are not
  called for it anymore.
- In std lib tests, re-use importer for faster testing
  (no need to re-import previously imported packages).
- Minor cleanups.

The code still needs cleanups before submitting.

Change-Id: Idd456da2e9641688fe056504367348926feb0755
Reviewed-on: https://go-review.googlesource.com/8767
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Griesemer <gri@golang.org>

10 years agomisc/ios: read codesign info from environment variables
Josh Bleecher Snyder [Mon, 13 Apr 2015 18:31:41 +0000 (11:31 -0700)]
misc/ios: read codesign info from environment variables

Use environment variables to allow set-and-forget.

Add a script to attempt to autodetect codesign info.

Change-Id: Ic56b9c5f097b1a4117ebb89c408bc333d91f581d
Reviewed-on: https://go-review.googlesource.com/8910
Reviewed-by: David Crawshaw <crawshaw@golang.org>
10 years agocmd/internal/gc: convert Bval to bool
Josh Bleecher Snyder [Mon, 13 Apr 2015 16:52:02 +0000 (09:52 -0700)]
cmd/internal/gc: convert Bval to bool

No functional changes. Passes toolstash -cmp.

Change-Id: I4fba0c248645c3910ee3f7fc99dacafb676c5dc2
Reviewed-on: https://go-review.googlesource.com/8911
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agoruntime: make time slice a const
Austin Clements [Mon, 23 Mar 2015 17:27:24 +0000 (13:27 -0400)]
runtime: make time slice a const

A G will be preempted if it runs for 10ms without blocking. Currently
this constant is hard-coded in retake. Move it to a global const.
We'll use the time slice length in scheduling background GC.

Change-Id: I79a979948af2fad3afe5df9d4af4062f166554b7
Reviewed-on: https://go-review.googlesource.com/8838
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
10 years agoruntime: fix freed page accounting in mHeap_ReclaimList
Austin Clements [Tue, 14 Apr 2015 02:43:05 +0000 (22:43 -0400)]
runtime: fix freed page accounting in mHeap_ReclaimList

mHeap_ReclaimList is asked to reclaim at least npages pages, but it
counts the number of spans reclaimed, not the number of pages
reclaimed. The number of spans reclaimed is strictly larger than the
number of pages, so this is not strictly wrong, but it is forcing more
reclamation than was intended by the caller, which delays large
allocations.

Fix this by increasing the count by the number of pages in the swept
span, rather than just increasing it by 1.

Fixes #9048.

Change-Id: I5ae364a9837a6012e68fcd431bba000340cfd50c
Reviewed-on: https://go-review.googlesource.com/8920
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Rick Hudson <rlh@golang.org>
10 years agoruntime: remove unnecessary traceNextGC
Austin Clements [Mon, 13 Apr 2015 22:38:16 +0000 (18:38 -0400)]
runtime: remove unnecessary traceNextGC

Commit d7e0ad4 removed the next_gc manipulation from mSpan_Sweep, but
left in the traceNextGC() for recording the updated next_gc
value. Remove this now unnecessary call.

Change-Id: I28e0de071661199be9810d7bdcc81ce50b5a58ae
Reviewed-on: https://go-review.googlesource.com/8894
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Rick Hudson <rlh@golang.org>
10 years agoio/ioutil: fix locking of the tempfile random state
Marius Nuennerich [Tue, 14 Apr 2015 10:30:54 +0000 (11:30 +0100)]
io/ioutil: fix locking of the tempfile random state

Fixes #10451

Change-Id: I15ed777e9a4a4e1ba1178d07fcbe0ab4bf0d9e50
Reviewed-on: https://go-review.googlesource.com/8936
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agoreflect: document reflect.TypeOf((*Foo)(nil)).Elem() idiom
Matthew Dempsky [Tue, 14 Apr 2015 16:56:05 +0000 (09:56 -0700)]
reflect: document reflect.TypeOf((*Foo)(nil)).Elem() idiom

See also golang-dev discussion:
https://groups.google.com/d/msg/golang-dev/Nk9gnTINlTg/SV8rBt-2__kJ

Change-Id: I49edd98d73400c1757b6085dec86752de569c01a
Reviewed-on: https://go-review.googlesource.com/8923
Reviewed-by: Rob Pike <r@golang.org>
10 years agocmd/go: do not cover package unsafe
Rob Pike [Mon, 13 Apr 2015 21:58:44 +0000 (14:58 -0700)]
cmd/go: do not cover package unsafe

Even if requested, there is no .go file for unsafe - it comes from the
compiler - so referencing its cover variables will break the compilation
in a command like
go test -coverpkg=all fmt

Fixes #10408.

Change-Id: If92658ef6c29dc020f66ba30b02eaa796f7205e0
Reviewed-on: https://go-review.googlesource.com/8891
Reviewed-by: Russ Cox <rsc@golang.org>
10 years agocmd/gc: fix crash during escape analysis
Dmitry Vyukov [Tue, 14 Apr 2015 09:46:15 +0000 (12:46 +0300)]
cmd/gc: fix crash during escape analysis

Fixes #10441

Compiler crashed as:

panic: runtime error: invalid memory address or nil pointer dereference
goroutine 1 [running]:
cmd/internal/gc.haspointers(0x0, 0xffffffffffffffff)
    src/cmd/internal/gc/reflect.go:623 +0x1f
cmd/internal/gc.escwalk(0x20c82dc00, 0xffffffffffffffff, 0x20c82dda0, 0x20c835520)
    src/cmd/internal/gc/esc.go:1291 +0x14aa
cmd/internal/gc.escwalk(0x20c82dc00, 0xffffffffffffffff, 0x20c82dda0, 0x20beac340)
    src/cmd/internal/gc/esc.go:1386 +0x836

while evaluating haspointers of the fake OADDR node here:

leaks = level <= 0 && dst.Escloopdepth < src.Escloopdepth || level < 0 && dst == &e.funcParam && haspointers(src.Type)

Change-Id: I13c23fced52e8fcd0ae1df81b374df8632eb7790
Reviewed-on: https://go-review.googlesource.com/8932
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

10 years agoruntime: make cgocallback wait on package init
David Crawshaw [Mon, 13 Apr 2015 23:31:39 +0000 (19:31 -0400)]
runtime: make cgocallback wait on package init

With the new buildmodes c-archive and c-shared, it is possible for a
cgo call to come in early in the lifecycle of a Go program. Calls
before the runtime has been initialized are caught by
_cgo_wait_runtime_init_done. However a call can come in after the
runtime has initialized, but before the program's package init
functions have finished running.

To avoid this cgocallback checks m.ncgo to see if we are on a thread
running Go. If not, we may be a foreign thread and it blocks until
main_init is complete.

Change-Id: I7a9f137fa2a40c322a0b93764261f9aa17fcf5b8
Reviewed-on: https://go-review.googlesource.com/8897
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>

10 years agoruntime: rename close to closefd
David Crawshaw [Mon, 13 Apr 2015 23:37:04 +0000 (19:37 -0400)]
runtime: rename close to closefd

Avoids shadowing the builtin channel close function.

Change-Id: I7a729b0937c8248fe27222be61318a88db995eee
Reviewed-on: https://go-review.googlesource.com/8898
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>

10 years agoimage/jpeg: don't assume that an ensureNBits failure implies that we can
Nigel Tao [Mon, 13 Apr 2015 03:25:28 +0000 (13:25 +1000)]
image/jpeg: don't assume that an ensureNBits failure implies that we can
call unreadByteStuffedByte.

If ensureNBits was due to an io.EOF that was translated to
jpeg.errShortHuffmanData, then we may have read no bytes, so there is no
byte-stuffed-byte to unread.

Fixes #10387

Change-Id: I39a3842590c6cef2aa48943288d52f603338b44d
Reviewed-on: https://go-review.googlesource.com/8841
Reviewed-by: Rob Pike <r@golang.org>
10 years agocmd/5g, etc: remove outdated float type alias comment
Brad Fitzpatrick [Mon, 13 Apr 2015 23:04:02 +0000 (18:04 -0500)]
cmd/5g, etc: remove outdated float type alias comment

Change-Id: Ie5fe5cf3e2926ba4f91271bd47f3f998c26e003e
Reviewed-on: https://go-review.googlesource.com/8914
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
10 years agonet: remove old comment
Brad Fitzpatrick [Tue, 14 Apr 2015 00:19:09 +0000 (17:19 -0700)]
net: remove old comment

The memory model has been clarified since. This is legal and doesn't
need justification.

Change-Id: I60f9938503f86f52bb568ca1a99ac721ee72cee5
Reviewed-on: https://go-review.googlesource.com/8913
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
10 years agocmd/dist: detect sse2 even with gccgo
Shenghou Ma [Mon, 13 Apr 2015 19:50:56 +0000 (15:50 -0400)]
cmd/dist: detect sse2 even with gccgo

Change-Id: Idfb20bfe130d9a54d9f5aae8eab8a34655d30610
Reviewed-on: https://go-review.googlesource.com/8865
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agocmd: -buildmode=c-shared for linux/arm
Srdjan Petrovic [Mon, 13 Apr 2015 22:39:10 +0000 (15:39 -0700)]
cmd: -buildmode=c-shared for linux/arm

Already supported platforms are linux/amd64 and android/arm.

Running -buildmode=c-shared on linux/arm is equivalent to:
  -ldflags "-shared" -asmflags "-shared"

Change-Id: Ifdb267f1d6508157f236be912fa369440172d161
Reviewed-on: https://go-review.googlesource.com/8895
Reviewed-by: David Crawshaw <crawshaw@golang.org>
10 years agotest: add gcc65755.go for http://gcc.gnu.org/PR65755
Ian Lance Taylor [Mon, 13 Apr 2015 22:29:09 +0000 (15:29 -0700)]
test: add gcc65755.go for http://gcc.gnu.org/PR65755

Change-Id: Ic35dff4c9a7fc6716ef9d5553a7b1769bed9be01
Reviewed-on: https://go-review.googlesource.com/8892
Reviewed-by: Minux Ma <minux@golang.org>
10 years agoos: fix TestProgWideChdir on darwin
Mikio Hara [Mon, 13 Apr 2015 03:11:00 +0000 (12:11 +0900)]
os: fix TestProgWideChdir on darwin

On darwin, /tmp and /var directories are usually linked to /private.

% cd $TMPDIR; pwd -L
/var/.../T
% pwd -P
/private/var/.../T

Change-Id: I277ff2d096344d9a80e6004a83e9fc3e1716348c
Reviewed-on: https://go-review.googlesource.com/8842
Reviewed-by: David Crawshaw <crawshaw@golang.org>
10 years agoruntime: shared library init support for android/arm.
Srdjan Petrovic [Fri, 3 Apr 2015 16:48:51 +0000 (09:48 -0700)]
runtime: shared library init support for android/arm.

Follows http://golang.org/cl/8454, a similar CL for arm architectures.
This CL involves android-specific changes, namely, synthesizing
argv/auxv, as android doesn't provide those to the init functions.

This code is based on crawshaw@ android code in golang.org/x/mobile.

Change-Id: I32364efbb2662e80270a99bd7dfb1d0421b5417d
Reviewed-on: https://go-review.googlesource.com/8457
Reviewed-by: David Crawshaw <crawshaw@golang.org>
10 years agodoc/go1.5.txt: fmt fix for empty byte slice
Rob Pike [Mon, 13 Apr 2015 21:40:09 +0000 (14:40 -0700)]
doc/go1.5.txt: fmt fix for empty byte slice

Change-Id: I392cedc49847c8ea0daa38024fca97a289d805af
Reviewed-on: https://go-review.googlesource.com/8890
Reviewed-by: Rob Pike <r@golang.org>
10 years agofmt: empty byte slices should print nothing in hex
Rob Pike [Mon, 13 Apr 2015 19:41:11 +0000 (12:41 -0700)]
fmt: empty byte slices should print nothing in hex

The documentation is clear that formats like %02x applied to a
byte slice are per-element, so the result should be nothing if the
slice is empty. It's not, because the top-level padding routine is called.
It shouldn't be: the loop does the padding for us.

Fixes #10430.

Change-Id: I04ea0e804c0f2e70fff3701e5bf22acc90e890da
Reviewed-on: https://go-review.googlesource.com/8864
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agonet: document that DNSError.Timeout and Temporary are unreliable
Ian Lance Taylor [Sat, 11 Apr 2015 17:30:13 +0000 (10:30 -0700)]
net: document that DNSError.Timeout and Temporary are unreliable

Update #10417.

Change-Id: Ibfbdd05358f696a37217eef160f71b14a468ff86
Reviewed-on: https://go-review.googlesource.com/8788
Reviewed-by: Rob Pike <r@golang.org>
10 years agocmd/dist: use gccgo as bootstrap compiler
Dave Cheney [Mon, 13 Apr 2015 11:50:47 +0000 (21:50 +1000)]
cmd/dist: use gccgo as bootstrap compiler

Fixes #10092

This change makes it possible to use gccgo 5 as the GOROOT_BOOTSTRAP
compiler.

Change-Id: Ie3a312781ac1a09ea77f95b5a78c9488d437e0aa
Reviewed-on: https://go-review.googlesource.com/8809
Run-TryBot: Dave Cheney <dave@cheney.net>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agomisc/cgo/testcarchive: avoid bad pointer passing
David Crawshaw [Mon, 13 Apr 2015 18:54:36 +0000 (14:54 -0400)]
misc/cgo/testcarchive: avoid bad pointer passing

Change-Id: Ifbcc0eb24834f2f7d3b160d1dc911209723d9797
Reviewed-on: https://go-review.googlesource.com/8863
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agomisc/ios: support go run in go_darwin_arm_exec
David Crawshaw [Fri, 6 Mar 2015 14:45:24 +0000 (09:45 -0500)]
misc/ios: support go run in go_darwin_arm_exec

The -lldb flag makes it easy to use go run and end up in a debugging
session on darwin/arm.

Change-Id: I556f93e950086a7dff4839f301b9c55f7579f87b
Reviewed-on: https://go-review.googlesource.com/8024
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
10 years agoruntime: shared library runtime init for arm
Srdjan Petrovic [Fri, 3 Apr 2015 16:40:10 +0000 (09:40 -0700)]
runtime: shared library runtime init for arm

Adds the runtime initialization flow for arm akin to amd64.
In particular,we use the library initialization entry point to:
    - create a new OS thread and run the "regular" runtime init stack on
      that thread
    - return immediately from the main (i.e., loader) thread
    - at the first CGO invocation, we wait for the runtime initialization
      to complete.

Verified to work on a Raspberry Pi and an Android phone.

Change-Id: I32f39228ae30a03ce9569287f234b305790fecf6
Reviewed-on: https://go-review.googlesource.com/8455
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: Srdjan Petrovic <spetrovic@google.com>

10 years agomisc/cgo/testcarchive: test -buildmode=c-archive
David Crawshaw [Mon, 13 Apr 2015 15:31:14 +0000 (11:31 -0400)]
misc/cgo/testcarchive: test -buildmode=c-archive

Change-Id: I1668a6885c45180ff88fe673d04cec7eba395ee7
Reviewed-on: https://go-review.googlesource.com/8861
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agoruntime: remove runtime wait/notify from ppc64x architectures.
Srdjan Petrovic [Sat, 11 Apr 2015 00:23:00 +0000 (17:23 -0700)]
runtime: remove runtime wait/notify from ppc64x architectures.

Related to issue #10410

For some reason, any non-trivial code in _cgo_wait_runtime_init_done
(even fprintf()) will crash that call.

If anybody has any guess why this is happening, please let me know!

For now, I'm clearing the functions for ppc64, as it's currently not used.

Change-Id: I1b11383aaf4f9f9a16f1fd6606842cfeedc9f0b3
Reviewed-on: https://go-review.googlesource.com/8766
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: Srdjan Petrovic <spetrovic@google.com>

10 years agoiostest.bash: do not restart device by default
Josh Bleecher Snyder [Mon, 13 Apr 2015 16:30:56 +0000 (09:30 -0700)]
iostest.bash: do not restart device by default

This is friendlier for manual runs and personal devices.
Builders will pass -restart.

Fixes #10333.

Change-Id: Ia64c8f1660e275b5a1543d7f81f5f5efb623182f
Reviewed-on: https://go-review.googlesource.com/8870
Reviewed-by: David Crawshaw <crawshaw@golang.org>
10 years agocmd/go: -buildmode=c-archive support
David Crawshaw [Fri, 10 Apr 2015 13:11:03 +0000 (09:11 -0400)]
cmd/go: -buildmode=c-archive support

Change-Id: I469254384b0f4e5b5f08a18658934e19259935f9
Reviewed-on: https://go-review.googlesource.com/8718
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

10 years agoruntime/cgo: EXC_BAD_ACCESS handler for arm64
David Crawshaw [Sat, 11 Apr 2015 23:14:02 +0000 (19:14 -0400)]
runtime/cgo: EXC_BAD_ACCESS handler for arm64

Change-Id: Ia9ff9c0d381fad43fc5d3e5972dd6e66503733a5
Reviewed-on: https://go-review.googlesource.com/8815
Reviewed-by: Minux Ma <minux@golang.org>
10 years agocmd/objdump: skip fork test on darwin/arm64
David Crawshaw [Sat, 11 Apr 2015 23:37:29 +0000 (19:37 -0400)]
cmd/objdump: skip fork test on darwin/arm64

Just like darwin/arm.

Change-Id: Ibaba67980db6e05aa71568199b2dac2fcaa86fd6
Reviewed-on: https://go-review.googlesource.com/8824
Reviewed-by: Minux Ma <minux@golang.org>
10 years agocmd/pack: skip fork test on darwin/arm64
David Crawshaw [Sat, 11 Apr 2015 23:36:26 +0000 (19:36 -0400)]
cmd/pack: skip fork test on darwin/arm64

Just like darwin/arm.

Change-Id: I5ed26975670d4189a46b585a56c66c199905d168
Reviewed-on: https://go-review.googlesource.com/8823
Reviewed-by: Minux Ma <minux@golang.org>
10 years agoruntime/pprof: skip fork test on darwin/arm64
David Crawshaw [Sat, 11 Apr 2015 23:04:25 +0000 (19:04 -0400)]
runtime/pprof: skip fork test on darwin/arm64

Just like darwin/arm.

Change-Id: Ic75927bd6457d37cda7dd8279fd9b4cd52edc1d1
Reviewed-on: https://go-review.googlesource.com/8813
Reviewed-by: Minux Ma <minux@golang.org>
10 years agocmd/go: run darwin/arm64 tests sequentially
David Crawshaw [Sat, 11 Apr 2015 23:41:26 +0000 (19:41 -0400)]
cmd/go: run darwin/arm64 tests sequentially

Just like darwin/arm, the test devices can only install and execute
a single app at a time.

Change-Id: I74e6130ef83537c465b4585a366d02953fd907bf
Reviewed-on: https://go-review.googlesource.com/8827
Reviewed-by: Minux Ma <minux@golang.org>
10 years agoruntime/debug: disable arm64 test for issue 9993
David Crawshaw [Sat, 11 Apr 2015 23:10:39 +0000 (19:10 -0400)]
runtime/debug: disable arm64 test for issue 9993

Like other arm64 platforms, darwin/arm64 has a different physical
page size to logical page size so it is running into issue 9993. I
hope it can be fixed for Go 1.5, but for now it is demonstrating the
same bug as the other skipped os+arch combinations.

Change-Id: Iedaf9afe56d6954bb4391b6e843d81742a75a00c
Reviewed-on: https://go-review.googlesource.com/8814
Reviewed-by: Minux Ma <minux@golang.org>
10 years agocrypto/x509: skip arm64 tests limited by iOS
David Crawshaw [Sat, 11 Apr 2015 23:30:37 +0000 (19:30 -0400)]
crypto/x509: skip arm64 tests limited by iOS

Just like darwin/arm.

Change-Id: Ib0438021bfe9eb105222b93e5bb375c282cc7b8c
Reviewed-on: https://go-review.googlesource.com/8822
Reviewed-by: Minux Ma <minux@golang.org>
10 years agolog/syslog: limiting tests on darwin/arm64
David Crawshaw [Sat, 11 Apr 2015 23:26:50 +0000 (19:26 -0400)]
log/syslog: limiting tests on darwin/arm64

Just like darwin/arm.

Change-Id: Ic5c6c0b2fdbb89f4579677e120a8f2dbf300e5b9
Reviewed-on: https://go-review.googlesource.com/8820
Reviewed-by: Minux Ma <minux@golang.org>
10 years agogo/build: skip darwin/arm64 tests that need GOROOT
David Crawshaw [Sat, 11 Apr 2015 23:28:29 +0000 (19:28 -0400)]
go/build: skip darwin/arm64 tests that need GOROOT

Just like darwin/arm.

Change-Id: I1a9f51c572c14b78d35ea62f52927f2bdc46e4c0
Reviewed-on: https://go-review.googlesource.com/8821
Reviewed-by: Minux Ma <minux@golang.org>
10 years agoos/exec: skip fork test on darwin/arm64
David Crawshaw [Sat, 11 Apr 2015 23:23:05 +0000 (19:23 -0400)]
os/exec: skip fork test on darwin/arm64

Just like darwin/arm.

Change-Id: Ia8c912e91259a5073aa3ab2b6509a18aa9a1fce7
Reviewed-on: https://go-review.googlesource.com/8818
Reviewed-by: Minux Ma <minux@golang.org>
10 years agopath/filepath: skip test on darwin/arm64
David Crawshaw [Sat, 11 Apr 2015 23:16:24 +0000 (19:16 -0400)]
path/filepath: skip test on darwin/arm64

Just like darwin/arm.

Change-Id: I4b0ab4a104f2c8a821ca8b5fa8d266e51883709f
Reviewed-on: https://go-review.googlesource.com/8816
Reviewed-by: Minux Ma <minux@golang.org>
10 years agoruntime: skip fork test on darwin/arm64
David Crawshaw [Sat, 11 Apr 2015 23:00:53 +0000 (19:00 -0400)]
runtime: skip fork test on darwin/arm64

Just like darwin/arm.

Change-Id: Ie4998d24b2d891a9f6c8047ec40cd3fdf80622cd
Reviewed-on: https://go-review.googlesource.com/8812
Reviewed-by: Minux Ma <minux@golang.org>
10 years agonet/http/cgi: skip fork test on darwin/arm64
David Crawshaw [Sat, 11 Apr 2015 23:25:45 +0000 (19:25 -0400)]
net/http/cgi: skip fork test on darwin/arm64

Just like darwin/arm.

Change-Id: Ib9a32bb0aed5f08b27de11a93aaf273cacdf5779
Reviewed-on: https://go-review.googlesource.com/8819
Reviewed-by: Minux Ma <minux@golang.org>
10 years agocmd/go: cache results of HTTP requests done during meta tag discovery
Brad Fitzpatrick [Fri, 10 Apr 2015 13:59:06 +0000 (15:59 +0200)]
cmd/go: cache results of HTTP requests done during meta tag discovery

Previously, running

  $ go get -u -v golang.org/x/tools/cmd/godoc

would results in dozens of HTTP requests for

  https://golang.org/x/tools?go-get=1

once per package under x/tools.

Now it caches the results. We still end up doing one HTTP request for
all the packages under x/tools, but this reduces the total number of
HTTP requests in ~half.

This also moves the singleflight package back into an internal
package. singleflight was originally elsewhere as a package, then got
copied into "net" (without its tests). But now that we have internal,
put it in its own package, and restore its test.

Fixes #9249

Change-Id: Ieb5cf04fc4d0a0c188cb957efdc7ea3068c34e3f
Reviewed-on: https://go-review.googlesource.com/8727
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

10 years agoruntime: move all exception related code into signal_windows.go
Alex Brainman [Mon, 13 Apr 2015 02:02:44 +0000 (12:02 +1000)]
runtime: move all exception related code into signal_windows.go

Change-Id: I9654a5c85bd9b3ae9c7a9eddaef1ec752f42bd1b
Reviewed-on: https://go-review.googlesource.com/8840
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

10 years agoimage/gif: expose disposal, bg index and Config
Colin Kennedy [Wed, 11 Feb 2015 22:58:55 +0000 (16:58 -0600)]
image/gif: expose disposal, bg index and Config

The background index in the global palette (located in the image.Config)
is necessary for interpreting GIF frames properly

Frame disposal information is necessary for interpreting GIF frames in
the context of a sequence (or animation)

Removes decoder.flags as it can be a local variable

Change-Id: I6790a7febf6ba0859175c834c807bc6413e6b194
Reviewed-on: https://go-review.googlesource.com/4620
Reviewed-by: Nigel Tao <nigeltao@golang.org>
10 years agoexpvar: swap Float sync. from mutex to atomic.
Matt T. Proud [Mon, 2 Feb 2015 08:33:44 +0000 (00:33 -0800)]
expvar: swap Float sync. from mutex to atomic.

Float type from a mutex to atomic bit array in a manner akin to
Google Guava's AtomicDouble[0], including adding a benchmark for the
type (benchcmp included below) along with some expvar_test.go cruft
being fixed.

benchmark             old ns/op     new ns/op     delta
BenchmarkFloatSet     115           9.37          -91.85%
BenchmarkFloatAdd     114           17.1          -85.00%

benchmark             old allocs     new allocs     delta
BenchmarkFloatSet     0              0              +0.00%
BenchmarkFloatAdd     0              0              +0.00%

benchmark             old bytes     new bytes     delta
BenchmarkFloatSet     0             0             +0.00%
BenchmarkFloatAdd     0             0             +0.00%

[0] - http://goo.gl/m4dtlI

Change-Id: I4ce6a913734ec692e3ed243f6e6f7c11da4c6036
Reviewed-on: https://go-review.googlesource.com/3687
Reviewed-by: Rob Pike <r@golang.org>
10 years agoos: add TestProgWideChdir
David du Colombier [Sun, 12 Apr 2015 17:36:23 +0000 (19:36 +0200)]
os: add TestProgWideChdir

This test checks the working directory is
always consistent after Chdir in a Go program.

Fixes #10035.

Change-Id: I6abf0e4fcd40680ee572c6b40fc52ab17ef38d54
Reviewed-on: https://go-review.googlesource.com/6382
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: David du Colombier <0intro@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

10 years agosyscall: ignore getwd errors when fixing working directory on Plan 9
David du Colombier [Sat, 11 Apr 2015 12:58:42 +0000 (14:58 +0200)]
syscall: ignore getwd errors when fixing working directory on Plan 9

In Plan 9, goroutines can run in different processes,
which don't share their working directory. However,
Go expects the working directory to be program-wide.

We use a Fixwd function to fix the working directory
before calling system calls which depend on the
working directory.

In fixwdLocked, the working directory is not fixed
when getwd returns an error. However, an error can
happen is some cases, notably when the directory
has been previously removed in another process.

Fixes #10422.

Change-Id: Ie0c36f97c4b5ebe27ff0ead360987c5b35f825e4
Reviewed-on: https://go-review.googlesource.com/8800
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agocmd/go: fix a typo.
Hyang-Ah (Hana) Kim [Sun, 12 Apr 2015 16:08:06 +0000 (12:08 -0400)]
cmd/go: fix a typo.

Change-Id: Ic453da17817f66e1073f6ba740b830b8daf2fc38
Reviewed-on: https://go-review.googlesource.com/8829
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agodebug/dwarf: add Entry.AttrField method to get *Field by Attr
Austin Clements [Mon, 6 Apr 2015 22:01:45 +0000 (18:01 -0400)]
debug/dwarf: add Entry.AttrField method to get *Field by Attr

Currently, Entry has a Val method that looks up an attribute and
returns its value. Now that Field has more fields than the attribute
and its value, it's useful to return the whole Field and let the
caller retrieve the parts it needs.

This change adds an AttrField method to Entry that does the same
lookup at Val, but returns the whole *Field rather than just the
value.

Change-Id: Ic629744c14c0e09d7528fa1026b0e1857789948c
Reviewed-on: https://go-review.googlesource.com/8503
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agodebug/dwarf: add DWARF attribute value class to Field
Austin Clements [Thu, 2 Apr 2015 15:19:00 +0000 (11:19 -0400)]
debug/dwarf: add DWARF attribute value class to Field

To return DWARF attribute values, debug/dwarf maps the DWARF attribute
value classes to Go types. Unfortunately, this mapping is ambiguous in
a way that makes it impossible to correctly interpret some DWARF
attributes as of DWARF 4. For example, AttrStartScope can be either a
constant or a rangelistptr. The attribute is interpreted differently
depending on its class, but debug/dwarf maps both classes to int64, so
the caller can't distinguish them from the Go type.
AttrDataMemberLocation is similar.

To address this, this change adds a field to type Field that indicates
the exact DWARF attribute value class of that field's value. This
makes it possible to distinguish value classes that can't be
distinguished by their Go type alone.

The root of this type ambiguity was DWARF itself. For example, DWARF 2
made no distinction between constants that were just constants and
constants that were section offsets because no attribute could have
both meanings. Hence, the single int64 type was sufficient. To avoid
introducing just another layer of ambiguity, this change takes pains
to canonicalize ambiguous classes in DWARF 2 and 3 files into the
unambiguous classes of DWARF 4.

Of course, there's no guarantee that future DWARF versions won't do
the same thing again and further subdivide the DWARF 4 classes. This
change gets ahead of this somewhat by distinguishing the various *ptr
classes even though the encoding does not. If there's some other form
of split, we can handle this in a backwards-compatible way by
introducing, for example, a Class5 field and type.

Change-Id: I4ef96d1223b0fd7f96ecf44fcc0e704a36af02b4
Reviewed-on: https://go-review.googlesource.com/8502
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agocmd/interal/ld: darwin c-archive buildmode support
David Crawshaw [Thu, 9 Apr 2015 14:44:05 +0000 (10:44 -0400)]
cmd/interal/ld: darwin c-archive buildmode support

Uses ar to create an archive when -buildmode=c-archive.

A small example (that I hope to turn into a test in a later CL):

goarchive.go:
package main

import "fmt"

import "C"

func init() {
fmt.Println("ran go init")
}

//export FuncInGo
func FuncInGo() {
fmt.Println("called a go function")
}

func main() {
fmt.Println("in main")
}

This can be compiled with:

go build -ldflags=-buildmode=c-archive -o=libgo.a goarchive.go

main.c:

#include <stdio.h>

extern void FuncInGo();

int main(void) {
printf("c hello\n");
FuncInGo();
printf("c goodbye\n");
return 0;
}

Can be compiled with:

cc main.c libgo.a

Apple provide a warning about the lack of PIE, but still produce a
binary which runs and outputs (on darwin/amd64):

c hello
ran go init
called a go function
c goodbye

Change-Id: I7611925f210a83afa6bd1e66a5601dd636a428c8
Reviewed-on: https://go-review.googlesource.com/8711
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agoruntime: library entry point for darwin/arm
David Crawshaw [Fri, 10 Apr 2015 17:07:04 +0000 (13:07 -0400)]
runtime: library entry point for darwin/arm

Tested by using -buildmode=c-archive to generate an archive, add it
to an Xcode project and calling a Go function from an iOS app. (I'm
still investigating proper buildmode tests for all.bash.)

Change-Id: I7890df15246df8e90ad27837b8d64ba2cde409fe
Reviewed-on: https://go-review.googlesource.com/8719
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agocmd/addr2line: skip fork test on darwin/arm64
David Crawshaw [Sat, 11 Apr 2015 23:43:27 +0000 (19:43 -0400)]
cmd/addr2line: skip fork test on darwin/arm64

Just like darwin/arm.

Change-Id: Ia84662f58f6b1bb168cce8a9837945b1cbd175e1
Reviewed-on: https://go-review.googlesource.com/8828
Reviewed-by: Minux Ma <minux@golang.org>
10 years agocmd/internal/obj/x86: skip test on darwin/arm64
David Crawshaw [Sat, 11 Apr 2015 23:40:16 +0000 (19:40 -0400)]
cmd/internal/obj/x86: skip test on darwin/arm64

Just like darwin/arm, cannot fork..

Change-Id: If565afbceb79013b9e3103e1e28d93691e9fc0a5
Reviewed-on: https://go-review.googlesource.com/8826
Reviewed-by: Minux Ma <minux@golang.org>
10 years agosyscall: skip fork test on darwin/arm64
David Crawshaw [Sat, 11 Apr 2015 22:54:30 +0000 (18:54 -0400)]
syscall: skip fork test on darwin/arm64

Just like darwin/arm.

Change-Id: Iadc30b7307ae56fd4f8a681d49672bed7ca6966f
Reviewed-on: https://go-review.googlesource.com/8810
Reviewed-by: Minux Ma <minux@golang.org>
10 years agocmd/nm: skip fork test on darwin/arm64
David Crawshaw [Sat, 11 Apr 2015 23:38:45 +0000 (19:38 -0400)]
cmd/nm: skip fork test on darwin/arm64

Just like darwin/arm.

Change-Id: Iabb6282f18548da43117ee60f7ad6e272502f09d
Reviewed-on: https://go-review.googlesource.com/8825
Reviewed-by: Minux Ma <minux@golang.org>
10 years agoos: adjust working dir for darwin/arm64 tests
David Crawshaw [Sat, 11 Apr 2015 23:17:47 +0000 (19:17 -0400)]
os: adjust working dir for darwin/arm64 tests

Just like darwin/arm.

Change-Id: Ib64a3e8ff11249a20b0208bd3b900db318c682b7
Reviewed-on: https://go-review.googlesource.com/8817
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

10 years agosync/atomic: skip issue 7338 test on darwin/arm64
David Crawshaw [Sat, 11 Apr 2015 22:57:18 +0000 (18:57 -0400)]
sync/atomic: skip issue 7338 test on darwin/arm64

Similar to darwin/arm. This issue is quite worrying and I hope it
can be addressed for Go 1.5.

Change-Id: Ic095281d6a2e9a38a59973f58d464471db5a2edc
Reviewed-on: https://go-review.googlesource.com/8811
Reviewed-by: Minux Ma <minux@golang.org>
10 years agomisc/ios: pick clang arch based on GOARCH
David Crawshaw [Sat, 11 Apr 2015 23:44:18 +0000 (19:44 -0400)]
misc/ios: pick clang arch based on GOARCH

Change-Id: Ia49ab729747acb07bf392d90aea9e752471e152e
Reviewed-on: https://go-review.googlesource.com/8789
Reviewed-by: Minux Ma <minux@golang.org>
10 years agocmd/6l: support -linkshared
Michael Hudson-Doyle [Wed, 1 Apr 2015 01:57:34 +0000 (14:57 +1300)]
cmd/6l: support -linkshared

Change-Id: Id469165b1acd383837b1f4e1e6f961e10dfa5d61
Reviewed-on: https://go-review.googlesource.com/8332
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

10 years agocmd/5g, cmd/internal/ld, cmd/internal/obj: destutter composite literals
Matthew Dempsky [Fri, 10 Apr 2015 22:25:10 +0000 (15:25 -0700)]
cmd/5g, cmd/internal/ld, cmd/internal/obj: destutter composite literals

While here, this changes DWAbbrev's attr field from a [30]DWAttrForm
with zero-termination to a simple []DWAttrForm, and updates its users
accordingly.

Passes "go build -toolexec 'toolstash -cmp' -a std" on linux/amd64.

Change-Id: I52b5f7a749bdb3e7588fc8ebdb8fee2cf8cab602
Reviewed-on: https://go-review.googlesource.com/8762
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
10 years agocmd/go: fix error message
Dmitry Vyukov [Sat, 11 Apr 2015 18:25:35 +0000 (21:25 +0300)]
cmd/go: fix error message

Change-Id: I440435927fc9f417d81ed4e8656a73787bf0968a
Reviewed-on: https://go-review.googlesource.com/8801
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agocmd/internal/ld: make a few more symbols local
Michael Hudson-Doyle [Sat, 11 Apr 2015 02:04:17 +0000 (14:04 +1200)]
cmd/internal/ld: make a few more symbols local

The symbols for the actual data in a constant string or bytes literal should
be local.

Change-Id: Idafcfba9a638eaa4e460e5103d96843960559b35
Reviewed-on: https://go-review.googlesource.com/8772
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

10 years agoreflect, runtime: check equality, not identity, for method names
Michael Hudson-Doyle [Mon, 30 Mar 2015 02:03:03 +0000 (02:03 +0000)]
reflect, runtime: check equality, not identity, for method names

When dynamically linking Go code, it is no longer safe to assume that
strings that end up in method names are identical if they are equal.

The performance impact seems to be noise:

benchmark                    old ns/op     new ns/op     delta
BenchmarkAssertI2E2          13.3          13.1          -1.50%
BenchmarkAssertE2I           23.5          23.2          -1.28%
BenchmarkAssertE2E2Blank     0.83          0.82          -1.20%
BenchmarkConvT2ISmall        60.7          60.1          -0.99%
BenchmarkAssertI2T           10.2          10.1          -0.98%
BenchmarkAssertE2T           10.2          10.3          +0.98%
BenchmarkConvT2ESmall        56.7          57.2          +0.88%
BenchmarkConvT2ILarge        59.4          58.9          -0.84%
BenchmarkConvI2E             13.0          12.9          -0.77%
BenchmarkAssertI2E           13.4          13.3          -0.75%
BenchmarkConvT2IUintptr      57.9          58.3          +0.69%
BenchmarkConvT2ELarge        55.9          55.6          -0.54%
BenchmarkAssertI2I           23.8          23.7          -0.42%
BenchmarkConvT2EUintptr      55.4          55.5          +0.18%
BenchmarkAssertE2E           6.12          6.11          -0.16%
BenchmarkAssertE2E2          14.4          14.4          +0.00%
BenchmarkAssertE2T2          10.0          10.0          +0.00%
BenchmarkAssertE2T2Blank     0.83          0.83          +0.00%
BenchmarkAssertE2TLarge      10.7          10.7          +0.00%
BenchmarkAssertI2E2Blank     0.83          0.83          +0.00%
BenchmarkConvI2I             23.4          23.4          +0.00%

Change-Id: I0b3dfc314215a4d4e09eec6b42c1e3ebce33eb56
Reviewed-on: https://go-review.googlesource.com/8239
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

10 years agocmd/go: start support for -linkshared
Michael Hudson-Doyle [Wed, 1 Apr 2015 02:53:52 +0000 (15:53 +1300)]
cmd/go: start support for -linkshared

This will fruitlessly rebuild stale packages that are in a shared
library.

Change-Id: I66a6e1adf7818558e7d1351ab215a5021b4a8a6b
Reviewed-on: https://go-review.googlesource.com/8333
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agoapi: update next.txt
Shenghou Ma [Sat, 11 Apr 2015 00:03:28 +0000 (20:03 -0400)]
api: update next.txt

Change-Id: Ibfb5a96995a954c8c1dc563c33bdddbdb4866425
Reviewed-on: https://go-review.googlesource.com/8765
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
10 years agogo/types: move go/types/internal/gcimport => go/internal/gcimporter
Robert Griesemer [Fri, 10 Apr 2015 23:45:10 +0000 (16:45 -0700)]
go/types: move go/types/internal/gcimport => go/internal/gcimporter

This will make it possible to access the gcimporter (and gccgoimporter,
eventually) from the forthcoming gc/importer package, without exposing
compiler names in package names.

This change was created by manually adjusting the gcimporter paths in
go/types.bash and then running sh go/types.bash (i.e., by revendoring
gcimporter). The only manual changes are in go/types.bash.

Change-Id: Idc282439742288c09caa58b3a66d77aec0325faf
Reviewed-on: https://go-review.googlesource.com/8764
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>

10 years agodoc/go1.5.txt: log: LUTC flag
Rob Pike [Sat, 11 Apr 2015 02:32:10 +0000 (19:32 -0700)]
doc/go1.5.txt: log: LUTC flag

Change-Id: Ieadbd2b1ad442ba3eb2ad5f552d96c93ba3e5a2e
Reviewed-on: https://go-review.googlesource.com/8790
Reviewed-by: Rob Pike <r@golang.org>
10 years agolog: add flag LUTC, to use UTC time zone for time stamp
Rob Pike [Fri, 10 Apr 2015 20:33:03 +0000 (13:33 -0700)]
log: add flag LUTC, to use UTC time zone for time stamp

Issue 9483 suggests several approaches to correlating logs from
machines in different time zones. This approach is the simplest and
really should be sufficient: provide a way to clamp the time stamps
to UTC.

Fixes #9483.

Change-Id: If540b991d758c4d845a719779f8255ece7c452e7
Reviewed-on: https://go-review.googlesource.com/8761
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agocmd/6g: call duffcopy, duffzero via got when dynamically linking go
Michael Hudson-Doyle [Mon, 30 Mar 2015 01:54:49 +0000 (01:54 +0000)]
cmd/6g: call duffcopy, duffzero via got when dynamically linking go

Jumping to an offset past a symbol isn't something that is really
supported by dynamic linkers, so do it by hand.

Change-Id: Ifff8834c6cdfa3d521ebd8479d2e93906df9b258
Reviewed-on: https://go-review.googlesource.com/8238
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>

10 years agodebug/gosym: skip tests when .gosymtab section not found
Michael Hudson-Doyle [Wed, 18 Feb 2015 01:58:13 +0000 (14:58 +1300)]
debug/gosym: skip tests when .gosymtab section not found

Skip the test when there is no .gosymtab section in the executable
rather than crashing.

Change-Id: Ieb3df07e307f50c33cdafab38f9b5d1ac0e55c04
Reviewed-on: https://go-review.googlesource.com/5110
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>

10 years agodoc/go1.5.txt: note new options for go, gc, asm, ld
Ian Lance Taylor [Fri, 10 Apr 2015 23:47:14 +0000 (16:47 -0700)]
doc/go1.5.txt: note new options for go, gc, asm, ld

Change-Id: I353ff7eb35b066a1a2693c087c9876adac8e3fd0
Reviewed-on: https://go-review.googlesource.com/8763
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agotest: add gccgo test case for #10407
Shenghou Ma [Fri, 10 Apr 2015 07:28:40 +0000 (03:28 -0400)]
test: add gccgo test case for #10407

Change-Id: I8d17e2b0fbc529ca7958c75222964a5e419aa3db
Reviewed-on: https://go-review.googlesource.com/8717
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agoruntime: Fix GDB integration with Python 2
Derek Buitenhuis [Fri, 10 Apr 2015 19:13:04 +0000 (15:13 -0400)]
runtime: Fix GDB integration with Python 2

A similar fix was applied in 545686857bc4c2e7a5306d97e5ef48f631d277bc
but another instance of 'pc' was missed.

Also adds a test for the goroutine gdb command.

It currently uses goroutine 2 for the test, since goroutine 1 has
its stack pointer set to 0 for some reason.

Change-Id: I53ca22be6952f03a862edbdebd9b5c292e0853ae
Reviewed-on: https://go-review.googlesource.com/8729
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
10 years agodoc/go1.5.txt: time.AppendFormat
Rob Pike [Fri, 10 Apr 2015 20:19:20 +0000 (13:19 -0700)]
doc/go1.5.txt: time.AppendFormat

Change-Id: I9e8a0dc152ef9403ff5ece0c161bda3a2f4448a8
Reviewed-on: https://go-review.googlesource.com/8760
Reviewed-by: Rob Pike <r@golang.org>
10 years agotime: add Time.AppendFormat
Caleb Spare [Thu, 18 Dec 2014 04:18:06 +0000 (17:18 +1300)]
time: add Time.AppendFormat

This is a version of Time.Format that doesn't require allocation.

This is an updated version of 0af302f50745b93e90a4507993a555d246acef45
submitted by @bradfitz which was later rolled back.

Fixes #5192
Updates #5195

Change-Id: I4e6255bee1cf3914a6cc8d9d2a881cfeb273c08e
Reviewed-on: https://go-review.googlesource.com/1760
Reviewed-by: Rob Pike <r@golang.org>
10 years agocmd/gc: fix handling of OGETG in race mode
Dmitry Vyukov [Thu, 9 Apr 2015 07:08:29 +0000 (10:08 +0300)]
cmd/gc: fix handling of OGETG in race mode

Now that getg is an intrinsic, more runtime functions
gets inlined (in particular, LockOSThread).
Runtime code gets race instrumented after inlining into
other packages. This can lead to false positives,
as race detector ignores all internal synchronization in runtime.
Inling of LockOSThread lead to false race reports on m contents.
See the issue for an example.

Fixes #10380

Change-Id: Ic9b760b53c28c2350bc54a5d4677fcd1c1f86e5f
Reviewed-on: https://go-review.googlesource.com/8690
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>