Skip to content

Commit ff1a23f

Browse files
committed
Merge commit 'd5d4e82fb28f506701791f622ec0b03b984e41a5' into ios3
Conflicts: src/runtime/stack.h
2 parents 242b776 + d5d4e82 commit ff1a23f

File tree

145 files changed

+2253
-1925
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+2253
-1925
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Go is the work of hundreds of contributors. We appreciate your help!
1919
To contribute, please read the contribution guidelines:
2020
https://golang.org/doc/contribute.html
2121

22+
##### Please note that we do not use pull requests.
23+
2224
Unless otherwise noted, the Go source files are distributed
2325
under the BSD-style license found in the LICENSE file.
2426

api/next.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,5 +247,3 @@ pkg runtime (openbsd-amd64-cgo), const EWOULDBLOCK = 35
247247
pkg runtime (openbsd-amd64-cgo), const EWOULDBLOCK ideal-int
248248
pkg runtime (openbsd-amd64-cgo), const HW_NCPU = 3
249249
pkg runtime (openbsd-amd64-cgo), const HW_NCPU ideal-int
250-
pkg runtime, func GCcheckmarkdisable()
251-
pkg runtime, func GCcheckmarkenable()

doc/devel/release.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ <h2 id="go1.4">go1.4 (released 2014/12/10)</h2>
1919
Read the <a href="/doc/go1.4">Go 1.4 Release Notes</a> for more information.
2020
</p>
2121

22+
<h3 id="go1.4.minor">Minor revisions</h3>
23+
24+
<p>
25+
go1.4.1 (released 2015/01/15) includes bug fixes to the linker and the <code>log</code>, <code>syscall</code>, and <code>runtime</code> packages.
26+
See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.4.1">Go 1.4.1 milestone on our issue tracker</a> for details.
27+
</p>
28+
2229
<h2 id="go1.3">go1.3 (released 2014/06/18)</h2>
2330

2431
<p>

