1
0
mirror of https://github.com/golang/go synced 2024-09-30 02:24:43 -06:00
Commit Graph

35139 Commits

Author SHA1 Message Date
Andrew Bonventre
6c27114ced doc: document Go 1.8.6
Update golang/go#23515

Change-Id: Id334d8663bf4cbb68f224d1bba4c9ad3855f8aae
Reviewed-on: https://go-review.googlesource.com/89155
Reviewed-by: Andrew Gerrand <adg@golang.org>
2018-01-23 02:15:53 +00:00
Ian Lance Taylor
cebc7064df cmd/go: apply "go vet" to test files
In earlier versions of Go the "go vet" command would run on regular
source files and test files. That was lost in CL74750.  Bring it back.

This required moving a chunk of code from internal/test to
internal/load. The diff looks big but the code is unchanged.

Fixes #23395

Change-Id: Ie9ec183337e8db81c5fc421d118a22b351b5409e
Reviewed-on: https://go-review.googlesource.com/87636
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-23 02:09:05 +00:00
Austin Clements
dbd8f3d739 runtime: print hexdump on traceback failure
Currently, if anything goes wrong when printing a traceback, we simply
cut off the traceback without any further diagnostics. Unfortunately,
right now, we have a few issues that are difficult to debug because
the traceback simply cuts off (#21431, #23484).

This is an attempt to improve the debuggability of traceback failure
by printing a diagnostic message plus a hex dump around the failed
traceback frame when something goes wrong.

The failures look like:

goroutine 5 [running]:
runtime: unexpected return pc for main.badLR2 called from 0xbad
stack: frame={sp:0xc42004dfa8, fp:0xc42004dfc8} stack=[0xc42004d800,0xc42004e000)
000000c42004dea8:  0000000000000001  0000000000000001
000000c42004deb8:  000000c42004ded8  000000c42004ded8
000000c42004dec8:  0000000000427eea <runtime.dopanic+74>  000000c42004ded8
000000c42004ded8:  000000000044df70 <runtime.dopanic.func1+0>  000000c420001080
000000c42004dee8:  0000000000427b21 <runtime.gopanic+961>  000000c42004df08
000000c42004def8:  000000c42004df98  0000000000427b21 <runtime.gopanic+961>
000000c42004df08:  0000000000000000  0000000000000000
000000c42004df18:  0000000000000000  0000000000000000
000000c42004df28:  0000000000000000  0000000000000000
000000c42004df38:  0000000000000000  000000c420001080
000000c42004df48:  0000000000000000  0000000000000000
000000c42004df58:  0000000000000000  0000000000000000
000000c42004df68:  000000c4200010a0  0000000000000000
000000c42004df78:  00000000004c6400  00000000005031d0
000000c42004df88:  0000000000000000  0000000000000000
000000c42004df98:  000000c42004dfb8  00000000004ae7d9 <main.badLR2+73>
000000c42004dfa8: <00000000004c6400  00000000005031d0
000000c42004dfb8:  000000c42004dfd0 !0000000000000bad
000000c42004dfc8: >0000000000000000  0000000000000000
000000c42004dfd8:  0000000000451821 <runtime.goexit+1>  0000000000000000
000000c42004dfe8:  0000000000000000  0000000000000000
000000c42004dff8:  0000000000000000
main.badLR2(0x0)
	/go/src/runtime/testdata/testprog/badtraceback.go:42 +0x49

For #21431, #23484.

Change-Id: I8718fc76ced81adb0b4b0b4f2293f3219ca80786
Reviewed-on: https://go-review.googlesource.com/89016
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2018-01-22 21:51:29 +00:00
Andrew Bonventre
2923b209b3 doc: update 1.9.3 release date
Change-Id: I689ccfb8452a170629425dc97da503b28766c6f9
Reviewed-on: https://go-review.googlesource.com/89035
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-01-22 21:11:38 +00:00
Russ Cox
21a460d3ab doc/go1.10: address final TODOs
Change-Id: Id71c1ccb584fb308f1615c0ed1255cc8b44bf675
Reviewed-on: https://go-review.googlesource.com/88256
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-01-22 16:56:10 +00:00
Elias Naur
40ea396c09 cmd/vendor/github.com/google/pprof/internal/driver: skip read only dir error on Android
On an android/amd64 emulator, $HOME points to / which is not writable.
Ignore the error in the pprof driver test.

With this, androidtest.sh on android/amd64 and android/386 passes.

Upstream pull request https://github.com/google/pprof/pull/295.

Change-Id: If919d7f44530a977fd044631ad01bac87d32deaa
Reviewed-on: https://go-review.googlesource.com/88817
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2018-01-22 16:53:10 +00:00
Russ Cox
0133b5df60 cmd/go: add go help cache
Change-Id: I14eeda85f279d1082ea9f2ac590b848ac13b1daa
Reviewed-on: https://go-review.googlesource.com/87023
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2018-01-22 16:51:09 +00:00
Ian Lance Taylor
6104939432 runtime: pass dummy argc/argv correctly in r0_386_android_lib
Fix breakage introduced in CL 70530.

Change-Id: I87f3da6b20554d4f405a1143b0d894c5953b63aa
Reviewed-on: https://go-review.googlesource.com/88516
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2018-01-21 04:56:36 +00:00
Elias Naur
919e85ae05 misc,src: add support for specifying adb flags to the android harness
Introduce GOANDROID_ADB_FLAGS for additional flags to adb invocations.
With GOANDROID_ADG_FLAGS, the Android builders can distinguish between
emulator and device builds.

Change-Id: I11729926a523ee27f6a3795cb2cfb64a9454f0a5
Reviewed-on: https://go-review.googlesource.com/88795
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2018-01-20 21:13:30 +00:00
Andrew Bonventre
3810f5bfed doc: change anchor URLs from golang.org/dl/ to /dl/
When running locally, it will redirect properly to golang.org/dl/
(see https://github.com/golang/tools/blob/master/cmd/godoc/dl.go).

This is to support domains in prod other than golang.org.

Change-Id: I6d3051fcd7e06a86442324a64d781d8ad95c624f
Reviewed-on: https://go-review.googlesource.com/88679
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-01-20 04:13:12 +00:00
Ian Lance Taylor
984e81f64e doc/faq: clarify that concurrent maps reads are safe
Fixes #23480

Change-Id: I33b4bdc60b9983ab62d87bfa0ae3ff33304269c0
Reviewed-on: https://go-review.googlesource.com/88515
Reviewed-by: Rob Pike <r@golang.org>
2018-01-20 01:58:21 +00:00
Andrew Bonventre
68ce117cf1 doc: document Go 1.9.3
Change-Id: Ic7a5d3118754b34ab0652fcef889259a03baebc3
Reviewed-on: https://go-review.googlesource.com/88536
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-19 23:36:32 +00:00
Keith Randall
4555ed2e5e cmd/fix: add intermediate cast for *C.CFTypeRef <-> *unsafe.Pointer
When casting between *C.CFTypeRef and *unsafe.Pointer, we used to be
able to do the cast directly. Now with C.CFTypeRef being a uintptr
instead of an unsafe.Pointer, we need an intermediate cast.

Add the insertion of the intermediate cast to the cftype fix module.

Fixes #23091

Change-Id: I891be2f4a08cfd7de1cc4c6ab841b1e0d8c388a6
Reviewed-on: https://go-review.googlesource.com/88175
Reviewed-by: Robert Griesemer <gri@golang.org>
2018-01-19 16:04:54 +00:00
Adam Langley
4dc1c491b0 crypto/x509: better document Verify's behaviour.
This change expands the documentation for Verify to mention the name
constraints and EKU behaviour.

Change-Id: Ifc80faa6077c26fcc1d2a261ad1d14c00fd13b23
Reviewed-on: https://go-review.googlesource.com/87300
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-01-18 14:43:29 +00:00
Caleb Spare
67fdf587dc cmd/compile: don't combine 64-bit loads/stores on amd64
This causes a performance regression for some calls.

Fixes #23424.
Updates #6853.

Change-Id: Id1db652d5aca0ce631a3417c0c056d6637fefa9e
Reviewed-on: https://go-review.googlesource.com/88135
Run-TryBot: Caleb Spare <cespare@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2018-01-17 22:05:33 +00:00
Keith Randall
bd89333426 cmd/fix: don't depend on *GetTypeID functions being present
cgo uses the presence of these functions to determine whether
a given type is in the CFTypeRef hierarchy and thus should be
a uintptr instead of a pointer. But if the *GetTypeID functions
aren't used by the user code, then they won't be present in the
cgo output, and thus cmd/fix won't see them.

Use the simpler rule that anything ending in *Ref should be
rewritten. This could over-rewrite, but I don't see a simpler
solution. Unlike cgo, it is easy to edit the output to fix any
issues. And fix is a much rarer operation than cgo.

This is a revert of portions of CL 87616.

Update #23091

Change-Id: I74ecd9fb25490a3d279b372e107248452bb62185
Reviewed-on: https://go-review.googlesource.com/88075
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2018-01-17 20:35:43 +00:00
Robert Griesemer
18d527b3f0 spec: mention that special case for integer division is due to overflow
Fixes #23443.

Change-Id: If60c39b582ee5308e9fa902f93c1b6ae7890346c
Reviewed-on: https://go-review.googlesource.com/87975
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2018-01-17 18:59:44 +00:00
Keith Randall
2dc025e4e1 cmd/fix: extend typechecker to use cgo types
If a file uses cgo, incorporate the types generated by running cgo.

Update #23091

Change-Id: I10958fa7fd6027c2c96a9fd8a9658de35439719f
Reviewed-on: https://go-review.googlesource.com/87616
Reviewed-by: Robert Griesemer <gri@golang.org>
2018-01-17 06:44:25 +00:00
Keith Randall
d162a297ed cmd/cgo: rewrite CFTypeRef and subytes on Darwin to uintptr
Cgo currently maps CFTypeRef and its subtypes to unsafe.Pointer
or a pointer to a named empty struct.

However, Darwin sometimes encodes some of CFTypeRef's subtypes as a
few int fields packed in a pointer wrapper. This hackery confuses the
Go runtime as the pointers can look like they point to things that
shouldn't be pointed at.

Switch CFTypeRef and its subtypes to map to uintptr.

Detecting the affected set of types is tricky, there are over 200 of
them, and the set isn't static across Darwin versions. Fortunately,
downcasting from CFTypeRef to a subtype requires calling CFGetTypeID,
getting a CFTypeID token, and comparing that with a known id from a
*GetTypeID() call. So we can find all the type names by detecting all
the *GetTypeID() prototypes and rewriting the corresponding *Ref types
to uintptr. This strategy covers all the cases I've checked and is
unlikely to have a false positive.

Update #23091.

Change-Id: I487eb4105c9b4785ba564de9c38d472c8c9a76ac
Reviewed-on: https://go-review.googlesource.com/87615
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-17 06:38:57 +00:00
Brad Fitzpatrick
165e7523fb sync: consistently use article "a" for RWMutex
We used a mix of both before.

I've never heard anybody say "an arr-double you mutex" when speaking.

Fixes #23457

Change-Id: I802b5eb2339f885ca9d24607eeda565763165298
Reviewed-on: https://go-review.googlesource.com/87896
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2018-01-16 23:09:57 +00:00
Giovanni Bajo
2d6f941e8c runtime: fix time.Now on Sierra and older
CL 67332 created the fast no-syscall path for time.Now in High Sierra
but managed to break Sierra and older by forcing them into the slow
syscall path: the version check based on commpage version was wrong.

This CL uses the Darwin version number instead.

The assembly diff is noisy because many variables had to be
renamed, but the only actual change is the version check.

Fixes #23419.

Change-Id: Ie31ef5fb88f66d1517a8693942a7fb6100c213b0
Reviewed-on: https://go-review.googlesource.com/87655
Run-TryBot: Giovanni Bajo <rasky@develer.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2018-01-16 16:49:41 +00:00
Tobias Klauser
7e054553ad runtime: update URL of the Linux vDSO parser tool
The tool was moved to tools/Testing/selftests within the Linux kernel
source tree. Adjust the URL in the comments of vdso_linux.go

Change-Id: I86b9cae4b898c4a45bc7c54891ce6ead91a22670
Reviewed-on: https://go-review.googlesource.com/87815
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-16 15:11:05 +00:00
Alberto Donizetti
8f6e8f9efd doc: specify which pprof version was vendored in go1.10
Change-Id: I248cb10a2e24f089600c13e86da251970c773d95
Reviewed-on: https://go-review.googlesource.com/87662
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-16 08:20:51 +00:00
Ian Lance Taylor
4b3a3bd3aa runtime: don't issue cgocheck error for timer bucket source pointer
The cgo checker was issuing an error with cgocheck=2 when a timer
bucket was stored in a pollDesc. The pollDesc values are allocated
using persistentalloc, so they are not in the Go heap. The code is OK
since timer bucket pointers point into a global array, and as such are
never garbage collected or moved.

Mark timersBucket notinheap to avoid the problem. timersBucket values
only occur in the global timers array.

Fixes #23435

Change-Id: I835f31caafd54cdacc692db5989de63bb49e7697
Reviewed-on: https://go-review.googlesource.com/87637
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-01-15 22:18:55 +00:00
Rob Pike
39687051e9 cmd/go: clarify and simplify (a little) the description of go test's caching
I found the previous text choppy and hard to follow, and in putting
this CL together, based entirely on the existing text, I found
several details that seemed misleading to me.

This is my attempt to make the text simultaneously easier to
understand, more complete, and more precise. I may have failed in
all three, but I wanted to try.

Change-Id: I088cb457f6fcad8f2b40236949cc3ac43455e600
Reviewed-on: https://go-review.googlesource.com/87735
Reviewed-by: Russ Cox <rsc@golang.org>
2018-01-15 03:01:20 +00:00
Kunpei Sakai
a89fa7040b net/rpc: improve error report messages
Updates #19957

Change-Id: I8e2e3837db9e5e69b7102f9bd5831fe78ac60cfc
Reviewed-on: https://go-review.googlesource.com/87335
Run-TryBot: Rob Pike <r@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2018-01-15 01:31:35 +00:00
Brad Fitzpatrick
9f31353a6c cmd/go: use Windows %AppData% for build cache if %LocalAppData% is empty
Fixes #23190

Change-Id: I96805aaab44ddaae6098b4e3af30f9e52585eae0
Reviewed-on: https://go-review.googlesource.com/87675
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-14 04:28:27 +00:00
Ian Lance Taylor
9745eed4fd cmd/go: make gccgo -buildmode=shared and -linkshared work again
After CL 69831, addTransitiveLinkDeps ensures that all dependencies of
a link appear in Deps. We no longer need to traverse through all
actions to find them. And the old scheme of looking through all the
actions and assuming we would see shared library actions before
libraries they depend on no longer works.

Now that we have complete deps, change to a simpler scheme in which we
find the shared libraries in the deps, and then use that to sort the
deps into archives and shared libraries.

Fixes #22224

Change-Id: I14fcc773ac59b6f5c2965cc04d4ed962442cc89e
Reviewed-on: https://go-review.googlesource.com/87497
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2018-01-12 05:25:55 +00:00
Robert Griesemer
8554fd6e7d cmd/compile: document reserved import paths
Fixes #20708.

Change-Id: I2db450947b64b8b5af3822c7fbcc3e99746ae9d7
Reviewed-on: https://go-review.googlesource.com/87496
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2018-01-12 04:00:15 +00:00
Robert Griesemer
c13e0e8cee spec: remove example explaining that type B0 and B0 are identical
Every few months we get a new error report claiming that there
is a typo in the spec related to this specific example. Clearly,
the fact that two types with the same identifier are identical
seems exceedingly obvious to readers; thus the example seems not
worth the trouble. Removing it.

For #9226.
For #22202.
For #22495.
For #23096.
For #23409.

There may be more.

Change-Id: I003ba79dc460ffb028a4ecb5f29efd60f2551912
Reviewed-on: https://go-review.googlesource.com/87417
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2018-01-11 21:04:11 +00:00
Ian Lance Taylor
fe49d100e4 misc/cgo/test: avoid endless loop when we can't parse notes
Change-Id: I085870d978a3a560588711882c77060d136d867a
Reviewed-on: https://go-review.googlesource.com/87415
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-01-11 19:55:49 +00:00
Ian Lance Taylor
1c0d5427de cmd/go: correct buildmode test (from "c-header" to "c-shared")
Change-Id: I8688a47ae83f6719f6134c64fb3d3f2aa275c641
Reviewed-on: https://go-review.googlesource.com/87158
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2018-01-11 19:24:35 +00:00
Andrew Bonventre
594668a5a9 doc, api: add type Srcset string change to go1.10 notes and API
Change-Id: I13afaa894292bd566510b40a5e4bbbe4d72d4d08
Reviewed-on: https://go-review.googlesource.com/87395
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-11 17:44:08 +00:00
Adam Langley
4458a357ab crypto/x509: parse multiple URLs in a single CRLDP.
Previously we would only extract a single URL from a given CRLDP, but
https://tools.ietf.org/html/rfc5280#section-4.2.1.13 permits multiple
URLs for a single distribution point.

Fixes #23403

Change-Id: I2eaed1537df02d0627db1b86bcd9c94506236bea
Reviewed-on: https://go-review.googlesource.com/87299
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-01-11 16:47:29 +00:00
Kunpei Sakai
6631f22776 net/http: avoid for-loop if possible
Change-Id: I01900c3a2ebdda8c90d0585f179a39ee890c417f
Reviewed-on: https://go-review.googlesource.com/87336
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-11 02:39:43 +00:00
Robert Griesemer
08e342d62c cmd/compile/internal/syntax: don't record semi position if there's none
Fixes #23406.

Change-Id: Ief04e20357c9ca03a5e496f1742428394c8ee658
Reviewed-on: https://go-review.googlesource.com/87317
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-11 01:30:49 +00:00
Ian Lance Taylor
40a17eed93 crypto: clarify that some files come from CRYPTOGAMS
and that they are covered by the CRYPTOGAMS license.

Fixes #22637

Change-Id: I75b8e08d3a8b569edf383c078bb11c796b766c81
Reviewed-on: https://go-review.googlesource.com/87315
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-01-11 00:07:35 +00:00
Terin Stock
936b6bfde1 net/http: redirect host-based patterns to trailing slash
Handlers can be registered for specific hosts by specifying the host as
part of the mux pattern. If a trailing slash route is registered for
these host-based patterns, shouldRedirect should indicate that
a redirect is required.

This change modifies shouldRedirect to also take the host of the
request, and now considers host-based patterns while determining if
a request should be redirected.

Fixes #23183
Change-Id: If8753e130d5d877acdc55344833e3b289bbed2b4
Reviewed-on: https://go-review.googlesource.com/84695
Reviewed-by: Kunpei Sakai <namusyaka@gmail.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Tom Bergan <tombergan@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-11 00:05:49 +00:00
Brad Fitzpatrick
bb4356dbfd net/http: fix "http2: no cached connection..." error with x/net/http2
The net/http Transport was testing for a sentinel x/net/http2 error
value with ==, which meant it was only testing the bundled version. If
a user enabled http2 via golang.org/x/net/http2, the error value had a
different name.

This also updates the bundled x/net/http2 to git rev ab555f36 for:

    http2: add internal function isNoCachedConnError to test for ErrNoCachedConn
    https://golang.org/cl/87297

Fixes #22091

Change-Id: I3fb85e2b7ba7d145dd66767e1795a56de633958c
Reviewed-on: https://go-review.googlesource.com/87298
Reviewed-by: Tom Bergan <tombergan@google.com>
2018-01-10 23:24:51 +00:00
Ian Lance Taylor
1b89dada1a cmd/cgo: support niladic macros for gccgo
https://golang.org/cl/43970 changed writeOutputFunc to support niladic
function-like macros; apply the corresponding change to
writeGccgoOutputFunc.

Updates #10715
Updates #18720

Change-Id: I5decb1d37ec71507466ade2eeda4b89c8785eaef
Reviewed-on: https://go-review.googlesource.com/86475
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hiroshi Ioka <hirochachacha@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2018-01-10 20:47:34 +00:00
Ian Lance Taylor
f7d8098a7b cmd/go: check for another GCC error message
GCC always recognizes the -fsplit-stack option, but then tests whether
it is supported by the selected target. If not, it reports
    cc1: error: ‘-fsplit-stack’ is not supported by this compiler configuration
Check for that error message when deciding whether a compiler option works.

Change-Id: I2eef8d550bbecba3a087869df2c7351280c77290
Reviewed-on: https://go-review.googlesource.com/87136
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
2018-01-10 20:46:52 +00:00
Russ Cox
37d56279c8 cmd/go: limit test input file change detection to local GOROOT/GOPATH tree
We've had a series of problems with tests unexpectedly (and innocently)
looking at system files that appear to (but don't) change in meaningful ways,
like /dev/null on OS X having a modification time set to the current time.

Cut all these off by only applying file change detection to the local package
root: the GOROOT or specific sub-GOPATH in which the package being tested
is found.

(This means that if you test reads /tmp/x and you change /tmp/x, the cached
result will still be used. Don't do that, or else use -count=1.)

Fixes #23390.

Change-Id: I30b6dd194835deb645a040aea5e6e4f68af09edb
Reviewed-on: https://go-review.googlesource.com/87015
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-10 20:29:33 +00:00
Daniel Martí
c203696aa5 go/importer,os/exec: use testenv.GoToolPath
These were the last two occurences of exec.Command("go", ...) in all of
std cmd. Checked with:

	gogrep '$(f is(func))("go", $*_)' std cmd

Also changed lp_windows_test to use a test package name to avoid a
circular dependency, since internal/testenv imports os/exec.

Change-Id: I9a18948600dfecc8507ad76172e219e78b791ffd
Reviewed-on: https://go-review.googlesource.com/87200
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-01-10 20:24:15 +00:00
Brad Fitzpatrick
c5d744a4f6 os/exec: skip TestContextCancel on the Windows XP builder
Updates #17245

Change-Id: I3d7ea362809040fbbba4b33efd57bf2d27d4c390
Reviewed-on: https://go-review.googlesource.com/87257
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-10 19:59:44 +00:00
Russ Cox
e7303a72db doc/go1.10: document that Go 1.11 will remove Windows XP support
Fixes #23380.

Change-Id: Ia9a086eada21b5561f110833afcf93e542a04407
Reviewed-on: https://go-review.googlesource.com/87175
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-01-10 19:53:26 +00:00
Robert Griesemer
6697aa58ae go/internal/gccgoimporter: parse optional escape info in export data
Fixes #23324.

Change-Id: Ie2383bad35f0bcc1344a8a1683be08d5fd0eea96
Reviewed-on: https://go-review.googlesource.com/86977
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2018-01-10 19:41:25 +00:00
Than McIntosh
5e1dcb7a04 cmd/compile: workaround for inconsistent receiver param srcpos
Given an inlinable method M in package P:

   func (r *MyStruct) M(...) {

When M is compiled within its home package, the source position that
the compiler records for 'r' (receiver parameter variable) is
accurate, whereas if M is built as part of the compilation of some
other package (body read from export data), the declaration line
assigned to 'r' will be the line number of the 'import' directive, not
the source line from M's source file.

This inconsistency can cause differences in the size of abstract
parameter DIEs (due to variable-length encoding), which can then in
turn result in bad abstract origin offsets, which in turn triggers
build failures on iOS (dsymutil crashes when it encounters an
incorrect abstract origin reference).

Work around the problem by removing the "declaration line number"
attribute within the abstract parameter abbreviation table entry. The
decl line attribute doesn't contribute a whole lot to the debugging
experience, and it gets rid of the inconsistencies that trigger the
dsymutil crashes.

Updates #23374.

Change-Id: I0fdc8e19a48db0ccd938ceadf85103936f89ce9f
Reviewed-on: https://go-review.googlesource.com/87055
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2018-01-10 19:11:35 +00:00
Samuel Tan
c9517688c7 html/template: check for duplicates when inserting escapers
Ensure that we do not insert any escapers into pipelines that
already contain an equivalent escaper. This prevents overescaping
from occuring even when an aliased parse tree that has already
been escaped is escaped again.

Fixes #21844

Change-Id: Ic00d5e01c97ef09a4e49407009cf71b0d07f5c0e
Reviewed-on: https://go-review.googlesource.com/83920
Reviewed-by: Russ Cox <rsc@golang.org>
2018-01-10 17:36:27 +00:00
kim yongbin
dbdeeed02e doc/go1.10: fix typo of "preserves"
Change-Id: Ib5f5d20200284850c14c2431687bc102696ef8ae
Reviewed-on: https://go-review.googlesource.com/87215
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-01-10 17:14:31 +00:00
Ian Lance Taylor
4a28707d55 cmd/go: run the real test binary if the test link was cached
Fixes #23150

Change-Id: Ia82c2d482a8dc53cabb3f173e4301fee66288821
Reviewed-on: https://go-review.googlesource.com/84376
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
2018-01-10 16:13:38 +00:00