Brad Fitzpatrick [Tue, 26 Jan 2016 18:55:35 +0000 (18:55 +0000)]
net/http: document TimeFormat more
Fixes #14103
Change-Id: I89963643eccc902b809e04b7a14153acb0d242e1
Reviewed-on: https://go-review.googlesource.com/18933 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Ian Lance Taylor [Mon, 25 Jan 2016 19:44:02 +0000 (11:44 -0800)]
cmd/link: add -extar option to set ar program for c-archive
People who want to use -buildmode=c-archive in unusual cross-compilation
setups will need something like this. It could also be done via (yet
another) environment variable but I use -extar by analogy with the
existing -extld.
Change-Id: I354cfabc4c470603affd13cd946997b3a24c0e6c
Reviewed-on: https://go-review.googlesource.com/18913 Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Mikio Hara [Tue, 26 Jan 2016 07:29:47 +0000 (16:29 +0900)]
net/http: fix nit in test
Change-Id: I8c647e709d93a76636e04375609fceadf3754aa1
Reviewed-on: https://go-review.googlesource.com/18954 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Mikio Hara [Tue, 26 Jan 2016 07:35:52 +0000 (16:35 +0900)]
cmd/go/testdata: fix nits in test
Change-Id: I85fa5e672a476098f8711dcbb5b20ea1a3fa630d
Reviewed-on: https://go-review.googlesource.com/18953 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Ian Lance Taylor [Mon, 25 Jan 2016 23:22:03 +0000 (15:22 -0800)]
runtime: don't check sigaltstack on darwin/{arm,arm64}
Use of the alternate signal stack on darwin/{arm,arm64} is reportedly
buggy, and the runtime function sigaltstack does nothing. So don't
check the sigaltstack result to decide how to handle the signal stack.
Brad Fitzpatrick [Wed, 20 Jan 2016 19:00:32 +0000 (19:00 +0000)]
net/http/httputil: clarify docs on the Dump functions
Also don't nil out the Request or Response Body on error. Just leave
it in its previous broken state. The docs now say it's undefined, but
it always was.
Fixes #14036
Change-Id: I7fe175a36cbc01b4158f4dffacd8733b2ffa9999
Reviewed-on: https://go-review.googlesource.com/18726 Reviewed-by: Rob Pike <r@golang.org>
Ian Lance Taylor [Mon, 25 Jan 2016 17:54:39 +0000 (09:54 -0800)]
runtime/pprof: document SetCPUProfile with c-archive/c-shared
When using c-archive/c-shared, the signal handler for SIGPROF will not
be installed, which means that runtime/pprof.StartCPUProfile won't work.
There is no really good solution here, as the main program may want to
do its own profiling. For now, just document that runtime/pprof doesn't
work as expected, but that it will work if you use Notify to install the
Go signal handler.
Fixes #14043.
Change-Id: I7ff7a01df6ef7f63a7f050aac3674d640a246fb4
Reviewed-on: https://go-review.googlesource.com/18911
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
Ian Lance Taylor [Fri, 22 Jan 2016 05:56:38 +0000 (21:56 -0800)]
runtime: always install new signal stack on NetBSD and DragonFly
On NetBSD and DragonFly a newly created thread inherits the signal stack
of the creating thread. That means that in a cgo program a C thread
created using pthread_create will get the signal stack of the creating
thread, most likely a Go thread. This will then lead to chaos if two
signals occur simultaneously.
We can't fix the general case. But we can fix the case of a C thread
that calls a Go function, by installing a new signal stack and then
dropping it when we return to C. That will break the case of a C thread
that calls sigaltstack and then calls Go, because we will drop the C
thread's alternate signal stack as we return from Go. Still, this is
the 1.5 behavior. And what else can we do?
Russ Cox [Sun, 24 Jan 2016 06:33:16 +0000 (01:33 -0500)]
cmd/asm: reject foo(SB)(AX) instead of silently treating as foo(SB)
Add test for assembly errors, to verify fix.
Make sure invalid instruction errors are printed just once
(was printing them once per span iteration, so typically twice).
Fixes #13282.
Change-Id: Id5f66f80a80b3bc4832e00084b0a91f1afec7f8f
Reviewed-on: https://go-review.googlesource.com/18858 Reviewed-by: Rob Pike <r@golang.org>
Russ Cox [Sun, 24 Jan 2016 16:02:19 +0000 (11:02 -0500)]
misc/cgo/test: fix test on darwin/386 with cgo enabled
Apparently the darwin/386 builder does not enable cgo.
This failure turned up running
GOARCH=386 GOHOSTARCH=386 ./all.bash
on my Mac.
Change-Id: Ia2487c4fd85d4b0f9f564880f22d9fde379946c3
Reviewed-on: https://go-review.googlesource.com/18859 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Use the standard names, for discoverability.
Use the standard register arguments, for correctness.
Implement all possible arguments, for completeness.
Enable the corresponding tests now that everything is standard.
Update the uses in package runtime.
Russ Cox [Fri, 22 Jan 2016 03:48:29 +0000 (22:48 -0500)]
cmd/asm: report more than one instruction encoding error
Also, remove output file if there are encoding errors.
The extra reports are convenient.
Removing the output file is very important.
Noticed while testing.
Change-Id: I0fab17d4078f93c5a0d6d1217d8d9a63ac789696
Reviewed-on: https://go-review.googlesource.com/18845 Reviewed-by: Rob Pike <r@golang.org>
Russ Cox [Tue, 5 Jan 2016 14:48:45 +0000 (09:48 -0500)]
cmd/asm: simplify golden test maintenance
Instead of two parallel files that look almost identical,
mark the expected differences in the original file.
The annotations being added here keep the tests passing,
but they also make clear a number of printing or parsing
errors that were not as easily seen when the data was
split across two files.
Fix a few diagnostic problems in cmd/internal/obj as well.
Mikio Hara [Sat, 23 Jan 2016 04:28:14 +0000 (13:28 +0900)]
net: enable TestLookupDotsWithRemoteSource on builders
Change-Id: I2609660b10a16ec2a256fc9c8e046ba4ae67963f
Reviewed-on: https://go-review.googlesource.com/18880 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Dominik Honnef [Sat, 23 Jan 2016 03:57:21 +0000 (04:57 +0100)]
doc: missing words and letters in release notes
Change-Id: Ica7f2a000eb1d89d5b02cb8c6f1596ddc04bfb26
Reviewed-on: https://go-review.googlesource.com/18890 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Russ Cox [Thu, 14 Jan 2016 01:14:03 +0000 (20:14 -0500)]
unsafe: document valid uses of Pointer
Add docs for valid uses of Pointer.
Then document change made for #13372 in CL 18584.
Fixes #8994.
Change-Id: Ifba71e5aeafd11f684aed0b7ddacf3c8ec07c580
Reviewed-on: https://go-review.googlesource.com/18640 Reviewed-by: Alan Donovan <adonovan@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Rick Hudson <rlh@golang.org>
Robert Griesemer [Fri, 22 Jan 2016 00:48:14 +0000 (16:48 -0800)]
cmd/compile: update vendored copy of math/big
- obtained by running sh vendor.bash
- contains updated tests and some bug fixes for Montgomery mult.
(not used by compiler)
- for consistency of math/big versions only
Ian Lance Taylor [Thu, 21 Jan 2016 20:43:34 +0000 (12:43 -0800)]
runtime: save context value in NetBSD sigtramp
On NetBSD a signal handler returns to the kernel by calling the
setcontext system call with the context passed to the signal handler.
The implementation of runtime·sigreturn_tramp for amd64, copied from the
NetBSD libc, expects that context address to be in r15. That works in
the NetBSD libc because r15 is preserved across the call to the signal
handler. It fails in the Go library because r15 is not preserved.
There are various ways to fix this; this one uses the simple approach,
essentially identical to the one in the NetBSD libc, of preserving r15
across the signal handler proper.
Looking at the code for 386 and arm suggests that they are OK. However,
I have not actually tested them.
Update #14052.
Change-Id: I2b516b1d05fe5d3b8911e65ca761d621dc37fa1b
Reviewed-on: https://go-review.googlesource.com/18815
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Ian Lance Taylor [Thu, 21 Jan 2016 20:38:05 +0000 (12:38 -0800)]
runtime: on NetBSD and DragonFly drop signal stack in new thread
On NetBSD and DragonFly a newly created thread inherits the signal stack
of the creating thread. This breaks horribly if both threads get a
signal at the same time. Fix this by dropping the signal stack in the
newly created thread. The right signal stack will then get installed
later.
Note that cgo code that calls pthread_create will have the wrong,
duplicated, signal stack in the newly created thread. I don't see any
way to fix that in Go. People using cgo to call pthread_create will
have to be aware of the problem.
Tim Ebringer [Mon, 18 Jan 2016 10:33:25 +0000 (21:33 +1100)]
net: improve netsh usage in Windows unit tests
The TestInterfaceAddrsWithNetsh Windows unit test parses and compares the
output of the "netsh" command against more low level Windows API calls. In
at least two cases, some quirks of netsh cause these comparisons to fail.
One example appears to be wi-fi adapters. After a reboot, before it has
been allowed to connect to a network, netsh for IPv4 will not show an
address, whereas netsh for IPv6 will. If the interface is allowed to
connect, and then disconnected, netsh for IPv4 now shows an address and
the test will pass.
The fix is to not compare netsh output if the interface is down.
A related issue is that the IPv6 version of "netsh" can return an
IPv4-embedded IPv6 address where the IPv4 component of the address
is in decimal form, whilst the test is expecting hexadecimal form.
For example, output might be:
Address fe80::5efe:192.168.1.7%6 Parameters
...
Whilst this is valid notation, the fix is to recognise this format in the
"netsh" output and re-parse the address into the all-hexadecimal
representation that the test is expecting.
Fixes #13981
Change-Id: Ie8366673f4d43d07bad80d6d5d1d6e33f654b6cc
Reviewed-on: https://go-review.googlesource.com/18711 Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Adam Langley [Tue, 19 Jan 2016 16:27:10 +0000 (08:27 -0800)]
crypto/tls: note in comment that Certificate.Leaf is nil after parsing.
LoadX509KeyPair and X509KeyPair don't retain the parsed form of
certificates in their return value because it's generally not needed.
This change makes that clear in the comment.
See https://groups.google.com/d/msg/golang-dev/VResvFj2vF8/Wt6WkVT2AwAJ
Olivier Poitrey [Thu, 21 Jan 2016 06:53:50 +0000 (22:53 -0800)]
net/http: make Client propagate Request.Cancel over redirected requests
On HTTP redirect, the HTTP client creates a new request and don't copy
over the Cancel channel. This prevents any redirected request from being
cancelled.
Michael Hudson-Doyle [Wed, 20 Jan 2016 02:31:26 +0000 (15:31 +1300)]
cmd/link: allow symbols from .a files to override those from .so files
https://golang.org/s/execmodes defines rules for how multiple codes of a go
package work when they end up in the address space of a single process, but
currently the linker blows up in this situation. Fix that by loading all .a
files before any .so files and ignoring duplicate symbols found when loading
shared libraries.
I know this is very very late for 1.6 but at least it should clearly not have
any effect when shared libraries are not in use.
Change-Id: I512ac912937e7502ff58eb5628b658ecce3c38e5
Reviewed-on: https://go-review.googlesource.com/18714 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Michael Hudson-Doyle [Tue, 19 Jan 2016 03:27:14 +0000 (16:27 +1300)]
runtime/race: fix test so it compiles
I'm not sure what the convert function was intended to be.
Fixes #14011
Change-Id: I29d905bc1827936b9433b20b13b7a0b0ac5f502e
Reviewed-on: https://go-review.googlesource.com/18712 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
OneOfOne [Fri, 15 Jan 2016 17:24:44 +0000 (19:24 +0200)]
cmd/link: fix elf64phdr to allow using upx (and other broken ELF loaders).
The linker already applies the fix for elf32, so this just extends it to elf64.
Inspired by https://github.com/pwaller/goupx
Fixes #13974
Change-Id: I65d92b5be9590657060a0e8e80ff5b86ba40017f
Reviewed-on: https://go-review.googlesource.com/18690 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Brad Fitzpatrick [Mon, 18 Jan 2016 19:43:32 +0000 (11:43 -0800)]
net/http: panic on bogus use of CloseNotifier or Hijacker
Fixes #14001
Change-Id: I6f9bc3028345081758d8f537c3aaddb2e254e69e
Reviewed-on: https://go-review.googlesource.com/18708 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Mikio Hara [Sun, 17 Jan 2016 00:04:58 +0000 (09:04 +0900)]
net: disable TestInterfaceAddrsWithNetsh on windows
Updates #13981.
Change-Id: Id8f3cd56a81a7a993cea5c757e619407da491fed
Reviewed-on: https://go-review.googlesource.com/18710 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Austin Clements [Fri, 15 Jan 2016 18:28:41 +0000 (13:28 -0500)]
runtime: fix sleep/wakeup race for GC assists
GC assists check gcBlackenEnabled under the assist queue lock to avoid
going to sleep after gcWakeAllAssists has already woken all assists.
However, currently we clear gcBlackenEnabled shortly *after* waking
all assists, which opens a window where this exact race can happen.
Fix this by clearing gcBlackenEnabled before waking blocked assists.
However, it's unlikely this actually matters because the world is
stopped between waking assists and clearing gcBlackenEnabled and there
aren't any obvious allocations during this window, so I don't think an
assist could actually slip in to this race window.
Mikio Hara [Fri, 15 Jan 2016 07:37:47 +0000 (16:37 +0900)]
runtime: readjust signal code for dragonfly-2.6 and above
Also adds missing nosplit to unminit.
Fixes #13964.
Change-Id: I07d93a8c872a255a89f91f808b66c889f0a6a69c
Reviewed-on: https://go-review.googlesource.com/18658 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Brad Fitzpatrick [Fri, 15 Jan 2016 00:29:24 +0000 (16:29 -0800)]
net/http: update bundled http2
If a user starts two HTTP requests when no http2 connection is
available, both end up creating new TCP connections, since the
server's protocol (h1 or h2) isn't yet known. Once it turns out that
the server supports h2, one of the connections is useless. Previously
we kept upgrading both TLS connections to h2 (SETTINGS frame exchange,
etc). Now the unnecessary connections are closed instead, before the
h2 preface/SETTINGS.
Updates x/net/http2 to git rev a8e212f3d for https://golang.org/cl/18675
This CL contains the tests for https://golang.org/cl/18675
Semi-related change noticed while writing the tests: now that we have
TLSNextProto in Go 1.6, which consults the TLS
ConnectionState.NegotiatedProtocol, we have to gurantee that the TLS
handshake has been done before we look at the ConnectionState. So add
that check after the DialTLS hook. (we never documented that users
have to call Handshake, so do it for them, now that it matters)
Austin Clements [Thu, 14 Jan 2016 21:43:40 +0000 (16:43 -0500)]
runtime: use at least "system" traceback level for runtime tests
While the default behavior of eliding runtime frames from tracebacks
usually makes sense, this is not the case when you're trying to test
the runtime itself. Fix this by forcing the traceback level to at
least "system" in the runtime tests.
This will specifically help with debugging issue #13645, which has
proven remarkably resistant to reproduction outside of the build
dashboard itself.
Ian Lance Taylor [Thu, 14 Jan 2016 17:10:57 +0000 (09:10 -0800)]
runtime: remove erroneous go:noescape declaration
Change-Id: I6b1dc789e54a385c958961e7ba16bfd9d0f3b313
Reviewed-on: https://go-review.googlesource.com/18629 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Ian Lance Taylor [Tue, 12 Jan 2016 23:34:03 +0000 (15:34 -0800)]
runtime: minimize time between lockextra/unlockextra
This doesn't fix a bug, but may improve performance in programs that
have many concurrent calls from C to Go. The old code made several
system calls between lockextra and unlockextra. That could be happening
while another thread is spinning acquiring lockextra. This changes the
code to not make any system calls while holding the lock.
Austin Clements [Wed, 13 Jan 2016 20:14:26 +0000 (15:14 -0500)]
runtime: fix several issues in TestFutexsleep
TestFutexsleep is supposed to clean up before returning by waking up
the goroutines it started and left blocked in futex sleeps. However,
it currently fails at this in several ways:
1. Both the sleep and wakeup are done on the address of tt.mtx, but in
both cases tt is a *local copy* of the futexsleepTest created by a
loop, so the sleep and wakeup happen on completely different
addresses. Fix this by making them both use the address of the
global tt.mtx.
2. If the sleep happens after the wakeup (not likely, but not
impossible), it won't wake up. Fix this by using the futex protocol
properly: sleep if the mutex's value is 0, and set the mutex's
value to non-zero before doing the wakeup.
3. If TestFutexsleep runs more than once, channels and mutex values
left over from the first run will interfere with later runs. Fix
this by clearing the mutex value and creating a new channel for
each test and waiting for goroutines to finish before returning
(lest they send their completion to the channel for the next run).
As an added bonus, this test now actually tests that futex
sleep/wakeup work. Previously this test would have been satisfied if
futexsleep was an infinite loop and futexwakeup was a no-op.
Change-Id: I1cbc6871cc9dcb8f4601b3621913bec2b79b0fc3
Reviewed-on: https://go-review.googlesource.com/18617 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Austin Clements [Fri, 8 Jan 2016 21:25:29 +0000 (16:25 -0500)]
debug/dwarf: fix nil pointer dereference in cyclic type structures
Currently readType simultaneously constructs a type graph and resolves
the sizes of the types. However, these two operations are
fundamentally at odds: the order we parse a cyclic structure in may be
different than the order we need to resolve type sizes in. As a
result, it's possible that when readType attempts to resolve the size
of a typedef, it may dereference a nil Type field of another typedef
retrieved from the type cache that's only partially constructed.
To fix this, we delay resolving typedef sizes until the end of the
readType recursion, when the full type graph is constructed.
Russ Cox [Tue, 5 Jan 2016 14:27:40 +0000 (09:27 -0500)]
cmd/internal/obj: separate code layout from object writing
This will allow the compiler to crunch Prog lists down to code as each
function is compiled, instead of waiting until the end, which should
reduce the working set of the compiler. But not until Go 1.7.
This also makes it easier to write some machine code output tests
for the assembler, which is why it's being done now.
For #13822.
Change-Id: I0811123bc6e5717cebb8948f9cea18e1b9baf6f7
Reviewed-on: https://go-review.googlesource.com/18311 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Russ Cox [Wed, 13 Jan 2016 05:46:28 +0000 (00:46 -0500)]
cmd/compile: recognize Syscall-like functions for liveness analysis
Consider this code:
func f(*int)
func g() {
p := new(int)
f(p)
}
where f is an assembly function.
In general liveness analysis assumes that during the call to f, p is dead
in this frame. If f has retained p, p will be found alive in f's frame and keep
the new(int) from being garbage collected. This is all correct and works.
We use the Go func declaration for f to give the assembly function
liveness information (the arguments are assumed live for the entire call).
Here syscall.Syscall is taking the place of f, but because its arguments
are uintptr, the liveness analysis and the garbage collector ignore them.
Since p is no longer live in h once the call starts, if the garbage collector
scans the stack while the system call is blocked, it will find no reference
to the new(int) and reclaim it. If the kernel is going to write to *p once
the call finishes, reclaiming the memory is a mistake.
We can't change the arguments or the liveness information for
syscall.Syscall itself, both for compatibility and because sometimes the
arguments really are integers, and the garbage collector will get quite upset
if it finds an integer where it expects a pointer. The problem is that
these arguments are fundamentally untyped.
The solution we have taken in the syscall package's wrappers in past
releases is to insert a call to a dummy function named "use", to make
it look like the argument is live during the call to syscall.Syscall:
Keeping p alive during the call means that if the garbage collector
scans the stack during the system call now, it will find the reference to p.
Unfortunately, this approach is not available to users outside syscall,
because 'use' is unexported, and people also have to realize they need
to use it and do so. There is much existing code using syscall.Syscall
without a 'use'-like function. That code will fail very occasionally in
mysterious ways (see #13372).
This CL fixes all that existing code by making the compiler do the right
thing automatically, without any code modifications. That is, it takes h1
above, which is incorrect code today, and makes it correct code.
Specifically, if the compiler sees a foreign func definition (one
without a body) that has uintptr arguments, it marks those arguments
as "unsafe uintptrs". If it later sees the function being called
with uintptr(unsafe.Pointer(x)) as an argument, it arranges to mark x
as having escaped, and it makes sure to hold x in a live temporary
variable until the call returns, so that the garbage collector cannot
reclaim whatever heap memory x points to.
For now I am leaving the explicit calls to use in package syscall,
but they can be removed early in a future cycle (likely Go 1.7).
The rule has no effect on escape analysis, only on liveness analysis.
Fixes #13372.
Change-Id: I2addb83f70d08db08c64d394f9d06ff0a063c500
Reviewed-on: https://go-review.googlesource.com/18584 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Robert Griesemer [Wed, 13 Jan 2016 18:52:56 +0000 (10:52 -0800)]
go/importer: fix field/method package for binary importer
This is the equivalent of https://golang.org/cl/18549 for
the binary importer (which is usually not used because by
default the gc compiler produces the traditional textual
export format).
For #13898.
Change-Id: Idb6b515f2ee49e6d0362c71846994b0bd4dae8f7
Reviewed-on: https://go-review.googlesource.com/18598 Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Griesemer <gri@golang.org>
Robert Griesemer [Wed, 13 Jan 2016 18:41:37 +0000 (10:41 -0800)]
go/importer: revert incorrect change that slipped in prior CL
The package of anonymous fields is the package in which they were
declared, not the package of the anonymous field's type. Was correct
before and incorrectly changed with https://golang.org/cl/18549.
Change-Id: I9fd5bfbe9d0498c8733b6ca7b134a85defe16113
Reviewed-on: https://go-review.googlesource.com/18596 Reviewed-by: Alan Donovan <adonovan@google.com>
Russ Cox [Wed, 13 Jan 2016 14:59:16 +0000 (09:59 -0500)]
cmd/link: add LC_VERSION_MIN_MACOSX to linkmode=internal OS X binaries
This makes lldb willing to debug them.
The minimum version is hard-coded at OS X 10.7,
because that is the minimum that Go requires.
For more control over the version, users can
use linkmode=external and pass the relevant flags to the host linker.
Fixes #12941.
Change-Id: I20027be8aa034d07dd2a3326828f75170afe905f
Reviewed-on: https://go-review.googlesource.com/18588 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Russ Cox [Wed, 13 Jan 2016 17:23:44 +0000 (12:23 -0500)]
runtime: allow for C pointers between arena_start and arena_used in cgo check
Fixes #13928.
Change-Id: Ia04c6bdef5ae6924d03982682ee195048f8f387f
Reviewed-on: https://go-review.googlesource.com/18611 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Robert Griesemer [Wed, 13 Jan 2016 01:02:32 +0000 (17:02 -0800)]
go/importer: associate exported field and interface methods with correct package
In gc export data, exported struct field and interface method names appear
in unqualified form (i.e., w/o package name). The (gc)importer assumed that
unqualified exported names automatically belong to the package being imported.
This is not the case if the field or method belongs to a struct or interface
that was declared in another package and re-exported.
The issue becomes visible if a type T (say an interface with a method M)
is declared in a package A, indirectly re-exported by a package B (which
imports A), and then imported in C. If C imports both A and B, if A is
imported before B, T.M gets associated with the correct package A. If B
is imported before A, T.M appears to be exported by B (even though T itself
is correctly marked as coming from A). If T.M is imported again via the
import of A if gets dropped (as it should) because it was imported already.
The fix is to pass down the parent package when we parse imported types
so that the importer can use the correct package when creating fields
and methods.
Fixes #13898.
Change-Id: I7ec2ee2dda15859c582b65db221c3841899776e1
Reviewed-on: https://go-review.googlesource.com/18549 Reviewed-by: Alan Donovan <adonovan@google.com>