doc/go1.5.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ bufio: add Reader.Discard (https://golang.org/cl/2260)
44
crypto/cipher: clarify what will happen if len(src) != len(dst) for the Stream interface. (https://golang.org/cl/1754)
55
crypto/tls: change default minimum version to TLS 1.0. (https://golang.org/cl/1791)
66
encoding/base64: add unpadded encodings (https://golang.org/cl/1511)
7+
log: add global Output function (https://golang.org/cl/2686)
78
net/http: support for setting trailers from a server Handler (https://golang.org/cl/2157)
89
net/smtp: add TLSConnectionState accessor (https://golang.org/cl/2151)
910

11+
Tools:
12+
13+
cmd/vet: better validation of struct tags (https://golang.org/cl/2685)
1014

1115
Performance:
1216

1317
strconv: optimize decimal to string conversion (https://golang.org/cl/2105)
18+
math/big: faster assembly kernels for amd64 and 386 (https://golang.org/cl/2503, https://golang.org/cl/2560)
19+
math/big: faster "pure Go" kernels for platforms w/o assembly kernels (https://golang.org/cl/2480)

misc/android/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ Android
22
=======
33

44
For details on developing Go for Android, see the documentation in the
5-
go.mobile subrepository:
5+
mobile subrepository:
66

7-
https://code.google.com/p/go/source/browse/README?repo=mobile
7+
https://github.com/golang/mobile
88

99
To run the standard library tests, see androidtest.bash. Run it as
1010

misc/android/go_android_exec.go

Lines changed: 59 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ package main
99
import (
1010
"bytes"
1111
"fmt"
12+
"go/build"
1213
"io"
1314
"log"
1415
"os"
@@ -32,33 +33,36 @@ func run(args ...string) string {
3233
return buf.String()
3334
}
3435

36+
const (
37+
// Directory structure on the target device androidtest.bash assumes.
38+
deviceGoroot = "/data/local/tmp/goroot"
39+
deviceGopath = "/data/local/tmp/gopath"
40+
)
41+
3542
func main() {
3643
log.SetFlags(0)
3744
log.SetPrefix("go_android_exec: ")
3845

39-
// Determine thepackage by examining the current working
46+
// Prepare a temporary directory that will be cleaned up at the end.
47+
deviceGotmp := fmt.Sprintf("/data/local/tmp/%s-%d",
48+
filepath.Base(os.Args[1]), os.Getpid())
49+
run("shell", "mkdir", "-p", deviceGotmp)
50+
51+
// Determine the package by examining the current working
4052
// directory, which will look something like
41-
// "$GOROOT/src/mime/multipart". We extract everything
42-
// after the $GOROOT to run on the same relative directory
43-
// on the target device.
44-
//
45-
// TODO(crawshaw): Pick useful subdir when we are not
46-
// inside a GOROOT, e.g. we are in a GOPATH.
47-
cwd, err := os.Getwd()
48-
if err != nil {
49-
log.Fatal(err)
53+
// "$GOROOT/src/mime/multipart" or "$GOPATH/src/golang.org/x/mobile".
54+
// We extract everything after the $GOROOT or $GOPATH to run on the
55+
// same relative directory on the target device.
56+
subdir, inGoRoot := subdir()
57+
deviceCwd := filepath.Join(deviceGoroot, subdir)
58+
if !inGoRoot {
59+
deviceCwd = filepath.Join(deviceGopath, subdir)
5060
}
51-
subdir, err := filepath.Rel(runtime.GOROOT(), cwd)
52-
if err != nil {
53-
log.Fatal(err)
54-
}
55-
subdir = filepath.ToSlash(subdir)
5661

5762
// Binary names can conflict.
5863
// E.g. template.test from the {html,text}/template packages.
5964
binName := filepath.Base(os.Args[1])
60-
deviceGoroot := "/data/local/tmp/goroot"
61-
deviceBin := fmt.Sprintf("%s/%s-%d", deviceGoroot, binName, os.Getpid())
65+
deviceBin := fmt.Sprintf("%s/%s-%d", deviceGotmp, binName, os.Getpid())
6266

6367
// The push of the binary happens in parallel with other tests.
6468
// Unfortunately, a simultaneous call to adb shell hold open
@@ -71,19 +75,22 @@ func main() {
7175

7276
// The adb shell command will return an exit code of 0 regardless
7377
// of the command run. E.g.
74-
// $ adb shell false
75-
// $ echo $?
76-
// 0
78+
// $ adb shell false
79+
// $ echo $?
80+
// 0
7781
// https://code.google.com/p/android/issues/detail?id=3254
7882
// So we append the exitcode to the output and parse it from there.
7983
const exitstr = "exitcode="
80-
cmd := `export TMPDIR="/data/local/tmp"` +
84+
cmd := `export TMPDIR="` + deviceGotmp + `"` +
8185
`; export GOROOT="` + deviceGoroot + `"` +
82-
`; cd "$GOROOT/` + subdir + `"` +
86+
`; export GOPATH="` + deviceGopath + `"` +
87+
`; cd "` + deviceCwd + `"` +
8388
"; '" + deviceBin + "' " + strings.Join(os.Args[2:], " ") +
8489
"; echo -n " + exitstr + "$?"
8590
output := run("shell", cmd)
86-
run("shell", "rm '"+deviceBin+"'") // cleanup
91+
92+
run("shell", "rm", "-rf", deviceGotmp) // Clean up.
93+
8794
output = output[strings.LastIndex(output, "\n")+1:]
8895
if !strings.HasPrefix(output, exitstr) {
8996
log.Fatalf("no exit code: %q", output)
@@ -94,3 +101,32 @@ func main() {
94101
}
95102
os.Exit(code)
96103
}
104+
105+
// subdir determines the package based on the current working directory,
106+
// and returns the path to the package source relative to $GOROOT (or $GOPATH).
107+
func subdir() (pkgpath string, underGoRoot bool) {
108+
cwd, err := os.Getwd()
109+
if err != nil {
110+
log.Fatal(err)
111+
}
112+
if root := runtime.GOROOT(); strings.HasPrefix(cwd, root) {
113+
subdir, err := filepath.Rel(root, cwd)
114+
if err != nil {
115+
log.Fatal(err)
116+
}
117+
return subdir, true
118+
}
119+
120+
for _, p := range filepath.SplitList(build.Default.GOPATH) {
121+
if !strings.HasPrefix(cwd, p) {
122+
continue
123+
}
124+
subdir, err := filepath.Rel(p, cwd)
125+
if err == nil {
126+
return subdir, false
127+
}
128+
}
129+
log.Fatalf("the current path %q is not in either GOROOT(%q) or GOPATH(%q)",
130+
cwd, runtime.GOROOT(), build.Default.GOPATH)
131+
return "", false
132+
}

misc/cgo/test/cgo_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,6 @@ func Test8811(t *testing.T) { test8811(t) }
6363
func TestReturnAfterGrow(t *testing.T) { testReturnAfterGrow(t) }
6464
func TestReturnAfterGrowFromGo(t *testing.T) { testReturnAfterGrowFromGo(t) }
6565
func Test9026(t *testing.T) { test9026(t) }
66+
func Test9557(t *testing.T) { test9557(t) }
6667

6768
func BenchmarkCgoCall(b *testing.B) { benchCgoCall(b) }

misc/cgo/test/issue7234_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import "testing"
1414

1515
var v7234 = [...]string{"runtime/cgo"}
1616

17-
func TestIssue7234(t *testing.T) {
17+
func Test7234(t *testing.T) {
1818
if v7234[0] != "runtime/cgo" {
1919
t.Errorf("bad string constant %q", v7234[0])
2020
}

misc/cgo/test/issue9557.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright 2015 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
// cgo rewrote C.var to *_Cvar_var, but left
6+
// C.var.field as _Cvar.var.field. It now rewrites
7+
// the latter as (*_Cvar_var).field.
8+
// See https://golang.org/issue/9557.
9+
10+
package cgotest
11+
12+
// struct issue9557_t {
13+
// int a;
14+
// } test9557bar = { 42 };
15+
//
16+
// struct issue9557_t *issue9557foo = &test9557bar;
17+
import "C"
18+
import "testing"
19+
20+
func test9557(t *testing.T) {
21+
// implicitly dereference a Go variable
22+
foo := C.issue9557foo
23+
if v := foo.a; v != 42 {
24+
t.Fatalf("foo.a expected 42, but got %d", v)
25+
}
26+
27+
// explicitly dereference a C variable
28+
if v := (*C.issue9557foo).a; v != 42 {
29+
t.Fatalf("(*C.issue9557foo).a expected 42, but is %d", v)
30+
}
31+
32+
// implicitly dereference a C variable
33+
if v := C.issue9557foo.a; v != 42 {
34+
t.Fatalf("C.issue9557foo.a expected 42, but is %d", v)
35+
}
36+
}

misc/cgo/testso/test.bash

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55

66
set -e
77

8+
if [ "$(uname -m)" == ppc64 -o "$(uname -m)" == ppc64le ]; then
9+
# External linking not implemented on ppc64
10+
echo "skipping test on ppc64 (issue #8912)"
11+
exit
12+
fi
13+
814
args=
915
dyld_envvar=LD_LIBRARY_PATH
1016
ext=so

0 commit comments

Comments
 (0)