summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/go.bbclass6
-rw-r--r--meta/recipes-devtools/go/go-1.10.inc22
-rw-r--r--meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch33
-rw-r--r--meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch220
-rw-r--r--meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch64
-rw-r--r--meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch47
-rw-r--r--meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch40
-rw-r--r--meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch277
-rw-r--r--meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch108
-rw-r--r--meta/recipes-devtools/go/go-1.10/0008-cmd-internal-obj-arm64-fix-branch-too-far-with-TBZ-l.patch58
-rw-r--r--meta/recipes-devtools/go/go-1.10/0009-ld-replace-glibc-dynamic-linker-with-musl.patch130
-rw-r--r--meta/recipes-devtools/go/go-common.inc2
-rw-r--r--meta/recipes-devtools/go/go-cross-canadian.inc27
-rw-r--r--meta/recipes-devtools/go/go-cross-canadian_1.10.bb2
-rw-r--r--meta/recipes-devtools/go/go-cross-canadian_1.9.bb10
-rw-r--r--meta/recipes-devtools/go/go-cross.inc55
-rw-r--r--meta/recipes-devtools/go/go-cross_1.10.bb2
-rw-r--r--meta/recipes-devtools/go/go-cross_1.9.bb8
-rw-r--r--meta/recipes-devtools/go/go-crosssdk.inc16
-rw-r--r--meta/recipes-devtools/go/go-crosssdk_1.10.bb2
-rw-r--r--meta/recipes-devtools/go/go-crosssdk_1.9.bb9
-rw-r--r--meta/recipes-devtools/go/go-native.inc26
-rw-r--r--meta/recipes-devtools/go/go-native_1.10.bb2
-rw-r--r--meta/recipes-devtools/go/go-native_1.9.bb2
-rw-r--r--meta/recipes-devtools/go/go-runtime.inc58
-rw-r--r--meta/recipes-devtools/go/go-runtime_1.10.bb2
-rw-r--r--meta/recipes-devtools/go/go-runtime_1.9.bb21
-rw-r--r--meta/recipes-devtools/go/go-target.inc21
-rw-r--r--meta/recipes-devtools/go/go_1.10.bb2
-rw-r--r--meta/recipes-devtools/go/go_1.9.bb15
30 files changed, 1183 insertions, 104 deletions
diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index 7ecd8c9254..a01b28bccd 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -24,6 +24,7 @@ GO_LINKMODE ?= ""
24GO_LINKMODE_class-nativesdk = "--linkmode=external" 24GO_LINKMODE_class-nativesdk = "--linkmode=external"
25GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} -extldflags '${GO_EXTLDFLAGS}'"' 25GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} -extldflags '${GO_EXTLDFLAGS}'"'
26export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}" 26export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}"
27export GOPATH_OMIT_IN_ACTIONID ?= "1"
27export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c" 28export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c"
28export GOPTESTFLAGS ?= "-test.v" 29export GOPTESTFLAGS ?= "-test.v"
29GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} " 30GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} "
@@ -47,6 +48,7 @@ GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/"
47 48
48B = "${WORKDIR}/build" 49B = "${WORKDIR}/build"
49export GOPATH = "${B}" 50export GOPATH = "${B}"
51export GOCACHE = "off"
50GO_TMPDIR ?= "${WORKDIR}/go-tmp" 52GO_TMPDIR ?= "${WORKDIR}/go-tmp"
51GO_TMPDIR[vardepvalue] = "" 53GO_TMPDIR[vardepvalue] = ""
52 54
@@ -88,6 +90,10 @@ go_do_compile() {
88 export TMPDIR="${GO_TMPDIR}" 90 export TMPDIR="${GO_TMPDIR}"
89 ${GO} env 91 ${GO} env
90 if [ -n "${GO_INSTALL}" ]; then 92 if [ -n "${GO_INSTALL}" ]; then
93 if [ -n "${GO_LINKSHARED}" ]; then
94 ${GO} install ${GOBUILDFLAGS} `go_list_packages`
95 rm -rf ${B}/bin
96 fi
91 ${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} `go_list_packages` 97 ${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} `go_list_packages`
92 fi 98 fi
93} 99}
diff --git a/meta/recipes-devtools/go/go-1.10.inc b/meta/recipes-devtools/go/go-1.10.inc
new file mode 100644
index 0000000000..08d1ba6551
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.10.inc
@@ -0,0 +1,22 @@
1require go-common.inc
2
3GO_BASEVERSION = "1.10"
4FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
5
6LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
7
8SRC_URI += "\
9 file://0001-allow-CC-and-CXX-to-have-multiple-words.patch \
10 file://0002-cmd-go-make-content-based-hash-generation-less-pedan.patch \
11 file://0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch \
12 file://0004-ld-add-soname-to-shareable-objects.patch \
13 file://0005-make.bash-override-CC-when-building-dist-and-go_boot.patch \
14 file://0006-cmd-dist-separate-host-and-target-builds.patch \
15 file://0007-cmd-go-make-GOROOT-precious-by-default.patch \
16 file://0008-cmd-internal-obj-arm64-fix-branch-too-far-with-TBZ-l.patch \
17"
18
19SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch"
20
21SRC_URI[main.md5sum] = "07cbb9d0091b846c6aea40bf5bc0cea7"
22SRC_URI[main.sha256sum] = "f3de49289405fda5fd1483a8fe6bd2fa5469e005fd567df64485c4fa000c7f24"
diff --git a/meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch b/meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch
new file mode 100644
index 0000000000..3bb33b0146
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch
@@ -0,0 +1,33 @@
1From 7a7de46129fa6859fb6311096eb9f54c53c7fe2f Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems>
3Date: Mon, 19 Feb 2018 08:49:33 -0800
4Subject: [PATCH 1/9] allow CC and CXX to have multiple words
5
6Upstream-Status: Inappropriate [OE specific]
7
8Signed-off-by: Matt Madison <matt@madison.systems>
9---
10 src/cmd/go/internal/envcmd/env.go | 4 ++--
11 1 file changed, 2 insertions(+), 2 deletions(-)
12
13diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go
14index 603f7b5060..f891123f9c 100644
15--- a/src/cmd/go/internal/envcmd/env.go
16+++ b/src/cmd/go/internal/envcmd/env.go
17@@ -82,11 +82,11 @@ func MkEnv() []cfg.EnvVar {
18
19 cc := cfg.DefaultCC(cfg.Goos, cfg.Goarch)
20 if env := strings.Fields(os.Getenv("CC")); len(env) > 0 {
21- cc = env[0]
22+ cc = strings.Join(env, " ")
23 }
24 cxx := cfg.DefaultCXX(cfg.Goos, cfg.Goarch)
25 if env := strings.Fields(os.Getenv("CXX")); len(env) > 0 {
26- cxx = env[0]
27+ cxx = strings.Join(env, " ")
28 }
29 env = append(env, cfg.EnvVar{Name: "CC", Value: cc})
30 env = append(env, cfg.EnvVar{Name: "CXX", Value: cxx})
31--
322.14.1
33
diff --git a/meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch b/meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
new file mode 100644
index 0000000000..74f37a99ef
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
@@ -0,0 +1,220 @@
1From 8b2feaee81d7a16adc59e61d06c1e7314d3a5408 Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems>
3Date: Mon, 19 Feb 2018 08:50:59 -0800
4Subject: [PATCH 2/9] cmd/go: make content-based hash generation less pedantic
5
6Go 1.10's build tool now uses content-based hashes to
7determine when something should be built or re-built.
8This same mechanism is used to maintain a built-artifact
9cache for speeding up builds.
10
11However, the hashes it generates include information that
12doesn't work well with OE, nor with using a shared runtime
13library.
14
15First, it embeds path names to source files, unless
16building within GOROOT. This prevents the building
17of a package in GOPATH for later staging into GOROOT.
18
19This patch adds support for the environment variable
20GOPATH_OMIT_IN_ACTIONID. If present, path name
21embedding is disabled.
22
23Second, if cgo is enabled, the build ID for cgo-related
24packages will include the current value of the environment
25variables for invoking the compiler (CC, CXX, FC) and
26any CGO_xxFLAGS variables. Only if the settings used
27during a compilation exactly match, character for character,
28the values used for compiling runtime/cgo or any other
29cgo-enabled package being imported, will the tool
30decide that the imported package is up-to-date.
31
32This is done to help ensure correctness, but is overly
33simplistic and effectively prevents the reuse of built
34artifacts that use cgo (or shared runtime, which includes
35runtime/cgo).
36
37This patch filters out all compiler flags except those
38beginning with '-m'. The default behavior can be restored
39by setting the CGO_PEDANTIC environment variable.
40
41Upstream-Status: Inappropriate [OE specific]
42
43Signed-off-by: Matt Madison <matt@madison.systems>
44---
45 src/cmd/go/internal/envcmd/env.go | 2 +-
46 src/cmd/go/internal/work/exec.go | 63 ++++++++++++++++++++++++++++-----------
47 2 files changed, 46 insertions(+), 19 deletions(-)
48
49diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go
50index f891123f9c..ebacfbfdbc 100644
51--- a/src/cmd/go/internal/envcmd/env.go
52+++ b/src/cmd/go/internal/envcmd/env.go
53@@ -113,7 +113,7 @@ func findEnv(env []cfg.EnvVar, name string) string {
54 func ExtraEnvVars() []cfg.EnvVar {
55 var b work.Builder
56 b.Init()
57- cppflags, cflags, cxxflags, fflags, ldflags, err := b.CFlags(&load.Package{})
58+ cppflags, cflags, cxxflags, fflags, ldflags, err := b.CFlags(&load.Package{}, false)
59 if err != nil {
60 // Should not happen - b.CFlags was given an empty package.
61 fmt.Fprintf(os.Stderr, "go: invalid cflags: %v\n", err)
62diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
63index c4c1500eb2..b0f6b45647 100644
64--- a/src/cmd/go/internal/work/exec.go
65+++ b/src/cmd/go/internal/work/exec.go
66@@ -173,6 +173,8 @@ func (b *Builder) Do(root *Action) {
67 wg.Wait()
68 }
69
70+var omitGopath = os.Getenv("GOPATH_OMIT_IN_ACTIONID") != ""
71+
72 // buildActionID computes the action ID for a build action.
73 func (b *Builder) buildActionID(a *Action) cache.ActionID {
74 p := a.Package
75@@ -189,7 +191,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
76 // but it does not hide the exact value of $GOPATH.
77 // Include the full dir in that case.
78 // Assume b.WorkDir is being trimmed properly.
79- if !p.Goroot && !strings.HasPrefix(p.Dir, b.WorkDir) {
80+ if !p.Goroot && !omitGopath && !strings.HasPrefix(p.Dir, b.WorkDir) {
81 fmt.Fprintf(h, "dir %s\n", p.Dir)
82 }
83 fmt.Fprintf(h, "goos %s goarch %s\n", cfg.Goos, cfg.Goarch)
84@@ -197,13 +199,13 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
85 fmt.Fprintf(h, "omitdebug %v standard %v local %v prefix %q\n", p.Internal.OmitDebug, p.Standard, p.Internal.Local, p.Internal.LocalPrefix)
86 if len(p.CgoFiles)+len(p.SwigFiles) > 0 {
87 fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo"))
88- cppflags, cflags, cxxflags, fflags, _, _ := b.CFlags(p)
89- fmt.Fprintf(h, "CC=%q %q %q\n", b.ccExe(), cppflags, cflags)
90+ cppflags, cflags, cxxflags, fflags, _, _ := b.CFlags(p, true)
91+ fmt.Fprintf(h, "CC=%q %q %q\n", b.ccExe(true), cppflags, cflags)
92 if len(p.CXXFiles)+len(p.SwigFiles) > 0 {
93- fmt.Fprintf(h, "CXX=%q %q\n", b.cxxExe(), cxxflags)
94+ fmt.Fprintf(h, "CXX=%q %q\n", b.cxxExe(true), cxxflags)
95 }
96 if len(p.FFiles) > 0 {
97- fmt.Fprintf(h, "FC=%q %q\n", b.fcExe(), fflags)
98+ fmt.Fprintf(h, "FC=%q %q\n", b.fcExe(true), fflags)
99 }
100 // TODO(rsc): Should we include the SWIG version or Fortran/GCC/G++/Objective-C compiler versions?
101 }
102@@ -1731,33 +1733,33 @@ var (
103 // gccCmd returns a gcc command line prefix
104 // defaultCC is defined in zdefaultcc.go, written by cmd/dist.
105 func (b *Builder) GccCmd(incdir, workdir string) []string {
106- return b.compilerCmd(b.ccExe(), incdir, workdir)
107+ return b.compilerCmd(b.ccExe(false), incdir, workdir)
108 }
109
110 // gxxCmd returns a g++ command line prefix
111 // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
112 func (b *Builder) GxxCmd(incdir, workdir string) []string {
113- return b.compilerCmd(b.cxxExe(), incdir, workdir)
114+ return b.compilerCmd(b.cxxExe(false), incdir, workdir)
115 }
116
117 // gfortranCmd returns a gfortran command line prefix.
118 func (b *Builder) gfortranCmd(incdir, workdir string) []string {
119- return b.compilerCmd(b.fcExe(), incdir, workdir)
120+ return b.compilerCmd(b.fcExe(false), incdir, workdir)
121 }
122
123 // ccExe returns the CC compiler setting without all the extra flags we add implicitly.
124-func (b *Builder) ccExe() []string {
125- return b.compilerExe(origCC, cfg.DefaultCC(cfg.Goos, cfg.Goarch))
126+func (b *Builder) ccExe(filtered bool) []string {
127+ return b.compilerExe(origCC, cfg.DefaultCC(cfg.Goos, cfg.Goarch), filtered)
128 }
129
130 // cxxExe returns the CXX compiler setting without all the extra flags we add implicitly.
131-func (b *Builder) cxxExe() []string {
132- return b.compilerExe(origCXX, cfg.DefaultCXX(cfg.Goos, cfg.Goarch))
133+func (b *Builder) cxxExe(filtered bool) []string {
134+ return b.compilerExe(origCXX, cfg.DefaultCXX(cfg.Goos, cfg.Goarch), filtered)
135 }
136
137 // fcExe returns the FC compiler setting without all the extra flags we add implicitly.
138-func (b *Builder) fcExe() []string {
139- return b.compilerExe(os.Getenv("FC"), "gfortran")
140+func (b *Builder) fcExe(filtered bool) []string {
141+ return b.compilerExe(os.Getenv("FC"), "gfortran", filtered)
142 }
143
144 // compilerExe returns the compiler to use given an
145@@ -1766,11 +1768,14 @@ func (b *Builder) fcExe() []string {
146 // of the compiler but can have additional arguments if they
147 // were present in the environment value.
148 // For example if CC="gcc -DGOPHER" then the result is ["gcc", "-DGOPHER"].
149-func (b *Builder) compilerExe(envValue string, def string) []string {
150+func (b *Builder) compilerExe(envValue string, def string, filtered bool) []string {
151 compiler := strings.Fields(envValue)
152 if len(compiler) == 0 {
153 compiler = []string{def}
154 }
155+ if filtered {
156+ return append(compiler[0:1], filterCompilerFlags(compiler[1:])...)
157+ }
158 return compiler
159 }
160
161@@ -1920,8 +1925,23 @@ func envList(key, def string) []string {
162 return strings.Fields(v)
163 }
164
165+var filterFlags = os.Getenv("CGO_PEDANTIC") == ""
166+
167+func filterCompilerFlags(flags []string) []string {
168+ var newflags []string
169+ if !filterFlags {
170+ return flags
171+ }
172+ for _, flag := range flags {
173+ if strings.HasPrefix(flag, "-m") {
174+ newflags = append(newflags, flag)
175+ }
176+ }
177+ return newflags
178+}
179+
180 // CFlags returns the flags to use when invoking the C, C++ or Fortran compilers, or cgo.
181-func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, ldflags []string, err error) {
182+func (b *Builder) CFlags(p *load.Package, filtered bool) (cppflags, cflags, cxxflags, fflags, ldflags []string, err error) {
183 defaults := "-g -O2"
184
185 if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil {
186@@ -1939,6 +1959,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l
187 if ldflags, err = buildFlags("LDFLAGS", defaults, p.CgoLDFLAGS, checkLinkerFlags); err != nil {
188 return
189 }
190+ if filtered {
191+ cppflags = filterCompilerFlags(cppflags)
192+ cflags = filterCompilerFlags(cflags)
193+ cxxflags = filterCompilerFlags(cxxflags)
194+ fflags = filterCompilerFlags(fflags)
195+ ldflags = filterCompilerFlags(ldflags)
196+ }
197
198 return
199 }
200@@ -1954,7 +1981,7 @@ var cgoRe = regexp.MustCompile(`[/\\:]`)
201
202 func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, gxxfiles, mfiles, ffiles []string) (outGo, outObj []string, err error) {
203 p := a.Package
204- cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, cgoFFLAGS, cgoLDFLAGS, err := b.CFlags(p)
205+ cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, cgoFFLAGS, cgoLDFLAGS, err := b.CFlags(p, false)
206 if err != nil {
207 return nil, nil, err
208 }
209@@ -2306,7 +2333,7 @@ func (b *Builder) swigIntSize(objdir string) (intsize string, err error) {
210
211 // Run SWIG on one SWIG input file.
212 func (b *Builder) swigOne(a *Action, p *load.Package, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) {
213- cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, _, _, err := b.CFlags(p)
214+ cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, _, _, err := b.CFlags(p, false)
215 if err != nil {
216 return "", "", err
217 }
218--
2192.14.1
220
diff --git a/meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch b/meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
new file mode 100644
index 0000000000..818fe66700
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
@@ -0,0 +1,64 @@
1From acd179b49f1fc8d6f7f69e569fb4a56039c725a1 Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems>
3Date: Sat, 17 Feb 2018 05:24:20 -0800
4Subject: [PATCH 3/9] allow GOTOOLDIR to be overridden in the environment
5
6to allow for split host/target build roots
7
8Upstream-Status: Inappropriate [OE specific]
9
10Signed-off-by: Matt Madison <matt@madison.systems>
11---
12 src/cmd/dist/build.go | 4 +++-
13 src/cmd/go/internal/cfg/cfg.go | 6 +++++-
14 src/go/build/build.go | 2 +-
15 3 files changed, 9 insertions(+), 3 deletions(-)
16
17diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
18index 49ed80033e..afc615b5c2 100644
19--- a/src/cmd/dist/build.go
20+++ b/src/cmd/dist/build.go
21@@ -220,7 +220,9 @@ func xinit() {
22 workdir = xworkdir()
23 xatexit(rmworkdir)
24
25- tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
26+ if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" {
27+ tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
28+ }
29 }
30
31 // compilerEnv returns a map from "goos/goarch" to the
32diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go
33index 1de4f0dc79..4f6010d660 100644
34--- a/src/cmd/go/internal/cfg/cfg.go
35+++ b/src/cmd/go/internal/cfg/cfg.go
36@@ -96,7 +96,11 @@ func init() {
37 // as the tool directory does not move based on environment variables.
38 // This matches the initialization of ToolDir in go/build,
39 // except for using GOROOT rather than runtime.GOROOT().
40- build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
41+ if s := os.Getenv("GOTOOLDIR"); s != "" {
42+ build.ToolDir = filepath.Clean(s)
43+ } else {
44+ build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
45+ }
46 }
47
48 func findGOROOT() string {
49diff --git a/src/go/build/build.go b/src/go/build/build.go
50index 68fb423983..81b1b32270 100644
51--- a/src/go/build/build.go
52+++ b/src/go/build/build.go
53@@ -1594,7 +1594,7 @@ func init() {
54 }
55
56 // ToolDir is the directory containing build tools.
57-var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
58+var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH))
59
60 // IsLocalImport reports whether the import path is
61 // a local import path, like ".", "..", "./foo", or "../foo".
62--
632.14.1
64
diff --git a/meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch b/meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch
new file mode 100644
index 0000000000..c23ca94290
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch
@@ -0,0 +1,47 @@
1From 85252f0bd8743223eb778edbe9fb31dff17a23d8 Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems>
3Date: Sat, 17 Feb 2018 06:26:10 -0800
4Subject: [PATCH 4/9] ld: add soname to shareable objects
5
6so that OE's shared library dependency handling
7can find them.
8
9Upstream-Status: Inappropriate [OE specific]
10
11Signed-off-by: Matt Madison <matt@madison.systems>
12---
13 src/cmd/link/internal/ld/lib.go | 4 ++++
14 1 file changed, 4 insertions(+)
15
16diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
17index 6dcaf64122..11cbb8a8bb 100644
18--- a/src/cmd/link/internal/ld/lib.go
19+++ b/src/cmd/link/internal/ld/lib.go
20@@ -1134,6 +1134,7 @@ func (ctxt *Link) hostlink() {
21 argv = append(argv, "-Wl,-z,relro")
22 }
23 argv = append(argv, "-shared")
24+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
25 if ctxt.HeadType != objabi.Hwindows {
26 // Pass -z nodelete to mark the shared library as
27 // non-closeable: a dlclose will do nothing.
28@@ -1145,6 +1146,8 @@ func (ctxt *Link) hostlink() {
29 argv = append(argv, "-Wl,-z,relro")
30 }
31 argv = append(argv, "-shared")
32+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
33+
34 case BuildModePlugin:
35 if ctxt.HeadType == objabi.Hdarwin {
36 argv = append(argv, "-dynamiclib")
37@@ -1153,6 +1156,7 @@ func (ctxt *Link) hostlink() {
38 argv = append(argv, "-Wl,-z,relro")
39 }
40 argv = append(argv, "-shared")
41+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile)))
42 }
43 }
44
45--
462.14.1
47
diff --git a/meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch b/meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
new file mode 100644
index 0000000000..67a93939f5
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
@@ -0,0 +1,40 @@
1From 16124d84648f4dfdfa4738c5660b5400b30bf9da Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems>
3Date: Sat, 17 Feb 2018 06:32:45 -0800
4Subject: [PATCH 5/9] make.bash: override CC when building dist and
5 go_bootstrap
6
7for handling OE cross-canadian builds.
8
9Upstream-Status: Inappropriate [OE specific]
10
11Signed-off-by: Matt Madison <matt@madison.systems>
12---
13 src/make.bash | 4 ++--
14 1 file changed, 2 insertions(+), 2 deletions(-)
15
16diff --git a/src/make.bash b/src/make.bash
17index 93a5c43d11..3a63682bc4 100755
18--- a/src/make.bash
19+++ b/src/make.bash
20@@ -162,7 +162,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then
21 exit 1
22 fi
23 rm -f cmd/dist/dist
24-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
25+CC="${BUILD_CC:-${CC}}" GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
26
27 # -e doesn't propagate out of eval, so check success by hand.
28 eval $(./cmd/dist/dist env -p || echo FAIL=true)
29@@ -193,7 +193,7 @@ fi
30 # Run dist bootstrap to complete make.bash.
31 # Bootstrap installs a proper cmd/dist, built with the new toolchain.
32 # Throw ours, built with Go 1.4, away after bootstrap.
33-./cmd/dist/dist bootstrap $buildall $vflag $GO_DISTFLAGS "$@"
34+CC="${BUILD_CC:-${CC}}" ./cmd/dist/dist bootstrap $buildall $vflag $GO_DISTFLAGS "$@"
35 rm -f ./cmd/dist/dist
36
37 # DO NOT ADD ANY NEW CODE HERE.
38--
392.14.1
40
diff --git a/meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch b/meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch
new file mode 100644
index 0000000000..9fe6996284
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch
@@ -0,0 +1,277 @@
1From 2f07af34697c61decdcfa5b11434451fbcf37704 Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems>
3Date: Sat, 17 Feb 2018 10:03:48 -0800
4Subject: [PATCH 6/9] cmd/dist: separate host and target builds
5
6Change the dist tool to allow for OE-style cross-
7and cross-canadian builds:
8
9 - command flags --host-only and --target only are added;
10 if one is present, the other changes mentioned below
11 take effect, and arguments may also be specified on
12 the command line to enumerate the package(s) to be
13 built.
14
15 - for OE cross builds, go_bootstrap is always built for
16 the current build host, and is moved, along with the supporting
17 toolchain (asm, compile, etc.) to a separate 'native_native'
18 directory under GOROOT/pkg/tool.
19
20 - go_bootstrap is not automatically removed after the build,
21 so it can be reused later (e.g., building both static and
22 shared runtime).
23
24Note that for --host-only builds, it would be nice to specify
25just the "cmd" package to build only the go commands/tools,
26the staleness checks in the dist tool will fail if the "std"
27library has not also been built. So host-only builds have to
28build everything anyway.
29
30Upstream-Status: Inappropriate [OE specific]
31
32Signed-off-by: Matt Madison <matt@madison.systems>
33
34more dist cleanup
35---
36 src/cmd/dist/build.go | 149 +++++++++++++++++++++++++++++++++++++-------------
37 1 file changed, 111 insertions(+), 38 deletions(-)
38
39diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
40index afc615b5c2..36262665b2 100644
41--- a/src/cmd/dist/build.go
42+++ b/src/cmd/dist/build.go
43@@ -38,6 +38,7 @@ var (
44 goldflags string
45 workdir string
46 tooldir string
47+ build_tooldir string
48 oldgoos string
49 oldgoarch string
50 exe string
51@@ -49,6 +50,7 @@ var (
52
53 rebuildall bool
54 defaultclang bool
55+ crossBuild bool
56
57 vflag int // verbosity
58 )
59@@ -223,6 +225,8 @@ func xinit() {
60 if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" {
61 tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch)
62 }
63+ build_tooldir = pathf("%s/pkg/tool/native_native", goroot)
64+
65 }
66
67 // compilerEnv returns a map from "goos/goarch" to the
68@@ -252,7 +256,6 @@ func compilerEnv(envName, def string) map[string]string {
69 if gohostos != goos || gohostarch != goarch {
70 m[gohostos+"/"+gohostarch] = m[""]
71 }
72- m[""] = env
73 }
74
75 for _, goos := range okgoos {
76@@ -479,8 +482,10 @@ func setup() {
77 // We keep it in pkg/, just like the object directory above.
78 if rebuildall {
79 xremoveall(tooldir)
80+ xremoveall(build_tooldir)
81 }
82 xmkdirall(tooldir)
83+ xmkdirall(build_tooldir)
84
85 // Remove tool binaries from before the tool/gohostos_gohostarch
86 xremoveall(pathf("%s/bin/tool", goroot))
87@@ -1130,11 +1135,29 @@ func cmdbootstrap() {
88
89 var noBanner bool
90 var debug bool
91+ var hostOnly bool
92+ var targetOnly bool
93+ var toBuild = []string { "std", "cmd" }
94+
95 flag.BoolVar(&rebuildall, "a", rebuildall, "rebuild all")
96 flag.BoolVar(&debug, "d", debug, "enable debugging of bootstrap process")
97 flag.BoolVar(&noBanner, "no-banner", noBanner, "do not print banner")
98+ flag.BoolVar(&hostOnly, "host-only", hostOnly, "build only host binaries, not target")
99+ flag.BoolVar(&targetOnly, "target-only", targetOnly, "build only target binaries, not host")
100
101- xflagparse(0)
102+ xflagparse(-1)
103+
104+ if (hostOnly && targetOnly) {
105+ fatalf("specify only one of --host-only or --target-only\n")
106+ }
107+ crossBuild = hostOnly || targetOnly
108+ if flag.NArg() > 0 {
109+ if crossBuild {
110+ toBuild = flag.Args()
111+ } else {
112+ fatalf("package names not permitted without --host-only or --target-only\n")
113+ }
114+ }
115
116 if debug {
117 // cmd/buildid is used in debug mode.
118@@ -1182,8 +1205,13 @@ func cmdbootstrap() {
119 xprintf("\n")
120 }
121
122- gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now
123- goldflags = os.Getenv("GO_LDFLAGS")
124+ // For split host/target cross/cross-canadian builds, we don't
125+ // want to be setting these flags until after we have compiled
126+ // the toolchain that runs on the build host.
127+ if ! crossBuild {
128+ gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now
129+ goldflags = os.Getenv("GO_LDFLAGS")
130+ }
131 goBootstrap := pathf("%s/go_bootstrap", tooldir)
132 cmdGo := pathf("%s/go", gobin)
133 if debug {
134@@ -1212,7 +1240,11 @@ func cmdbootstrap() {
135 xprintf("\n")
136 }
137 xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n")
138- os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
139+ if crossBuild {
140+ os.Setenv("CC", defaultcc[""])
141+ } else {
142+ os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
143+ }
144 goInstall(goBootstrap, append([]string{"-i"}, toolchain...)...)
145 if debug {
146 run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
147@@ -1249,45 +1281,82 @@ func cmdbootstrap() {
148 }
149 checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
150
151- if goos == oldgoos && goarch == oldgoarch {
152- // Common case - not setting up for cross-compilation.
153- timelog("build", "toolchain")
154- if vflag > 0 {
155- xprintf("\n")
156+ if crossBuild {
157+ gogcflags = os.Getenv("GO_GCFLAGS")
158+ goldflags = os.Getenv("GO_LDFLAGS")
159+ tool_files, _ := filepath.Glob(pathf("%s/*", tooldir))
160+ for _, f := range tool_files {
161+ copyfile(pathf("%s/%s", build_tooldir, filepath.Base(f)), f, writeExec)
162+ xremove(f)
163+ }
164+ os.Setenv("GOTOOLDIR", build_tooldir)
165+ goBootstrap = pathf("%s/go_bootstrap", build_tooldir)
166+ if hostOnly {
167+ timelog("build", "host toolchain")
168+ if vflag > 0 {
169+ xprintf("\n")
170+ }
171+ xprintf("Building %s for host, %s/%s.\n", strings.Join(toBuild, ","), goos, goarch)
172+ goInstall(goBootstrap, toBuild...)
173+ checkNotStale(goBootstrap, toBuild...)
174+ // Skip cmdGo staleness checks here, since we can't necessarily run the cmdGo binary
175+
176+ timelog("build", "target toolchain")
177+ if vflag > 0 {
178+ xprintf("\n")
179+ }
180+ } else if targetOnly {
181+ goos = oldgoos
182+ goarch = oldgoarch
183+ os.Setenv("GOOS", goos)
184+ os.Setenv("GOARCH", goarch)
185+ os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
186+ xprintf("Building %s for target, %s/%s.\n", strings.Join(toBuild, ","), goos, goarch)
187+ goInstall(goBootstrap, toBuild...)
188+ checkNotStale(goBootstrap, toBuild...)
189+ // Skip cmdGo staleness checks here, since we can't run the target's cmdGo binary
190 }
191- xprintf("Building packages and commands for %s/%s.\n", goos, goarch)
192 } else {
193- // GOOS/GOARCH does not match GOHOSTOS/GOHOSTARCH.
194- // Finish GOHOSTOS/GOHOSTARCH installation and then
195- // run GOOS/GOARCH installation.
196- timelog("build", "host toolchain")
197- if vflag > 0 {
198- xprintf("\n")
199+ if goos == oldgoos && goarch == oldgoarch {
200+ // Common case - not setting up for cross-compilation.
201+ timelog("build", "toolchain")
202+ if vflag > 0 {
203+ xprintf("\n")
204+ }
205+ xprintf("Building packages and commands for %s/%s.\n", goos, goarch)
206+ } else {
207+ // GOOS/GOARCH does not match GOHOSTOS/GOHOSTARCH.
208+ // Finish GOHOSTOS/GOHOSTARCH installation and then
209+ // run GOOS/GOARCH installation.
210+ timelog("build", "host toolchain")
211+ if vflag > 0 {
212+ xprintf("\n")
213+ }
214+ xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch)
215+ goInstall(goBootstrap, "std", "cmd")
216+ checkNotStale(goBootstrap, "std", "cmd")
217+ checkNotStale(cmdGo, "std", "cmd")
218+
219+ timelog("build", "target toolchain")
220+ if vflag > 0 {
221+ xprintf("\n")
222+ }
223+ goos = oldgoos
224+ goarch = oldgoarch
225+ os.Setenv("GOOS", goos)
226+ os.Setenv("GOARCH", goarch)
227+ os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
228+ xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
229 }
230- xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch)
231 goInstall(goBootstrap, "std", "cmd")
232 checkNotStale(goBootstrap, "std", "cmd")
233 checkNotStale(cmdGo, "std", "cmd")
234-
235- timelog("build", "target toolchain")
236- if vflag > 0 {
237- xprintf("\n")
238+ if debug {
239+ run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
240+ run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch))
241+ checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
242+ copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
243 }
244- goos = oldgoos
245- goarch = oldgoarch
246- os.Setenv("GOOS", goos)
247- os.Setenv("GOARCH", goarch)
248- os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
249- xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
250- }
251- goInstall(goBootstrap, "std", "cmd")
252- checkNotStale(goBootstrap, "std", "cmd")
253- checkNotStale(cmdGo, "std", "cmd")
254- if debug {
255- run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
256- run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch))
257- checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
258- copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
259 }
260
261 // Check that there are no new files in $GOROOT/bin other than
262@@ -1305,7 +1374,11 @@ func cmdbootstrap() {
263 }
264
265 // Remove go_bootstrap now that we're done.
266- xremove(pathf("%s/go_bootstrap", tooldir))
267+ // Except that for split host/target cross-builds, we need to
268+ // keep it.
269+ if ! crossBuild {
270+ xremove(pathf("%s/go_bootstrap", tooldir))
271+ }
272
273 // Print trailing banner unless instructed otherwise.
274 if !noBanner {
275--
2762.14.1
277
diff --git a/meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch b/meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch
new file mode 100644
index 0000000000..72427627bc
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch
@@ -0,0 +1,108 @@
1From f98aa287941417226a6e4f78759f8a5e19732cde Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems>
3Date: Fri, 2 Mar 2018 06:00:20 -0800
4Subject: [PATCH 7/9] cmd/go: make GOROOT precious by default
5
6The go build tool normally rebuilds whatever it detects is
7stale. This can be a problem when GOROOT is intended to
8be read-only and the go runtime has been built as a shared
9library, since we don't want every application to be rebuilding
10the shared runtime - particularly in cross-build/packaging
11setups, since that would lead to 'abi mismatch' runtime errors.
12
13This patch prevents the install and linkshared actions from
14installing to GOROOT unless overridden with the GOROOT_OVERRIDE
15environment variable.
16
17Upstream-Status: Inappropriate [OE specific]
18
19Signed-off-by: Matt Madison <matt@madison.systems>
20---
21 src/cmd/go/internal/work/action.go | 3 +++
22 src/cmd/go/internal/work/build.go | 5 +++++
23 src/cmd/go/internal/work/exec.go | 25 +++++++++++++++++++++++++
24 3 files changed, 33 insertions(+)
25
26diff --git a/src/cmd/go/internal/work/action.go b/src/cmd/go/internal/work/action.go
27index 9f1f8f8a50..a382880474 100644
28--- a/src/cmd/go/internal/work/action.go
29+++ b/src/cmd/go/internal/work/action.go
30@@ -563,6 +563,9 @@ func (b *Builder) addTransitiveLinkDeps(a, a1 *Action, shlib string) {
31 if p1 == nil || p1.Shlib == "" || haveShlib[filepath.Base(p1.Shlib)] {
32 continue
33 }
34+ if goRootPrecious && (p1.Standard || p1.Goroot) {
35+ continue
36+ }
37 haveShlib[filepath.Base(p1.Shlib)] = true
38 // TODO(rsc): The use of ModeInstall here is suspect, but if we only do ModeBuild,
39 // we'll end up building an overall library or executable that depends at runtime
40diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go
41index 57b7b00879..e2ba95420e 100644
42--- a/src/cmd/go/internal/work/build.go
43+++ b/src/cmd/go/internal/work/build.go
44@@ -143,6 +143,7 @@ See also: go install, go get, go clean.
45 }
46
47 const concurrentGCBackendCompilationEnabledByDefault = true
48+var goRootPrecious bool = true
49
50 func init() {
51 // break init cycle
52@@ -156,6 +157,10 @@ func init() {
53
54 AddBuildFlags(CmdBuild)
55 AddBuildFlags(CmdInstall)
56+
57+ if x := os.Getenv("GOROOT_OVERRIDE"); x != "" {
58+ goRootPrecious = false
59+ }
60 }
61
62 // Note that flags consulted by other parts of the code
63diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
64index b0f6b45647..c8f266a8ad 100644
65--- a/src/cmd/go/internal/work/exec.go
66+++ b/src/cmd/go/internal/work/exec.go
67@@ -371,6 +371,23 @@ func (b *Builder) build(a *Action) (err error) {
68 return fmt.Errorf("missing or invalid binary-only package")
69 }
70
71+ if goRootPrecious && (a.Package.Standard || a.Package.Goroot) {
72+ _, err := os.Stat(a.Package.Target)
73+ if err == nil {
74+ a.built = a.Package.Target
75+ a.Target = a.Package.Target
76+ a.buildID = b.fileHash(a.Package.Target)
77+ a.Package.Stale = false
78+ a.Package.StaleReason = "GOROOT-resident package"
79+ return nil
80+ }
81+ if b.ComputeStaleOnly {
82+ a.Package.Stale = true
83+ a.Package.StaleReason = "missing or invalid GOROOT-resident package"
84+ return nil
85+ }
86+ }
87+
88 if err := b.Mkdir(a.Objdir); err != nil {
89 return err
90 }
91@@ -1097,6 +1114,14 @@ func BuildInstallFunc(b *Builder, a *Action) (err error) {
92 return nil
93 }
94
95+ if goRootPrecious && a.Package != nil {
96+ p := a.Package
97+ if p.Standard || p.Goroot {
98+ err := fmt.Errorf("attempting to install package %s into read-only GOROOT", p.ImportPath)
99+ return err
100+ }
101+ }
102+
103 if err := b.Mkdir(a.Objdir); err != nil {
104 return err
105 }
106--
1072.14.1
108
diff --git a/meta/recipes-devtools/go/go-1.10/0008-cmd-internal-obj-arm64-fix-branch-too-far-with-TBZ-l.patch b/meta/recipes-devtools/go/go-1.10/0008-cmd-internal-obj-arm64-fix-branch-too-far-with-TBZ-l.patch
new file mode 100644
index 0000000000..1e754178d5
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.10/0008-cmd-internal-obj-arm64-fix-branch-too-far-with-TBZ-l.patch
@@ -0,0 +1,58 @@
1From 41b90ed7af10a071ccfeede6a429e0d80518436d Mon Sep 17 00:00:00 2001
2From: Cherry Zhang <cherryyz@google.com>
3Date: Sat, 17 Feb 2018 10:31:39 -0500
4Subject: [PATCH 8/9] cmd/internal/obj/arm64: fix branch-too-far with TBZ like
5 instructions
6
7The compiler now emits TBZ like instructions, but the assembler's
8too-far-branch patch code didn't include that case. Add it.
9
10Fixes #23889.
11
12Change-Id: Ib75f9250c660b9fb652835fbc83263a5d5073dc5
13---
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15Upstream-Status: Backport
16
17 src/cmd/internal/obj/arm64/asm7.go | 11 +++++++++--
18 src/cmd/internal/obj/arm64/asm_test.go | 1 +
19 2 files changed, 10 insertions(+), 2 deletions(-)
20
21diff --git a/src/cmd/internal/obj/arm64/asm7.go b/src/cmd/internal/obj/arm64/asm7.go
22index ca81238c93..b1ee552489 100644
23--- a/src/cmd/internal/obj/arm64/asm7.go
24+++ b/src/cmd/internal/obj/arm64/asm7.go
25@@ -696,9 +696,16 @@ func span7(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
26 o = c.oplook(p)
27
28 /* very large branches */
29- if (o.type_ == 7 || o.type_ == 39) && p.Pcond != nil { // 7: BEQ and like, 39: CBZ and like
30+ if (o.type_ == 7 || o.type_ == 39 || o.type_ == 40) && p.Pcond != nil { // 7: BEQ and like, 39: CBZ and like, 40: TBZ and like
31 otxt := p.Pcond.Pc - pc
32- if otxt <= -(1<<18)+10 || otxt >= (1<<18)-10 {
33+ var toofar bool
34+ switch o.type_ {
35+ case 7, 39: // branch instruction encodes 19 bits
36+ toofar = otxt <= -(1<<20)+10 || otxt >= (1<<20)-10
37+ case 40: // branch instruction encodes 14 bits
38+ toofar = otxt <= -(1<<15)+10 || otxt >= (1<<15)-10
39+ }
40+ if toofar {
41 q := c.newprog()
42 q.Link = p.Link
43 p.Link = q
44diff --git a/src/cmd/internal/obj/arm64/asm_test.go b/src/cmd/internal/obj/arm64/asm_test.go
45index 369c48f510..3e0c9c13a6 100644
46--- a/src/cmd/internal/obj/arm64/asm_test.go
47+++ b/src/cmd/internal/obj/arm64/asm_test.go
48@@ -52,6 +52,7 @@ func TestLarge(t *testing.T) {
49 // gen generates a very large program, with a very far conditional branch.
50 func gen(buf *bytes.Buffer) {
51 fmt.Fprintln(buf, "TEXT f(SB),0,$0-0")
52+ fmt.Fprintln(buf, "TBZ $5, R0, label")
53 fmt.Fprintln(buf, "CBZ R0, label")
54 fmt.Fprintln(buf, "BEQ label")
55 for i := 0; i < 1<<19; i++ {
56--
572.14.1
58
diff --git a/meta/recipes-devtools/go/go-1.10/0009-ld-replace-glibc-dynamic-linker-with-musl.patch b/meta/recipes-devtools/go/go-1.10/0009-ld-replace-glibc-dynamic-linker-with-musl.patch
new file mode 100644
index 0000000000..06b00b3cc2
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.10/0009-ld-replace-glibc-dynamic-linker-with-musl.patch
@@ -0,0 +1,130 @@
1From f575d85c4bd9b2903223d6c0dcc38a12775d582f Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems>
3Date: Sun, 18 Feb 2018 08:24:05 -0800
4Subject: [PATCH 9/9] ld: replace glibc dynamic linker with musl
5
6Rework of patch by Khem Raj <raj.khem@gmail.com>
7for go 1.10. Should be applied conditionally on
8musl being the system C library.
9
10Upstream-Status: Inappropriate [Real fix should be portable across libcs]
11
12Signed-off-by: Matt Madison <matt@madison.systems>
13---
14 src/cmd/link/internal/amd64/obj.go | 2 +-
15 src/cmd/link/internal/arm/obj.go | 2 +-
16 src/cmd/link/internal/arm64/obj.go | 2 +-
17 src/cmd/link/internal/mips/obj.go | 2 +-
18 src/cmd/link/internal/mips64/obj.go | 2 +-
19 src/cmd/link/internal/ppc64/obj.go | 2 +-
20 src/cmd/link/internal/s390x/obj.go | 2 +-
21 src/cmd/link/internal/x86/obj.go | 2 +-
22 8 files changed, 8 insertions(+), 8 deletions(-)
23
24diff --git a/src/cmd/link/internal/amd64/obj.go b/src/cmd/link/internal/amd64/obj.go
25index 87e809166a..f522a63034 100644
26--- a/src/cmd/link/internal/amd64/obj.go
27+++ b/src/cmd/link/internal/amd64/obj.go
28@@ -62,7 +62,7 @@ func Init() (*sys.Arch, ld.Arch) {
29 PEreloc1: pereloc1,
30 TLSIEtoLE: tlsIEtoLE,
31
32- Linuxdynld: "/lib64/ld-linux-x86-64.so.2",
33+ Linuxdynld: "/lib64/ld-musl-x86-64.so.1",
34 Freebsddynld: "/libexec/ld-elf.so.1",
35 Openbsddynld: "/usr/libexec/ld.so",
36 Netbsddynld: "/libexec/ld.elf_so",
37diff --git a/src/cmd/link/internal/arm/obj.go b/src/cmd/link/internal/arm/obj.go
38index da16f92345..fd14940ede 100644
39--- a/src/cmd/link/internal/arm/obj.go
40+++ b/src/cmd/link/internal/arm/obj.go
41@@ -58,7 +58,7 @@ func Init() (*sys.Arch, ld.Arch) {
42 Gentext: gentext,
43 Machoreloc1: machoreloc1,
44
45- Linuxdynld: "/lib/ld-linux.so.3", // 2 for OABI, 3 for EABI
46+ Linuxdynld: "/lib/ld-musl-armhf.so.1",
47 Freebsddynld: "/usr/libexec/ld-elf.so.1",
48 Openbsddynld: "/usr/libexec/ld.so",
49 Netbsddynld: "/libexec/ld.elf_so",
50diff --git a/src/cmd/link/internal/arm64/obj.go b/src/cmd/link/internal/arm64/obj.go
51index 6b386ad737..99863712cc 100644
52--- a/src/cmd/link/internal/arm64/obj.go
53+++ b/src/cmd/link/internal/arm64/obj.go
54@@ -57,7 +57,7 @@ func Init() (*sys.Arch, ld.Arch) {
55 Gentext: gentext,
56 Machoreloc1: machoreloc1,
57
58- Linuxdynld: "/lib/ld-linux-aarch64.so.1",
59+ Linuxdynld: "/lib/ld-musl-aarch64.so.1",
60
61 Freebsddynld: "XXX",
62 Openbsddynld: "XXX",
63diff --git a/src/cmd/link/internal/mips/obj.go b/src/cmd/link/internal/mips/obj.go
64index c5d3451c39..fd85e6368d 100644
65--- a/src/cmd/link/internal/mips/obj.go
66+++ b/src/cmd/link/internal/mips/obj.go
67@@ -60,7 +60,7 @@ func Init() (*sys.Arch, ld.Arch) {
68 Gentext: gentext,
69 Machoreloc1: machoreloc1,
70
71- Linuxdynld: "/lib/ld.so.1",
72+ Linuxdynld: "/lib/ld-musl-mipsle.so.1",
73
74 Freebsddynld: "XXX",
75 Openbsddynld: "XXX",
76diff --git a/src/cmd/link/internal/mips64/obj.go b/src/cmd/link/internal/mips64/obj.go
77index 83974e5b56..097224f6da 100644
78--- a/src/cmd/link/internal/mips64/obj.go
79+++ b/src/cmd/link/internal/mips64/obj.go
80@@ -59,7 +59,7 @@ func Init() (*sys.Arch, ld.Arch) {
81 Gentext: gentext,
82 Machoreloc1: machoreloc1,
83
84- Linuxdynld: "/lib64/ld64.so.1",
85+ Linuxdynld: "/lib64/ld-musl-mips64le.so.1",
86 Freebsddynld: "XXX",
87 Openbsddynld: "XXX",
88 Netbsddynld: "XXX",
89diff --git a/src/cmd/link/internal/ppc64/obj.go b/src/cmd/link/internal/ppc64/obj.go
90index 273d9b42cb..a503abe8ea 100644
91--- a/src/cmd/link/internal/ppc64/obj.go
92+++ b/src/cmd/link/internal/ppc64/obj.go
93@@ -62,7 +62,7 @@ func Init() (*sys.Arch, ld.Arch) {
94 Machoreloc1: machoreloc1,
95
96 // TODO(austin): ABI v1 uses /usr/lib/ld.so.1,
97- Linuxdynld: "/lib64/ld64.so.1",
98+ Linuxdynld: "/lib64/ld-musl-powerpc64le.so.1",
99
100 Freebsddynld: "XXX",
101 Openbsddynld: "XXX",
102diff --git a/src/cmd/link/internal/s390x/obj.go b/src/cmd/link/internal/s390x/obj.go
103index 9ac7eb8217..3825ff7abe 100644
104--- a/src/cmd/link/internal/s390x/obj.go
105+++ b/src/cmd/link/internal/s390x/obj.go
106@@ -57,7 +57,7 @@ func Init() (*sys.Arch, ld.Arch) {
107 Gentext: gentext,
108 Machoreloc1: machoreloc1,
109
110- Linuxdynld: "/lib64/ld64.so.1",
111+ Linuxdynld: "/lib64/ld-musl-s390x.so.1",
112
113 // not relevant for s390x
114 Freebsddynld: "XXX",
115diff --git a/src/cmd/link/internal/x86/obj.go b/src/cmd/link/internal/x86/obj.go
116index 6a744dc04e..d81f392549 100644
117--- a/src/cmd/link/internal/x86/obj.go
118+++ b/src/cmd/link/internal/x86/obj.go
119@@ -58,7 +58,7 @@ func Init() (*sys.Arch, ld.Arch) {
120 Machoreloc1: machoreloc1,
121 PEreloc1: pereloc1,
122
123- Linuxdynld: "/lib/ld-linux.so.2",
124+ Linuxdynld: "/lib/ld-musl-i386.so.1",
125 Freebsddynld: "/usr/libexec/ld-elf.so.1",
126 Openbsddynld: "/usr/libexec/ld.so",
127 Netbsddynld: "/usr/libexec/ld.elf_so",
128--
1292.14.1
130
diff --git a/meta/recipes-devtools/go/go-common.inc b/meta/recipes-devtools/go/go-common.inc
index 37138b51ed..611775b2cc 100644
--- a/meta/recipes-devtools/go/go-common.inc
+++ b/meta/recipes-devtools/go/go-common.inc
@@ -22,6 +22,8 @@ UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)\.src\.tar"
22INHIBIT_PACKAGE_DEBUG_SPLIT = "1" 22INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
23SSTATE_SCAN_CMD = "true" 23SSTATE_SCAN_CMD = "true"
24 24
25export GOROOT_OVERRIDE = "1"
26
25do_compile_prepend() { 27do_compile_prepend() {
26 BUILD_CC=${BUILD_CC} 28 BUILD_CC=${BUILD_CC}
27} 29}
diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc b/meta/recipes-devtools/go/go-cross-canadian.inc
index 8afda6b2ce..e22914e7aa 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -7,34 +7,33 @@ PN = "go-cross-canadian-${TRANSLATED_TARGET_ARCH}"
7 7
8export GOHOSTOS = "${BUILD_GOOS}" 8export GOHOSTOS = "${BUILD_GOOS}"
9export GOHOSTARCH = "${BUILD_GOARCH}" 9export GOHOSTARCH = "${BUILD_GOARCH}"
10export GOHOSTOS_CROSS = "${HOST_GOOS}"
11export GOHOSTARCH_CROSS = "${HOST_GOARCH}"
12export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" 10export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
13export GOTOOLDIR_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/${BUILD_GOTUPLE}" 11export GOTOOLDIR_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/${BUILD_GOTUPLE}"
14export GOROOT_FINAL = "${libdir}/go" 12export GOROOT_FINAL = "${libdir}/go"
15export CGO_ENABLED = "1" 13export CGO_ENABLED = "1"
16export CC_FOR_TARGET = "${TARGET_PREFIX}gcc" 14export GOCACHE = "off"
17export CXX_FOR_TARGET = "${TARGET_PREFIX}g++" 15export GOTMPDIR ?= "${WORKDIR}/go-tmp"
18CC = "${HOST_PREFIX}gcc" 16GOTMPDIR[vardepvalue] = ""
19export CGO_CFLAGS = "--sysroot=${STAGING_DIR_TARGET} ${HOST_CC_ARCH} ${CFLAGS}" 17export CGO_CFLAGS = "${CFLAGS}"
20export CGO_LDFLAGS = "--sysroot=${STAGING_DIR_TARGET} ${HOST_CC_ARCH} ${LDFLAGS}" 18export CGO_LDFLAGS = "${LDFLAGS}"
21export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_TARGET} ${HOST_CC_ARCH} ${LDFLAGS}"' 19export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_HOST} ${HOST_CC_ARCH} ${LDFLAGS}"'
22 20
23do_configure[noexec] = "1" 21do_configure[noexec] = "1"
24 22
25do_compile() { 23do_compile() {
26 export GOBIN="${B}/bin" 24 export CC_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gcc --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
27 rm -rf ${GOBIN} ${B}/pkg 25 export CXX_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gxx --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
28 mkdir ${GOBIN}
29 cd src 26 cd src
30 ./make.bash --host-only --no-banner 27 ./make.bash --host-only --no-banner
31 cd ${B} 28 cd ${B}
32} 29}
30do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
31do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
33 32
34 33
35make_wrapper() { 34make_wrapper() {
36 rm -f ${D}${bindir}/$2 35 rm -f ${D}${bindir}/$2
37 cat <<END >${D}${bindir}/$2 36 cat <<END >${D}${bindir}/$2
38#!/bin/sh 37#!/bin/sh
39here=\`dirname \$0\` 38here=\`dirname \$0\`
40native_goroot=\`readlink -f \$here/../../lib/${TARGET_SYS}/go\` 39native_goroot=\`readlink -f \$here/../../lib/${TARGET_SYS}/go\`
@@ -46,7 +45,7 @@ export GOTOOLDIR="\$native_goroot/pkg/tool/${HOST_GOTUPLE}"
46test -n "\$GOROOT" || export GOROOT="\$OECORE_TARGET_SYSROOT/${target_libdir}/go" 45test -n "\$GOROOT" || export GOROOT="\$OECORE_TARGET_SYSROOT/${target_libdir}/go"
47\$here/../../lib/${TARGET_SYS}/go/bin/$1 "\$@" 46\$here/../../lib/${TARGET_SYS}/go/bin/$1 "\$@"
48END 47END
49 chmod +x ${D}${bindir}/$2 48 chmod +x ${D}${bindir}/$2
50} 49}
51 50
52do_install() { 51do_install() {
diff --git a/meta/recipes-devtools/go/go-cross-canadian_1.10.bb b/meta/recipes-devtools/go/go-cross-canadian_1.10.bb
new file mode 100644
index 0000000000..7ac9449e47
--- /dev/null
+++ b/meta/recipes-devtools/go/go-cross-canadian_1.10.bb
@@ -0,0 +1,2 @@
1require go-cross-canadian.inc
2require go-${PV}.inc
diff --git a/meta/recipes-devtools/go/go-cross-canadian_1.9.bb b/meta/recipes-devtools/go/go-cross-canadian_1.9.bb
index 7ac9449e47..0306fdf684 100644
--- a/meta/recipes-devtools/go/go-cross-canadian_1.9.bb
+++ b/meta/recipes-devtools/go/go-cross-canadian_1.9.bb
@@ -1,2 +1,12 @@
1require go-cross-canadian.inc 1require go-cross-canadian.inc
2require go-${PV}.inc 2require go-${PV}.inc
3
4export GOHOSTOS_CROSS = "${HOST_GOOS}"
5export GOHOSTARCH_CROSS = "${HOST_GOARCH}"
6export CC_FOR_TARGET = "${HOST_PREFIX}gcc --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
7export CXX_FOR_TARGET = "${HOST_PREFIX}g++ --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
8
9do_compile_prepend() {
10 export GOBIN="${B}/bin"
11 export TMPDIR="$GOTMPDIR"
12}
diff --git a/meta/recipes-devtools/go/go-cross.inc b/meta/recipes-devtools/go/go-cross.inc
index 3ac7211bc3..fe92651581 100644
--- a/meta/recipes-devtools/go/go-cross.inc
+++ b/meta/recipes-devtools/go/go-cross.inc
@@ -1,7 +1,7 @@
1inherit cross 1inherit cross
2 2
3PROVIDES = "virtual/${TARGET_PREFIX}go" 3PROVIDES = "virtual/${TARGET_PREFIX}go"
4DEPENDS += "go-native" 4DEPENDS = "go-native"
5 5
6PN = "go-cross-${TARGET_ARCH}" 6PN = "go-cross-${TARGET_ARCH}"
7 7
@@ -13,26 +13,27 @@ export GOARM = "${TARGET_GOARM}"
13export GO386 = "${TARGET_GO386}" 13export GO386 = "${TARGET_GO386}"
14export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" 14export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
15export GOROOT_FINAL = "${libdir}/go" 15export GOROOT_FINAL = "${libdir}/go"
16export GOCACHE = "off"
17export GOTMPDIR ?= "${WORKDIR}/go-tmp"
18GOTMPDIR[vardepvalue] = ""
16export CGO_ENABLED = "1" 19export CGO_ENABLED = "1"
17export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
18export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
19CC = "${@d.getVar('BUILD_CC').strip()}" 20CC = "${@d.getVar('BUILD_CC').strip()}"
20 21
21do_configure[noexec] = "1" 22do_configure[noexec] = "1"
22 23
23do_compile() { 24do_compile() {
24 export GOBIN="${B}/bin" 25 export CC_FOR_${GOOS}_${GOARCH}="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
25 rm -rf ${GOBIN} ${B}/pkg 26 export CXX_FOR_${GOOS}_${GOARCh}="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
26 mkdir ${GOBIN} 27 cd src
27 cd src 28 ./make.bash --host-only --no-banner
28 ./make.bash --host-only 29 cd ${B}
29 cd ${B}
30} 30}
31 31do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
32do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
32 33
33make_wrapper() { 34make_wrapper() {
34 rm -f ${D}${bindir}/$2 35 rm -f ${D}${bindir}/$2
35 cat <<END >${D}${bindir}/$2 36 cat <<END >${D}${bindir}/$2
36#!/bin/bash 37#!/bin/bash
37here=\`dirname \$0\` 38here=\`dirname \$0\`
38export GOARCH="${TARGET_GOARCH}" 39export GOARCH="${TARGET_GOARCH}"
@@ -41,22 +42,22 @@ export GOARM="\${GOARM:-${TARGET_GOARM}}"
41export GO386="\${GO386:-${TARGET_GO386}}" 42export GO386="\${GO386:-${TARGET_GO386}}"
42\$here/../../lib/${CROSS_TARGET_SYS_DIR}/go/bin/$1 "\$@" 43\$here/../../lib/${CROSS_TARGET_SYS_DIR}/go/bin/$1 "\$@"
43END 44END
44 chmod +x ${D}${bindir}/$2 45 chmod +x ${D}${bindir}/$2
45} 46}
46 47
47do_install() { 48do_install() {
48 install -d ${D}${libdir}/go 49 install -d ${D}${libdir}/go
49 cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/ 50 cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/
50 install -d ${D}${libdir}/go/src 51 install -d ${D}${libdir}/go/src
51 (cd ${S}/src; for d in *; do \ 52 (cd ${S}/src; for d in *; do \
52 [ ! -d $d ] || cp --preserve=mode,timestamps -R ${S}/src/$d ${D}${libdir}/go/src/; \ 53 [ ! -d $d ] || cp --preserve=mode,timestamps -R ${S}/src/$d ${D}${libdir}/go/src/; \
53 done) 54 done)
54 rm -rf ${D}${libdir}/go/src/runtime/pprof/testdata 55 find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \;
55 install -d ${D}${bindir} ${D}${libdir}/go/bin 56 install -d ${D}${bindir} ${D}${libdir}/go/bin
56 for f in ${B}/bin/* 57 for f in ${B}/bin/*
57 do 58 do
58 base=`basename $f` 59 base=`basename $f`
59 install -m755 $f ${D}${libdir}/go/bin 60 install -m755 $f ${D}${libdir}/go/bin
60 make_wrapper $base ${TARGET_PREFIX}$base 61 make_wrapper $base ${TARGET_PREFIX}$base
61 done 62 done
62} 63}
diff --git a/meta/recipes-devtools/go/go-cross_1.10.bb b/meta/recipes-devtools/go/go-cross_1.10.bb
new file mode 100644
index 0000000000..80b5a03f6c
--- /dev/null
+++ b/meta/recipes-devtools/go/go-cross_1.10.bb
@@ -0,0 +1,2 @@
1require go-cross.inc
2require go-${PV}.inc
diff --git a/meta/recipes-devtools/go/go-cross_1.9.bb b/meta/recipes-devtools/go/go-cross_1.9.bb
index 80b5a03f6c..4739c7d5c4 100644
--- a/meta/recipes-devtools/go/go-cross_1.9.bb
+++ b/meta/recipes-devtools/go/go-cross_1.9.bb
@@ -1,2 +1,10 @@
1require go-cross.inc 1require go-cross.inc
2require go-${PV}.inc 2require go-${PV}.inc
3
4export CC_FOR_TARGET = "${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
5export CXX_FOR_TARGET = "${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
6
7do_compile_prepend() {
8 export GOBIN="${B}/bin"
9 export TMPDIR="$GOTMPDIR"
10}
diff --git a/meta/recipes-devtools/go/go-crosssdk.inc b/meta/recipes-devtools/go/go-crosssdk.inc
index f67e4b92a0..05ca62eba8 100644
--- a/meta/recipes-devtools/go/go-crosssdk.inc
+++ b/meta/recipes-devtools/go/go-crosssdk.inc
@@ -11,21 +11,21 @@ export GOARCH = "${TARGET_GOARCH}"
11export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" 11export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
12export GOROOT_FINAL = "${libdir}/go" 12export GOROOT_FINAL = "${libdir}/go"
13export CGO_ENABLED = "1" 13export CGO_ENABLED = "1"
14export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}${SDKPATHNATIVE}" 14export GOCACHE = "off"
15export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}${SDKPATHNATIVE}" 15export GOTMPDIR ?= "${WORKDIR}/go-tmp"
16export GO_INSTALL = "cmd" 16GOTMPDIR[vardepvalue] = ""
17CC = "${@d.getVar('BUILD_CC').strip()}"
18 17
19do_configure[noexec] = "1" 18do_configure[noexec] = "1"
20 19
21do_compile() { 20do_compile() {
22 export GOBIN="${B}/bin" 21 export CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}${SDKPATHNATIVE}"
23 rm -rf ${GOBIN} ${B}/pkg 22 export CXX_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}${SDKPATHNATIVE}"
24 mkdir ${GOBIN}
25 cd src 23 cd src
26 ./make.bash --host-only 24 ./make.bash --host-only --no-banner
27 cd ${B} 25 cd ${B}
28} 26}
27do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
28do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
29 29
30make_wrapper() { 30make_wrapper() {
31 rm -f ${D}${bindir}/$2 31 rm -f ${D}${bindir}/$2
diff --git a/meta/recipes-devtools/go/go-crosssdk_1.10.bb b/meta/recipes-devtools/go/go-crosssdk_1.10.bb
new file mode 100644
index 0000000000..1857c8a577
--- /dev/null
+++ b/meta/recipes-devtools/go/go-crosssdk_1.10.bb
@@ -0,0 +1,2 @@
1require go-crosssdk.inc
2require go-${PV}.inc
diff --git a/meta/recipes-devtools/go/go-crosssdk_1.9.bb b/meta/recipes-devtools/go/go-crosssdk_1.9.bb
index 1857c8a577..3ac629bd41 100644
--- a/meta/recipes-devtools/go/go-crosssdk_1.9.bb
+++ b/meta/recipes-devtools/go/go-crosssdk_1.9.bb
@@ -1,2 +1,11 @@
1require go-crosssdk.inc 1require go-crosssdk.inc
2require go-${PV}.inc 2require go-${PV}.inc
3
4export CC_FOR_TARGET = "${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
5export CXX_FOR_TARGET = "${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
6export GO_INSTALL = "cmd"
7
8do_compile_prepend() {
9 export GOBIN="${B}/bin"
10 export TMPDIR="$GOTMPDIR"
11}
diff --git a/meta/recipes-devtools/go/go-native.inc b/meta/recipes-devtools/go/go-native.inc
index 95db1c2b7c..35561768df 100644
--- a/meta/recipes-devtools/go/go-native.inc
+++ b/meta/recipes-devtools/go/go-native.inc
@@ -4,34 +4,34 @@ nonstaging_libdir := "${libdir}"
4 4
5inherit native 5inherit native
6 6
7SRC_URI_append = " http://golang.org/dl/go1.4.3.src.tar.gz;name=bootstrap;subdir=go1.4" 7SRC_URI_append = " https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz;name=bootstrap;subdir=go1.4"
8SRC_URI[bootstrap.md5sum] = "dfb604511115dd402a77a553a5923a04" 8SRC_URI[bootstrap.md5sum] = "dbf727a4b0e365bf88d97cbfde590016"
9SRC_URI[bootstrap.sha256sum] = "9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959" 9SRC_URI[bootstrap.sha256sum] = "f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52"
10 10
11export GOOS = "${BUILD_GOOS}" 11export GOOS = "${BUILD_GOOS}"
12export GOARCH = "${BUILD_GOARCH}" 12export GOARCH = "${BUILD_GOARCH}"
13export GOTMPDIR ?= "${WORKDIR}/go-tmp"
14GOTMPDIR[vardepvalue] = ""
13CC = "${@d.getVar('BUILD_CC').strip()}" 15CC = "${@d.getVar('BUILD_CC').strip()}"
14 16
15export CGO_ENABLED = "1" 17export CGO_ENABLED = "1"
18GOMAKEARGS ?= "--no-banner"
16 19
17do_configure() { 20do_configure() {
18 cd ${WORKDIR}/go1.4/go/src 21 cd ${WORKDIR}/go1.4/go/src
19 CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash 22 CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash
20} 23}
21 24
22do_compile() { 25do_compile() {
23 export GOBIN="${B}/bin"
24 export GOROOT_FINAL="${nonstaging_libdir}/go" 26 export GOROOT_FINAL="${nonstaging_libdir}/go"
25 export GOROOT_BOOTSTRAP="${WORKDIR}/go1.4/go" 27 export GOROOT_BOOTSTRAP="${WORKDIR}/go1.4/go"
26 rm -rf ${GOBIN}
27 mkdir ${GOBIN}
28
29 export TMPDIR=${WORKDIR}/build-tmp
30 mkdir -p ${WORKDIR}/build-tmp
31 28
32 cd src 29 cd src
33 ./make.bash --host-only 30 ./make.bash ${GOMAKEARGS}
31 cd ${B}
34} 32}
33do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin"
34do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin"
35 35
36make_wrapper() { 36make_wrapper() {
37 rm -f ${D}${bindir}/$2$3 37 rm -f ${D}${bindir}/$2$3
@@ -51,7 +51,7 @@ do_install() {
51 (cd ${S}/src; for d in *; do \ 51 (cd ${S}/src; for d in *; do \
52 [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \ 52 [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
53 done) 53 done)
54 rm -rf ${D}${libdir}/go/src/runtime/pprof/testdata 54 find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \;
55 install -d ${D}${bindir} ${D}${libdir}/go/bin 55 install -d ${D}${bindir} ${D}${libdir}/go/bin
56 for f in ${B}/bin/* 56 for f in ${B}/bin/*
57 do 57 do
diff --git a/meta/recipes-devtools/go/go-native_1.10.bb b/meta/recipes-devtools/go/go-native_1.10.bb
new file mode 100644
index 0000000000..bbf3c0dd73
--- /dev/null
+++ b/meta/recipes-devtools/go/go-native_1.10.bb
@@ -0,0 +1,2 @@
1require ${PN}.inc
2require go-${PV}.inc
diff --git a/meta/recipes-devtools/go/go-native_1.9.bb b/meta/recipes-devtools/go/go-native_1.9.bb
index bbf3c0dd73..8621e1df32 100644
--- a/meta/recipes-devtools/go/go-native_1.9.bb
+++ b/meta/recipes-devtools/go/go-native_1.9.bb
@@ -1,2 +1,4 @@
1require ${PN}.inc 1require ${PN}.inc
2require go-${PV}.inc 2require go-${PV}.inc
3
4GOMAKEARGS = "--host-only --no-banner"
diff --git a/meta/recipes-devtools/go/go-runtime.inc b/meta/recipes-devtools/go/go-runtime.inc
index 29ae86e4ee..7a3b415b3f 100644
--- a/meta/recipes-devtools/go/go-runtime.inc
+++ b/meta/recipes-devtools/go/go-runtime.inc
@@ -10,11 +10,18 @@ export GOARM = "${TARGET_GOARM}"
10export GO386 = "${TARGET_GO386}" 10export GO386 = "${TARGET_GO386}"
11export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" 11export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
12export GOROOT_FINAL = "${libdir}/go" 12export GOROOT_FINAL = "${libdir}/go"
13export GO_TARGET_INSTALL = "std"
14export CGO_ENABLED = "1" 13export CGO_ENABLED = "1"
15export CC_FOR_TARGET="${CC}" 14export CGO_CFLAGS = "${CFLAGS}"
16export CXX_FOR_TARGET="${CXX}" 15export CGO_CPPFLAGS = "${CPPFLAGS}"
17export GOROOT_OVERRIDE = "1" 16export CGO_CXXFLAGS = "${CXXFLAGS}"
17export CGO_LDFLAGS = "${LDFLAGS}"
18export GOCACHE = "off"
19export GOTMPDIR ?= "${WORKDIR}/go-tmp"
20GOTMPDIR[vardepvalue] = ""
21GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${LDFLAGS}"
22GO_LINKMODE ?= ""
23GO_LINKMODE_class-nativesdk = "--linkmode=external"
24GO_LDFLAGS ?= '-ldflags="${GO_LINKMODE} -extldflags '${GO_EXTLDFLAGS}'"'
18 25
19do_configure() { 26do_configure() {
20 : 27 :
@@ -25,21 +32,20 @@ do_configure_libc-musl() {
25} 32}
26 33
27do_compile() { 34do_compile() {
28 export GOBIN="${B}/bin" 35 export CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CC}"
29 export CC="${@d.getVar('BUILD_CC').strip()}" 36 export CXX_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CXX}"
30 rm -rf ${GOBIN} ${B}/pkg 37
31 mkdir ${GOBIN}
32 cd src 38 cd src
33 ./make.bash --host-only 39 ./make.bash --target-only --no-banner std
34 cp ${B}/pkg/tool/${BUILD_GOTUPLE}/go_bootstrap ${B}
35 rm -rf ${B}/pkg/${TARGET_GOTUPLE}
36 ./make.bash --target-only
37 if [ -n "${GO_DYNLINK}" ]; then 40 if [ -n "${GO_DYNLINK}" ]; then
38 cp ${B}/go_bootstrap ${B}/pkg/tool/${BUILD_GOTUPLE} 41 export GOTOOLDIR="${B}/pkg/tool/native_native"
39 GO_FLAGS="-buildmode=shared" GO_LDFLAGS="-extldflags \"${LDFLAGS}\"" ./make.bash --target-only 42 CC="$CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}" GOARCH="${TARGET_GOARCH}" GOOS="${TARGET_GOOS}" GOROOT=${B} \
43 $GOTOOLDIR/go_bootstrap install -linkshared -buildmode=shared ${GO_LDFLAGS} std
40 fi 44 fi
41 cd ${B} 45 cd ${B}
42} 46}
47do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
48do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
43 49
44do_install() { 50do_install() {
45 install -d ${D}${libdir}/go/src 51 install -d ${D}${libdir}/go/src
@@ -54,20 +60,10 @@ do_install() {
54 find src -mindepth 1 -maxdepth 1 -type d | while read srcdir; do 60 find src -mindepth 1 -maxdepth 1 -type d | while read srcdir; do
55 cp --preserve=mode,timestamps -R $srcdir ${D}${libdir}/go/src/ 61 cp --preserve=mode,timestamps -R $srcdir ${D}${libdir}/go/src/
56 done 62 done
63 find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \;
57 rm -f ${D}${libdir}/go/src/cmd/dist/dist 64 rm -f ${D}${libdir}/go/src/cmd/dist/dist
58} 65}
59 66
60# Remove test binaries that cannot be relocated
61do_install_append_class-nativesdk() {
62 rm -rf ${D}${libdir}/go/src/runtime/pprof/testdata
63}
64
65# These testdata directories aren't needed for builds and contain binaries
66# that can cause errors in sysroot_strip(), so just remove them.
67sysroot_stage_all_append() {
68 find ${SYSROOT_DESTDIR}${libdir}/go/src -depth -type d -name 'testdata' -exec rm -rf {} \;
69}
70
71ALLOW_EMPTY_${PN} = "1" 67ALLOW_EMPTY_${PN} = "1"
72FILES_${PN} = "${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*${SOLIBSDEV}" 68FILES_${PN} = "${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*${SOLIBSDEV}"
73FILES_${PN}-dev = "${libdir}/go/src ${libdir}/go/pkg/include \ 69FILES_${PN}-dev = "${libdir}/go/src ${libdir}/go/pkg/include \
@@ -78,8 +74,6 @@ FILES_${PN}-dev = "${libdir}/go/src ${libdir}/go/pkg/include \
78 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*.shlibname \ 74 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*.shlibname \
79 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*.shlibname \ 75 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*.shlibname \
80 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*/*.shlibname \ 76 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*/*.shlibname \
81"
82FILES_${PN}-staticdev = "${libdir}/go/pkg/${TARGET_GOTUPLE} \
83 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*.a \ 77 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*.a \
84 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*.a \ 78 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*.a \
85 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*.a \ 79 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*.a \
@@ -88,11 +82,15 @@ FILES_${PN}-staticdev = "${libdir}/go/pkg/${TARGET_GOTUPLE} \
88 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*.a \ 82 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*.a \
89 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*/*.a \ 83 ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*/*.a \
90" 84"
91# The testdata directories in the source tree include some binaries for various 85FILES_${PN}-staticdev = "${libdir}/go/pkg/${TARGET_GOTUPLE}"
92# architectures, scripts, and .a files 86
93INSANE_SKIP_${PN}-dev = "staticdev ldflags file-rdeps arch" 87# Go sources include some scripts and pre-built binaries for
88# multiple architectures. The static .a files for dynamically-linked
89# runtime are also required in -dev.
90INSANE_SKIP_${PN}-dev = "staticdev file-rdeps arch"
94 91
95INHIBIT_PACKAGE_STRIP = "1" 92INHIBIT_PACKAGE_STRIP = "1"
96INHIBIT_PACKAGE_DEBUG_SPLIT = "1" 93INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
94INHIBIT_SYSROOT_STRIP = "1"
97 95
98BBCLASSEXTEND = "nativesdk" 96BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/go/go-runtime_1.10.bb b/meta/recipes-devtools/go/go-runtime_1.10.bb
new file mode 100644
index 0000000000..43b68b4e46
--- /dev/null
+++ b/meta/recipes-devtools/go/go-runtime_1.10.bb
@@ -0,0 +1,2 @@
1require go-${PV}.inc
2require go-runtime.inc
diff --git a/meta/recipes-devtools/go/go-runtime_1.9.bb b/meta/recipes-devtools/go/go-runtime_1.9.bb
index 43b68b4e46..a99cc30f63 100644
--- a/meta/recipes-devtools/go/go-runtime_1.9.bb
+++ b/meta/recipes-devtools/go/go-runtime_1.9.bb
@@ -1,2 +1,23 @@
1require go-${PV}.inc 1require go-${PV}.inc
2require go-runtime.inc 2require go-runtime.inc
3
4export GO_TARGET_INSTALL = "std"
5export CC_FOR_TARGET = "${CC}"
6export CXX_FOR_TARGET = "${CXX}"
7
8do_compile() {
9 export GOBIN="${B}/bin"
10 export TMPDIR="$GOTMPDIR"
11 export CC=$BUILD_CC
12
13 cd src
14 ./make.bash --host-only
15 cp ${B}/pkg/tool/${BUILD_GOTUPLE}/go_bootstrap ${B}
16 rm -rf ${B}/pkg/${TARGET_GOTUPLE}
17 ./make.bash --target-only
18 if [ -n "${GO_DYNLINK}" ]; then
19 cp ${B}/go_bootstrap ${B}/pkg/tool/${BUILD_GOTUPLE}
20 GO_FLAGS="-buildmode=shared" GO_LDFLAGS="-extldflags \"${LDFLAGS}\"" ./make.bash --target-only
21 fi
22 cd ${B}
23}
diff --git a/meta/recipes-devtools/go/go-target.inc b/meta/recipes-devtools/go/go-target.inc
index cac5d78227..a53a314c78 100644
--- a/meta/recipes-devtools/go/go-target.inc
+++ b/meta/recipes-devtools/go/go-target.inc
@@ -11,10 +11,9 @@ export GO386 = "${TARGET_GO386}"
11export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" 11export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
12export GOROOT_FINAL = "${libdir}/go" 12export GOROOT_FINAL = "${libdir}/go"
13export CGO_ENABLED = "1" 13export CGO_ENABLED = "1"
14export CC_FOR_TARGET = "${CC}" 14export GOCACHE = "off"
15export CXX_FOR_TARGET = "${CXX}" 15export GOTMPDIR ?= "${WORKDIR}/go-tmp"
16export GO_TARGET_INSTALL = "cmd" 16GOTMPDIR[vardepvalue] = ""
17export GO_FLAGS = "-a"
18GO_LDFLAGS = "" 17GO_LDFLAGS = ""
19GO_LDFLAGS_class-nativesdk = "-linkmode external" 18GO_LDFLAGS_class-nativesdk = "-linkmode external"
20export GO_LDFLAGS 19export GO_LDFLAGS
@@ -25,24 +24,22 @@ SECURITY_LDFLAGS = ""
25do_configure[noexec] = "1" 24do_configure[noexec] = "1"
26 25
27do_compile() { 26do_compile() {
28 export GOBIN="${B}/bin" 27 export CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CC}"
29 export CC="${@d.getVar('BUILD_CC').strip()}" 28 export CXX_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CXX}"
30 rm -rf ${GOBIN} ${B}/pkg
31 mkdir ${GOBIN}
32
33 export TMPDIR=${WORKDIR}/build-tmp
34 mkdir -p ${WORKDIR}/build-tmp
35 29
36 cd src 30 cd src
37 ./make.bash 31 ./make.bash --target-only --no-banner
38 cd ${B} 32 cd ${B}
39} 33}
34do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
35do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
40 36
41do_install() { 37do_install() {
42 install -d ${D}${libdir}/go/pkg/tool 38 install -d ${D}${libdir}/go/pkg/tool
43 cp --preserve=mode,timestamps -R ${B}/pkg/tool/${TARGET_GOTUPLE} ${D}${libdir}/go/pkg/tool/ 39 cp --preserve=mode,timestamps -R ${B}/pkg/tool/${TARGET_GOTUPLE} ${D}${libdir}/go/pkg/tool/
44 install -d ${D}${libdir}/go/src 40 install -d ${D}${libdir}/go/src
45 cp --preserve=mode,timestamps -R ${S}/src/cmd ${D}${libdir}/go/src/ 41 cp --preserve=mode,timestamps -R ${S}/src/cmd ${D}${libdir}/go/src/
42 find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \;
46 install -d ${D}${libdir}/go/bin 43 install -d ${D}${libdir}/go/bin
47 install -d ${D}${bindir} 44 install -d ${D}${bindir}
48 for f in ${B}/${GO_BUILD_BINDIR}/*; do 45 for f in ${B}/${GO_BUILD_BINDIR}/*; do
diff --git a/meta/recipes-devtools/go/go_1.10.bb b/meta/recipes-devtools/go/go_1.10.bb
new file mode 100644
index 0000000000..c67e2cb050
--- /dev/null
+++ b/meta/recipes-devtools/go/go_1.10.bb
@@ -0,0 +1,2 @@
1require go-${PV}.inc
2require go-target.inc
diff --git a/meta/recipes-devtools/go/go_1.9.bb b/meta/recipes-devtools/go/go_1.9.bb
index c67e2cb050..ec5a314e7d 100644
--- a/meta/recipes-devtools/go/go_1.9.bb
+++ b/meta/recipes-devtools/go/go_1.9.bb
@@ -1,2 +1,17 @@
1require go-${PV}.inc 1require go-${PV}.inc
2require go-target.inc 2require go-target.inc
3
4export GO_TARGET_INSTALL = "cmd"
5export GO_FLAGS = "-a"
6export CC_FOR_TARGET = "${CC}"
7export CXX_FOR_TARGET = "${CXX}"
8
9do_compile() {
10 export GOBIN="${B}/bin"
11 export TMPDIR="$GOTMPDIR"
12 export CC=$BUILD_CC
13
14 cd src
15 ./make.bash
16 cd ${B}
17}