diff options
-rw-r--r-- | recipes-devtools/go-cross/go-1.6.inc | 19 | ||||
-rw-r--r-- | recipes-devtools/go-cross/go-1.6/armhf-elf-header.patch | 19 | ||||
-rw-r--r-- | recipes-devtools/go-cross/go-1.6/fix-cc-handling.patch | 46 | ||||
-rw-r--r-- | recipes-devtools/go-cross/go-1.6/fix-target-cc-for-build.patch | 13 | ||||
-rw-r--r-- | recipes-devtools/go-cross/go-1.6/gotooldir.patch | 26 | ||||
-rw-r--r-- | recipes-devtools/go-cross/go-1.6/split-host-and-target-build.patch | 58 | ||||
-rw-r--r-- | recipes-devtools/go-cross/go-1.6/syslog.patch | 57 | ||||
-rw-r--r-- | recipes-devtools/go-cross/go-cross_1.6.bb | 2 |
8 files changed, 240 insertions, 0 deletions
diff --git a/recipes-devtools/go-cross/go-1.6.inc b/recipes-devtools/go-cross/go-1.6.inc new file mode 100644 index 00000000..7a57eaf0 --- /dev/null +++ b/recipes-devtools/go-cross/go-1.6.inc | |||
@@ -0,0 +1,19 @@ | |||
1 | require go-common.inc | ||
2 | |||
3 | PV = "1.6.2" | ||
4 | GO_BASEVERSION = "1.6" | ||
5 | FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:" | ||
6 | |||
7 | |||
8 | SRC_URI += "\ | ||
9 | file://armhf-elf-header.patch \ | ||
10 | file://syslog.patch \ | ||
11 | file://fix-target-cc-for-build.patch \ | ||
12 | file://fix-cc-handling.patch \ | ||
13 | file://split-host-and-target-build.patch \ | ||
14 | file://gotooldir.patch \ | ||
15 | " | ||
16 | |||
17 | LIC_FILES_CHKSUM = "file://LICENSE;md5=591778525c869cdde0ab5a1bf283cd81" | ||
18 | SRC_URI[md5sum] = "d1b50fa98d9a71eeee829051411e6207" | ||
19 | SRC_URI[sha256sum] = "787b0b750d037016a30c6ed05a8a70a91b2e9db4bd9b1a2453aa502a63f1bccc" | ||
diff --git a/recipes-devtools/go-cross/go-1.6/armhf-elf-header.patch b/recipes-devtools/go-cross/go-1.6/armhf-elf-header.patch new file mode 100644 index 00000000..6113138c --- /dev/null +++ b/recipes-devtools/go-cross/go-1.6/armhf-elf-header.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | Index: go/src/cmd/link/internal/ld/elf.go | ||
2 | =================================================================== | ||
3 | --- go.orig/src/cmd/link/internal/ld/elf.go | ||
4 | +++ go/src/cmd/link/internal/ld/elf.go | ||
5 | @@ -827,7 +827,13 @@ | ||
6 | // 32-bit architectures | ||
7 | case '5': | ||
8 | // we use EABI on both linux/arm and freebsd/arm. | ||
9 | - if HEADTYPE == obj.Hlinux || HEADTYPE == obj.Hfreebsd { | ||
10 | + if HEADTYPE == obj.Hlinux { | ||
11 | + if Ctxt.Goarm == 7 { | ||
12 | + ehdr.flags = 0x5000402 // has entry point, Version5 EABI, hard float | ||
13 | + } else { | ||
14 | + ehdr.flags = 0x5000202 // has entry point, Version5 EABI, soft float | ||
15 | + } | ||
16 | + } else if HEADTYPE == obj.Hfreebsd { | ||
17 | // We set a value here that makes no indication of which | ||
18 | // float ABI the object uses, because this is information | ||
19 | // used by the dynamic linker to compare executables and | ||
diff --git a/recipes-devtools/go-cross/go-1.6/fix-cc-handling.patch b/recipes-devtools/go-cross/go-1.6/fix-cc-handling.patch new file mode 100644 index 00000000..85770a93 --- /dev/null +++ b/recipes-devtools/go-cross/go-1.6/fix-cc-handling.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | Index: go/src/cmd/go/build.go | ||
2 | =================================================================== | ||
3 | --- go.orig/src/cmd/go/build.go 2015-07-29 14:48:40.323185807 -0700 | ||
4 | +++ go/src/cmd/go/build.go 2015-07-30 07:37:40.529818586 -0700 | ||
5 | @@ -2805,12 +2805,24 @@ | ||
6 | return b.ccompilerCmd("CC", defaultCC, objdir) | ||
7 | } | ||
8 | |||
9 | +// gccCmd returns a gcc command line prefix | ||
10 | +// defaultCC is defined in zdefaultcc.go, written by cmd/dist. | ||
11 | +func (b *builder) gccCmdForReal() []string { | ||
12 | + return envList("CC", defaultCC) | ||
13 | +} | ||
14 | + | ||
15 | // gxxCmd returns a g++ command line prefix | ||
16 | // defaultCXX is defined in zdefaultcc.go, written by cmd/dist. | ||
17 | func (b *builder) gxxCmd(objdir string) []string { | ||
18 | return b.ccompilerCmd("CXX", defaultCXX, objdir) | ||
19 | } | ||
20 | |||
21 | +// gxxCmd returns a g++ command line prefix | ||
22 | +// defaultCXX is defined in zdefaultcc.go, written by cmd/dist. | ||
23 | +func (b *builder) gxxCmdForReal() []string { | ||
24 | + return envList("CXX", defaultCXX) | ||
25 | +} | ||
26 | + | ||
27 | // ccompilerCmd returns a command line prefix for the given environment | ||
28 | // variable and using the default command when the variable is empty. | ||
29 | func (b *builder) ccompilerCmd(envvar, defcmd, objdir string) []string { | ||
30 | Index: go/src/cmd/go/env.go | ||
31 | =================================================================== | ||
32 | --- go.orig/src/cmd/go/env.go 2015-07-29 14:48:40.323185807 -0700 | ||
33 | +++ go/src/cmd/go/env.go 2015-07-30 07:40:54.461655721 -0700 | ||
34 | @@ -52,10 +52,9 @@ | ||
35 | |||
36 | if goos != "plan9" { | ||
37 | cmd := b.gccCmd(".") | ||
38 | - env = append(env, envVar{"CC", cmd[0]}) | ||
39 | + env = append(env, envVar{"CC", strings.Join(b.gccCmdForReal(), " ")}) | ||
40 | env = append(env, envVar{"GOGCCFLAGS", strings.Join(cmd[3:], " ")}) | ||
41 | - cmd = b.gxxCmd(".") | ||
42 | - env = append(env, envVar{"CXX", cmd[0]}) | ||
43 | + env = append(env, envVar{"CXX", strings.Join(b.gxxCmdForReal(), " ")}) | ||
44 | } | ||
45 | |||
46 | if buildContext.CgoEnabled { | ||
diff --git a/recipes-devtools/go-cross/go-1.6/fix-target-cc-for-build.patch b/recipes-devtools/go-cross/go-1.6/fix-target-cc-for-build.patch new file mode 100644 index 00000000..adfeb6b5 --- /dev/null +++ b/recipes-devtools/go-cross/go-1.6/fix-target-cc-for-build.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | Index: go/src/make.bash | ||
2 | =================================================================== | ||
3 | --- go.orig/src/make.bash 2015-07-29 13:28:11.334031696 -0700 | ||
4 | +++ go/src/make.bash 2015-07-29 13:36:55.814465630 -0700 | ||
5 | @@ -158,7 +158,7 @@ | ||
6 | fi | ||
7 | |||
8 | echo "##### Building packages and commands for $GOOS/$GOARCH." | ||
9 | -CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd | ||
10 | +CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd | ||
11 | echo | ||
12 | |||
13 | rm -f "$GOTOOLDIR"/go_bootstrap | ||
diff --git a/recipes-devtools/go-cross/go-1.6/gotooldir.patch b/recipes-devtools/go-cross/go-1.6/gotooldir.patch new file mode 100644 index 00000000..473a3280 --- /dev/null +++ b/recipes-devtools/go-cross/go-1.6/gotooldir.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Index: go/src/go/build/build.go | ||
2 | =================================================================== | ||
3 | --- go.orig/src/go/build/build.go | ||
4 | +++ go/src/go/build/build.go | ||
5 | @@ -1388,7 +1388,7 @@ func init() { | ||
6 | } | ||
7 | |||
8 | // ToolDir is the directory containing build tools. | ||
9 | -var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) | ||
10 | +var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)) | ||
11 | |||
12 | // IsLocalImport reports whether the import path is | ||
13 | // a local import path, like ".", "..", "./foo", or "../foo". | ||
14 | Index: go/src/cmd/go/build.go | ||
15 | =================================================================== | ||
16 | --- go.orig/src/cmd/go/build.go | ||
17 | +++ go/src/cmd/go/build.go | ||
18 | @@ -1312,7 +1312,7 @@ func (b *builder) build(a *action) (err | ||
19 | } | ||
20 | |||
21 | cgoExe := tool("cgo") | ||
22 | - if a.cgo != nil && a.cgo.target != "" { | ||
23 | + if a.cgo != nil && a.cgo.target != "" && os.Getenv("GOTOOLDIR") == "" { | ||
24 | cgoExe = a.cgo.target | ||
25 | } | ||
26 | outGo, outObj, err := b.cgo(a.p, cgoExe, obj, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, cxxfiles, a.p.MFiles) | ||
diff --git a/recipes-devtools/go-cross/go-1.6/split-host-and-target-build.patch b/recipes-devtools/go-cross/go-1.6/split-host-and-target-build.patch new file mode 100644 index 00000000..85fb240a --- /dev/null +++ b/recipes-devtools/go-cross/go-1.6/split-host-and-target-build.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | Index: go/src/make.bash | ||
2 | =================================================================== | ||
3 | --- go.orig/src/make.bash | ||
4 | +++ go/src/make.bash | ||
5 | @@ -143,12 +143,23 @@ if [ "$1" = "--no-clean" ]; then | ||
6 | buildall="" | ||
7 | shift | ||
8 | fi | ||
9 | -./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap | ||
10 | -# Delay move of dist tool to now, because bootstrap may clear tool directory. | ||
11 | -mv cmd/dist/dist "$GOTOOLDIR"/dist | ||
12 | -echo | ||
13 | |||
14 | -if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then | ||
15 | +do_host_build="yes" | ||
16 | +do_target_build="yes" | ||
17 | +if [ "$1" = "--target-only" ]; then | ||
18 | + do_host_build="no" | ||
19 | + shift | ||
20 | +elif [ "$1" = "--host-only" ]; then | ||
21 | + do_target_build="no" | ||
22 | + shift | ||
23 | +fi | ||
24 | + | ||
25 | +if [ "$do_host_build" = "yes" ]; then | ||
26 | + ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap | ||
27 | + # Delay move of dist tool to now, because bootstrap may clear tool directory. | ||
28 | + mv cmd/dist/dist "$GOTOOLDIR"/dist | ||
29 | + echo | ||
30 | + | ||
31 | echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH." | ||
32 | # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however, | ||
33 | # use the host compiler, CC, from `cmd/dist/dist env` instead. | ||
34 | @@ -157,11 +168,20 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH | ||
35 | echo | ||
36 | fi | ||
37 | |||
38 | -echo "##### Building packages and commands for $GOOS/$GOARCH." | ||
39 | -CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd | ||
40 | -echo | ||
41 | +if [ "$do_target_build" = "yes" ]; then | ||
42 | + GO_INSTALL="${GO_TARGET_INSTALL:-std cmd}" | ||
43 | + echo "##### Building packages and commands for $GOOS/$GOARCH." | ||
44 | + if [ "$GOHOSTOS" = "$GOOS" -a "$GOHOSTARCH" = "$GOARCH" -a "$do_host_build" = "yes" ]; then | ||
45 | + rm -rf ./host-tools | ||
46 | + mkdir ./host-tools | ||
47 | + mv "$GOTOOLDIR"/* ./host-tools | ||
48 | + GOTOOLDIR="$PWD/host-tools" | ||
49 | + fi | ||
50 | + GOTOOLDIR="$GOTOOLDIR" CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v ${GO_INSTALL} | ||
51 | + echo | ||
52 | |||
53 | -rm -f "$GOTOOLDIR"/go_bootstrap | ||
54 | + rm -f "$GOTOOLDIR"/go_bootstrap | ||
55 | +fi | ||
56 | |||
57 | if [ "$1" != "--no-banner" ]; then | ||
58 | "$GOTOOLDIR"/dist banner | ||
diff --git a/recipes-devtools/go-cross/go-1.6/syslog.patch b/recipes-devtools/go-cross/go-1.6/syslog.patch new file mode 100644 index 00000000..ce82a4f2 --- /dev/null +++ b/recipes-devtools/go-cross/go-1.6/syslog.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | diff -r -u go/src/log/syslog/syslog.go /home/achang/GOCOPY/go/src/log/syslog/syslog.go | ||
2 | --- go/src/log/syslog/syslog.go 2013-11-28 13:38:28.000000000 -0800 | ||
3 | +++ /home/achang/GOCOPY/go/src/log/syslog/syslog.go 2014-10-03 11:44:37.710403200 -0700 | ||
4 | @@ -33,6 +33,9 @@ | ||
5 | const severityMask = 0x07 | ||
6 | const facilityMask = 0xf8 | ||
7 | |||
8 | +var writeTimeout = 1 * time.Second | ||
9 | +var connectTimeout = 1 * time.Second | ||
10 | + | ||
11 | const ( | ||
12 | // Severity. | ||
13 | |||
14 | @@ -100,6 +103,7 @@ | ||
15 | type serverConn interface { | ||
16 | writeString(p Priority, hostname, tag, s, nl string) error | ||
17 | close() error | ||
18 | + setWriteDeadline(t time.Time) error | ||
19 | } | ||
20 | |||
21 | type netConn struct { | ||
22 | @@ -273,7 +277,11 @@ | ||
23 | nl = "\n" | ||
24 | } | ||
25 | |||
26 | - err := w.conn.writeString(p, w.hostname, w.tag, msg, nl) | ||
27 | + err := w.conn.setWriteDeadline(time.Now().Add(writeTimeout)) | ||
28 | + if err != nil { | ||
29 | + return 0, err | ||
30 | + } | ||
31 | + err = w.conn.writeString(p, w.hostname, w.tag, msg, nl) | ||
32 | if err != nil { | ||
33 | return 0, err | ||
34 | } | ||
35 | @@ -305,6 +313,10 @@ | ||
36 | return n.conn.Close() | ||
37 | } | ||
38 | |||
39 | +func (n *netConn) setWriteDeadline(t time.Time) error { | ||
40 | + return n.conn.SetWriteDeadline(t) | ||
41 | +} | ||
42 | + | ||
43 | // NewLogger creates a log.Logger whose output is written to | ||
44 | // the system log service with the specified priority. The logFlag | ||
45 | // argument is the flag set passed through to log.New to create | ||
46 | diff -r -u go/src/log/syslog/syslog_unix.go /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go | ||
47 | --- go/src/log/syslog/syslog_unix.go 2013-11-28 13:38:28.000000000 -0800 | ||
48 | +++ /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go 2014-10-03 11:44:39.010403175 -0700 | ||
49 | @@ -19,7 +19,7 @@ | ||
50 | logPaths := []string{"/dev/log", "/var/run/syslog"} | ||
51 | for _, network := range logTypes { | ||
52 | for _, path := range logPaths { | ||
53 | - conn, err := net.Dial(network, path) | ||
54 | + conn, err := net.DialTimeout(network, path, connectTimeout) | ||
55 | if err != nil { | ||
56 | continue | ||
57 | } else { | ||
diff --git a/recipes-devtools/go-cross/go-cross_1.6.bb b/recipes-devtools/go-cross/go-cross_1.6.bb new file mode 100644 index 00000000..80b5a03f --- /dev/null +++ b/recipes-devtools/go-cross/go-cross_1.6.bb | |||
@@ -0,0 +1,2 @@ | |||
1 | require go-cross.inc | ||
2 | require go-${PV}.inc | ||