summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/go/go-1.8
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/go/go-1.8')
-rw-r--r--meta/recipes-devtools/go/go-1.8/0006-linker-add-soname-to-shareable-objects.patch44
-rw-r--r--meta/recipes-devtools/go/go-1.8/armhf-elf-header.patch23
-rw-r--r--meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch50
-rw-r--r--meta/recipes-devtools/go/go-1.8/fix-target-cc-for-build.patch17
-rw-r--r--meta/recipes-devtools/go/go-1.8/gotooldir.patch30
-rw-r--r--meta/recipes-devtools/go/go-1.8/make-goroot-precious.patch21
-rw-r--r--meta/recipes-devtools/go/go-1.8/set-gotooldir-during-bootstrap.patch22
-rw-r--r--meta/recipes-devtools/go/go-1.8/split-host-and-target-build.patch62
-rw-r--r--meta/recipes-devtools/go/go-1.8/syslog.patch62
9 files changed, 0 insertions, 331 deletions
diff --git a/meta/recipes-devtools/go/go-1.8/0006-linker-add-soname-to-shareable-objects.patch b/meta/recipes-devtools/go/go-1.8/0006-linker-add-soname-to-shareable-objects.patch
deleted file mode 100644
index 74e1f2459e..0000000000
--- a/meta/recipes-devtools/go/go-1.8/0006-linker-add-soname-to-shareable-objects.patch
+++ /dev/null
@@ -1,44 +0,0 @@
1From 81e9e322297d83f57f02548689c71859bfce10ee Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems>
3Date: Sun, 15 Jan 2017 05:24:49 -0800
4Subject: [PATCH 6/6] linker: add soname to shareable objects
5
6Shared library handling in OE builds works better when shared
7libraries are tagged with SONAMEs.
8
9Upstream-Status: Pending
10Signed-off-by: Matt Madison <matt@madison.systems>
11---
12 src/cmd/link/internal/ld/lib.go | 3 +++
13 1 file changed, 3 insertions(+)
14
15diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
16index 74d79d3..6d03005 100644
17--- a/src/cmd/link/internal/ld/lib.go
18+++ b/src/cmd/link/internal/ld/lib.go
19@@ -1040,12 +1040,14 @@ func (l *Link) hostlink() {
20 // Pass -z nodelete to mark the shared library as
21 // non-closeable: a dlclose will do nothing.
22 argv = append(argv, "-shared", "-Wl,-z,nodelete")
23+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
24 }
25 case BuildmodeShared:
26 if UseRelro() {
27 argv = append(argv, "-Wl,-z,relro")
28 }
29 argv = append(argv, "-shared")
30+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
31 case BuildmodePlugin:
32 if Headtype == obj.Hdarwin {
33 argv = append(argv, "-dynamiclib")
34@@ -1054,6 +1056,7 @@ func (l *Link) hostlink() {
35 argv = append(argv, "-Wl,-z,relro")
36 }
37 argv = append(argv, "-shared")
38+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
39 }
40 }
41
42--
432.7.4
44
diff --git a/meta/recipes-devtools/go/go-1.8/armhf-elf-header.patch b/meta/recipes-devtools/go/go-1.8/armhf-elf-header.patch
deleted file mode 100644
index 3508838e8b..0000000000
--- a/meta/recipes-devtools/go/go-1.8/armhf-elf-header.patch
+++ /dev/null
@@ -1,23 +0,0 @@
1Encode arm EABI ( hard/soft ) calling convention in ELF header
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Pending
5Index: go/src/cmd/link/internal/ld/elf.go
6===================================================================
7--- go.orig/src/cmd/link/internal/ld/elf.go
8+++ go/src/cmd/link/internal/ld/elf.go
9@@ -950,7 +950,13 @@ func Elfinit(ctxt *Link) {
10 case sys.ARM, sys.MIPS:
11 if SysArch.Family == sys.ARM {
12 // we use EABI on linux/arm, freebsd/arm, netbsd/arm.
13- if Headtype == obj.Hlinux || Headtype == obj.Hfreebsd || Headtype == obj.Hnetbsd {
14+ if Headtype == obj.Hlinux {
15+ if obj.GOARM == 7 {
16+ ehdr.flags = 0x5000402 // has entry point, Version5 EABI, hard float
17+ } else {
18+ ehdr.flags = 0x5000202 // has entry point, Version5 EABI, soft float
19+ }
20+ } else if Headtype == obj.Hfreebsd || Headtype == obj.Hnetbsd {
21 // We set a value here that makes no indication of which
22 // float ABI the object uses, because this is information
23 // used by the dynamic linker to compare executables and
diff --git a/meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch b/meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch
deleted file mode 100644
index dc9b811b2a..0000000000
--- a/meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch
+++ /dev/null
@@ -1,50 +0,0 @@
1Accept CC with multiple words in its name
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Pending
5Index: go/src/cmd/go/build.go
6===================================================================
7--- go.orig/src/cmd/go/build.go
8+++ go/src/cmd/go/build.go
9@@ -3100,12 +3100,24 @@ func (b *builder) gccCmd(objdir string)
10 return b.ccompilerCmd("CC", defaultCC, objdir)
11 }
12
13+// gccCmd returns a gcc command line prefix
14+// defaultCC is defined in zdefaultcc.go, written by cmd/dist.
15+func (b *builder) gccCmdForReal() []string {
16+ return envList("CC", defaultCC)
17+}
18+
19 // gxxCmd returns a g++ command line prefix
20 // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
21 func (b *builder) gxxCmd(objdir string) []string {
22 return b.ccompilerCmd("CXX", defaultCXX, objdir)
23 }
24
25+// gxxCmd returns a g++ command line prefix
26+// defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
27+func (b *builder) gxxCmdForReal() []string {
28+ return envList("CXX", defaultCXX)
29+}
30+
31 // gfortranCmd returns a gfortran command line prefix.
32 func (b *builder) gfortranCmd(objdir string) []string {
33 return b.ccompilerCmd("FC", "gfortran", objdir)
34Index: go/src/cmd/go/env.go
35===================================================================
36--- go.orig/src/cmd/go/env.go
37+++ go/src/cmd/go/env.go
38@@ -63,10 +63,9 @@ func mkEnv() []envVar {
39 }
40
41 cmd := b.gccCmd(".")
42- env = append(env, envVar{"CC", cmd[0]})
43+ env = append(env, envVar{"CC", strings.Join(b.gccCmdForReal(), " ")})
44 env = append(env, envVar{"GOGCCFLAGS", strings.Join(cmd[3:], " ")})
45- cmd = b.gxxCmd(".")
46- env = append(env, envVar{"CXX", cmd[0]})
47+ env = append(env, envVar{"CXX", strings.Join(b.gxxCmdForReal(), " ")})
48
49 if buildContext.CgoEnabled {
50 env = append(env, envVar{"CGO_ENABLED", "1"})
diff --git a/meta/recipes-devtools/go/go-1.8/fix-target-cc-for-build.patch b/meta/recipes-devtools/go/go-1.8/fix-target-cc-for-build.patch
deleted file mode 100644
index 2f6156ecd2..0000000000
--- a/meta/recipes-devtools/go/go-1.8/fix-target-cc-for-build.patch
+++ /dev/null
@@ -1,17 +0,0 @@
1Put Quotes around CC_FOR_TARGET since it can be mutliple words e.g. in OE
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Pending
5Index: go/src/make.bash
6===================================================================
7--- go.orig/src/make.bash 2015-07-29 13:28:11.334031696 -0700
8+++ go/src/make.bash 2015-07-29 13:36:55.814465630 -0700
9@@ -158,7 +158,7 @@
10 fi
11
12 echo "##### Building packages and commands for $GOOS/$GOARCH."
13-CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
14+CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
15 echo
16
17 rm -f "$GOTOOLDIR"/go_bootstrap
diff --git a/meta/recipes-devtools/go/go-1.8/gotooldir.patch b/meta/recipes-devtools/go/go-1.8/gotooldir.patch
deleted file mode 100644
index 94670259f2..0000000000
--- a/meta/recipes-devtools/go/go-1.8/gotooldir.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1Define tooldir in relation to GOTOOLDIR env var
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Pending
5Index: go/src/go/build/build.go
6===================================================================
7--- go.orig/src/go/build/build.go
8+++ go/src/go/build/build.go
9@@ -1388,7 +1388,7 @@ func init() {
10 }
11
12 // ToolDir is the directory containing build tools.
13-var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
14+var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH))
15
16 // IsLocalImport reports whether the import path is
17 // a local import path, like ".", "..", "./foo", or "../foo".
18Index: go/src/cmd/go/build.go
19===================================================================
20--- go.orig/src/cmd/go/build.go
21+++ go/src/cmd/go/build.go
22@@ -1312,7 +1312,7 @@ func (b *builder) build(a *action) (err
23 }
24
25 cgoExe := tool("cgo")
26- if a.cgo != nil && a.cgo.target != "" {
27+ if a.cgo != nil && a.cgo.target != "" && os.Getenv("GOTOOLDIR") == "" {
28 cgoExe = a.cgo.target
29 }
30 outGo, outObj, err := b.cgo(a.p, cgoExe, obj, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, cxxfiles, a.p.MFiles)
diff --git a/meta/recipes-devtools/go/go-1.8/make-goroot-precious.patch b/meta/recipes-devtools/go/go-1.8/make-goroot-precious.patch
deleted file mode 100644
index 28a7a34773..0000000000
--- a/meta/recipes-devtools/go/go-1.8/make-goroot-precious.patch
+++ /dev/null
@@ -1,21 +0,0 @@
1Prevent GOROOT-resident packages from being rebuilt
2
3Signed-off-by: Matt Madison <matt@madison.systems>
4Upstream-Status: Pending
5
6--- go.orig/src/cmd/go/pkg.go
7+++ go/src/cmd/go/pkg.go
8@@ -1496,6 +1496,13 @@ func isStale(p *Package) (bool, string)
9 return true, "build ID mismatch"
10 }
11
12+ // For OE builds, make anything in GOROOT non-stale,
13+ // to prevent a package build from overwriting the
14+ // build root.
15+ if p.Goroot && os.Getenv("GOROOT_OVERRIDE") != "1" {
16+ return false, "GOROOT-resident packages do not get rebuilt"
17+ }
18+
19 // Package is stale if a dependency is.
20 for _, p1 := range p.deps {
21 if p1.Stale {
diff --git a/meta/recipes-devtools/go/go-1.8/set-gotooldir-during-bootstrap.patch b/meta/recipes-devtools/go/go-1.8/set-gotooldir-during-bootstrap.patch
deleted file mode 100644
index 4b5e424d96..0000000000
--- a/meta/recipes-devtools/go/go-1.8/set-gotooldir-during-bootstrap.patch
+++ /dev/null
@@ -1,22 +0,0 @@
1Set GOTOOLDIR during bootstrap
2
3Signed-off-by: Matt Madison <matt@madison.systems>
4Upstream-Status: Pending
5
6Index: go/src/make.bash
7===================================================================
8--- go.orig/src/make.bash
9+++ go/src/make.bash
10@@ -172,10 +172,11 @@ if [ "$do_host_build" = "yes" ]; then
11 mv cmd/dist/dist "$GOTOOLDIR"/dist
12 echo
13
14+ GOTOOLDIR_BOOTSTRAP="${GOTOOLDIR_BOOTSTRAP:-$GOTOOLDIR}"
15 echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
16 # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
17 # use the host compiler, CC, from `cmd/dist/dist env` instead.
18- CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \
19+ CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH GOTOOLDIR="$GOTOOLDIR_BOOTSTRAP" \
20 "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
21 echo
22 fi
diff --git a/meta/recipes-devtools/go/go-1.8/split-host-and-target-build.patch b/meta/recipes-devtools/go/go-1.8/split-host-and-target-build.patch
deleted file mode 100644
index b0dd95bbe7..0000000000
--- a/meta/recipes-devtools/go/go-1.8/split-host-and-target-build.patch
+++ /dev/null
@@ -1,62 +0,0 @@
1Add new option --target-only to build target components
2Separates the host and target pieces of build
3
4Signed-off-by: Khem Raj <raj.khem@gmail.com>
5Upstream-Status: Pending
6Index: go/src/make.bash
7===================================================================
8--- go.orig/src/make.bash
9+++ go/src/make.bash
10@@ -154,13 +154,22 @@ if [ "$1" = "--no-clean" ]; then
11 buildall=""
12 shift
13 fi
14-./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
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-# Delay move of dist tool to now, because bootstrap may clear tool directory.
26-mv cmd/dist/dist "$GOTOOLDIR"/dist
27-echo
28+if [ "$do_host_build" = "yes" ]; then
29+ ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
30+ # Delay move of dist tool to now, because bootstrap may clear tool directory.
31+ mv cmd/dist/dist "$GOTOOLDIR"/dist
32+ echo
33
34-if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
35 echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
36 # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
37 # use the host compiler, CC, from `cmd/dist/dist env` instead.
38@@ -169,11 +178,20 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOH
39 echo
40 fi
41
42-echo "##### Building packages and commands for $GOOS/$GOARCH."
43-CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
44-echo
45+if [ "$do_target_build" = "yes" ]; then
46+ GO_INSTALL="${GO_TARGET_INSTALL:-std cmd}"
47+ echo "##### Building packages and commands for $GOOS/$GOARCH."
48+ if [ "$GOHOSTOS" = "$GOOS" -a "$GOHOSTARCH" = "$GOARCH" -a "$do_host_build" = "yes" ]; then
49+ rm -rf ./host-tools
50+ mkdir ./host-tools
51+ mv "$GOTOOLDIR"/* ./host-tools
52+ GOTOOLDIR="$PWD/host-tools"
53+ fi
54+ GOTOOLDIR="$GOTOOLDIR" CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v ${GO_INSTALL}
55+ echo
56
57-rm -f "$GOTOOLDIR"/go_bootstrap
58+ rm -f "$GOTOOLDIR"/go_bootstrap
59+fi
60
61 if [ "$1" != "--no-banner" ]; then
62 "$GOTOOLDIR"/dist banner
diff --git a/meta/recipes-devtools/go/go-1.8/syslog.patch b/meta/recipes-devtools/go/go-1.8/syslog.patch
deleted file mode 100644
index 29be06f1bd..0000000000
--- a/meta/recipes-devtools/go/go-1.8/syslog.patch
+++ /dev/null
@@ -1,62 +0,0 @@
1Add timeouts to logger
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Pending
5
6diff -r -u go/src/log/syslog/syslog.go /home/achang/GOCOPY/go/src/log/syslog/syslog.go
7--- go/src/log/syslog/syslog.go 2013-11-28 13:38:28.000000000 -0800
8+++ /home/achang/GOCOPY/go/src/log/syslog/syslog.go 2014-10-03 11:44:37.710403200 -0700
9@@ -33,6 +33,9 @@
10 const severityMask = 0x07
11 const facilityMask = 0xf8
12
13+var writeTimeout = 1 * time.Second
14+var connectTimeout = 1 * time.Second
15+
16 const (
17 // Severity.
18
19@@ -100,6 +103,7 @@
20 type serverConn interface {
21 writeString(p Priority, hostname, tag, s, nl string) error
22 close() error
23+ setWriteDeadline(t time.Time) error
24 }
25
26 type netConn struct {
27@@ -273,7 +277,11 @@
28 nl = "\n"
29 }
30
31- err := w.conn.writeString(p, w.hostname, w.tag, msg, nl)
32+ err := w.conn.setWriteDeadline(time.Now().Add(writeTimeout))
33+ if err != nil {
34+ return 0, err
35+ }
36+ err = w.conn.writeString(p, w.hostname, w.tag, msg, nl)
37 if err != nil {
38 return 0, err
39 }
40@@ -305,6 +313,10 @@
41 return n.conn.Close()
42 }
43
44+func (n *netConn) setWriteDeadline(t time.Time) error {
45+ return n.conn.SetWriteDeadline(t)
46+}
47+
48 // NewLogger creates a log.Logger whose output is written to
49 // the system log service with the specified priority. The logFlag
50 // argument is the flag set passed through to log.New to create
51diff -r -u go/src/log/syslog/syslog_unix.go /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go
52--- go/src/log/syslog/syslog_unix.go 2013-11-28 13:38:28.000000000 -0800
53+++ /home/achang/GOCOPY/go/src/log/syslog/syslog_unix.go 2014-10-03 11:44:39.010403175 -0700
54@@ -19,7 +19,7 @@
55 logPaths := []string{"/dev/log", "/var/run/syslog"}
56 for _, network := range logTypes {
57 for _, path := range logPaths {
58- conn, err := net.Dial(network, path)
59+ conn, err := net.DialTimeout(network, path, connectTimeout)
60 if err != nil {
61 continue
62 } else {