diff options
author | Adrian Bunk <bunk@stusta.de> | 2019-05-27 23:39:18 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-05-29 12:54:12 +0100 |
commit | f6c34549f6d852937f5de3a81d0cedfed11d5ae4 (patch) | |
tree | b2c3013deb4ee77876023c649281f1b6d27ac292 /meta/recipes-devtools | |
parent | 1d06897aba605c570cbd261fa38d5f0e11c3a850 (diff) | |
download | poky-f6c34549f6d852937f5de3a81d0cedfed11d5ae4.tar.gz |
Remove Go 1.11
There doesn't seem to be a reason to keep it in addition to 1.12 now.
(From OE-Core rev: 03bfbbb1d86f102ce23ee6ac0d4b905fc241f23c)
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
16 files changed, 0 insertions, 979 deletions
diff --git a/meta/recipes-devtools/go/go-1.11.inc b/meta/recipes-devtools/go/go-1.11.inc deleted file mode 100644 index d03e26cea0..0000000000 --- a/meta/recipes-devtools/go/go-1.11.inc +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | require go-common.inc | ||
2 | |||
3 | GO_BASEVERSION = "1.11" | ||
4 | GO_MINOR = ".4" | ||
5 | PV .= "${GO_MINOR}" | ||
6 | FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:" | ||
7 | |||
8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707" | ||
9 | |||
10 | SRC_URI += "\ | ||
11 | file://0001-allow-CC-and-CXX-to-have-multiple-words.patch \ | ||
12 | file://0002-cmd-go-make-content-based-hash-generation-less-pedan.patch \ | ||
13 | file://0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch \ | ||
14 | file://0004-ld-add-soname-to-shareable-objects.patch \ | ||
15 | file://0005-make.bash-override-CC-when-building-dist-and-go_boot.patch \ | ||
16 | file://0006-cmd-dist-separate-host-and-target-builds.patch \ | ||
17 | file://0007-cmd-go-make-GOROOT-precious-by-default.patch \ | ||
18 | file://0008-use-GOBUILDMODE-to-set-buildmode.patch \ | ||
19 | " | ||
20 | SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch" | ||
21 | |||
22 | SRC_URI[main.md5sum] = "a77697673215be465d1b583680ef2318" | ||
23 | SRC_URI[main.sha256sum] = "4cfd42720a6b1e79a8024895fa6607b69972e8e32446df76d6ce79801bbadb15" | ||
diff --git a/meta/recipes-devtools/go/go-1.11/0001-allow-CC-and-CXX-to-have-multiple-words.patch b/meta/recipes-devtools/go/go-1.11/0001-allow-CC-and-CXX-to-have-multiple-words.patch deleted file mode 100644 index 4442858c83..0000000000 --- a/meta/recipes-devtools/go/go-1.11/0001-allow-CC-and-CXX-to-have-multiple-words.patch +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | From 7cc519aa5f84cf8fc7ac8c10fc69aa8040330ea0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Matt Madison <matt@madison.systems> | ||
3 | Date: Mon, 19 Feb 2018 08:49:33 -0800 | ||
4 | Subject: [PATCH] allow CC and CXX to have multiple words | ||
5 | |||
6 | Upstream-Status: Inappropriate [OE specific] | ||
7 | |||
8 | Signed-off-by: Matt Madison <matt@madison.systems> | ||
9 | |||
10 | --- | ||
11 | src/cmd/go/internal/envcmd/env.go | 4 ++-- | ||
12 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go | ||
15 | index afadbad..cedbfbf 100644 | ||
16 | --- a/src/cmd/go/internal/envcmd/env.go | ||
17 | +++ b/src/cmd/go/internal/envcmd/env.go | ||
18 | @@ -85,11 +85,11 @@ func MkEnv() []cfg.EnvVar { | ||
19 | |||
20 | cc := cfg.DefaultCC(cfg.Goos, cfg.Goarch) | ||
21 | if env := strings.Fields(os.Getenv("CC")); len(env) > 0 { | ||
22 | - cc = env[0] | ||
23 | + cc = strings.Join(env, " ") | ||
24 | } | ||
25 | cxx := cfg.DefaultCXX(cfg.Goos, cfg.Goarch) | ||
26 | if env := strings.Fields(os.Getenv("CXX")); len(env) > 0 { | ||
27 | - cxx = env[0] | ||
28 | + cxx = strings.Join(env, " ") | ||
29 | } | ||
30 | env = append(env, cfg.EnvVar{Name: "CC", Value: cc}) | ||
31 | env = append(env, cfg.EnvVar{Name: "CXX", Value: cxx}) | ||
diff --git a/meta/recipes-devtools/go/go-1.11/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch b/meta/recipes-devtools/go/go-1.11/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch deleted file mode 100644 index 66b8561874..0000000000 --- a/meta/recipes-devtools/go/go-1.11/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch +++ /dev/null | |||
@@ -1,218 +0,0 @@ | |||
1 | From 47db69e20ed66fb62b01affd83d829654b829893 Mon Sep 17 00:00:00 2001 | ||
2 | From: Matt Madison <matt@madison.systems> | ||
3 | Date: Mon, 19 Feb 2018 08:50:59 -0800 | ||
4 | Subject: [PATCH] cmd/go: make content-based hash generation less pedantic | ||
5 | |||
6 | Go 1.10's build tool now uses content-based hashes to | ||
7 | determine when something should be built or re-built. | ||
8 | This same mechanism is used to maintain a built-artifact | ||
9 | cache for speeding up builds. | ||
10 | |||
11 | However, the hashes it generates include information that | ||
12 | doesn't work well with OE, nor with using a shared runtime | ||
13 | library. | ||
14 | |||
15 | First, it embeds path names to source files, unless | ||
16 | building within GOROOT. This prevents the building | ||
17 | of a package in GOPATH for later staging into GOROOT. | ||
18 | |||
19 | This patch adds support for the environment variable | ||
20 | GOPATH_OMIT_IN_ACTIONID. If present, path name | ||
21 | embedding is disabled. | ||
22 | |||
23 | Second, if cgo is enabled, the build ID for cgo-related | ||
24 | packages will include the current value of the environment | ||
25 | variables for invoking the compiler (CC, CXX, FC) and | ||
26 | any CGO_xxFLAGS variables. Only if the settings used | ||
27 | during a compilation exactly match, character for character, | ||
28 | the values used for compiling runtime/cgo or any other | ||
29 | cgo-enabled package being imported, will the tool | ||
30 | decide that the imported package is up-to-date. | ||
31 | |||
32 | This is done to help ensure correctness, but is overly | ||
33 | simplistic and effectively prevents the reuse of built | ||
34 | artifacts that use cgo (or shared runtime, which includes | ||
35 | runtime/cgo). | ||
36 | |||
37 | This patch filters out all compiler flags except those | ||
38 | beginning with '-m'. The default behavior can be restored | ||
39 | by setting the CGO_PEDANTIC environment variable. | ||
40 | |||
41 | Upstream-Status: Inappropriate [OE specific] | ||
42 | |||
43 | Signed-off-by: Matt Madison <matt@madison.systems> | ||
44 | |||
45 | --- | ||
46 | src/cmd/go/internal/envcmd/env.go | 2 +- | ||
47 | src/cmd/go/internal/work/exec.go | 63 ++++++++++++++++++++++--------- | ||
48 | 2 files changed, 46 insertions(+), 19 deletions(-) | ||
49 | |||
50 | diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go | ||
51 | index cedbfbf..5763a0d 100644 | ||
52 | --- a/src/cmd/go/internal/envcmd/env.go | ||
53 | +++ b/src/cmd/go/internal/envcmd/env.go | ||
54 | @@ -128,7 +128,7 @@ func ExtraEnvVars() []cfg.EnvVar { | ||
55 | func ExtraEnvVarsCostly() []cfg.EnvVar { | ||
56 | var b work.Builder | ||
57 | b.Init() | ||
58 | - cppflags, cflags, cxxflags, fflags, ldflags, err := b.CFlags(&load.Package{}) | ||
59 | + cppflags, cflags, cxxflags, fflags, ldflags, err := b.CFlags(&load.Package{}, false) | ||
60 | if err != nil { | ||
61 | // Should not happen - b.CFlags was given an empty package. | ||
62 | fmt.Fprintf(os.Stderr, "go: invalid cflags: %v\n", err) | ||
63 | diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go | ||
64 | index 12e1527..e41bfac 100644 | ||
65 | --- a/src/cmd/go/internal/work/exec.go | ||
66 | +++ b/src/cmd/go/internal/work/exec.go | ||
67 | @@ -174,6 +174,8 @@ func (b *Builder) Do(root *Action) { | ||
68 | wg.Wait() | ||
69 | } | ||
70 | |||
71 | +var omitGopath = os.Getenv("GOPATH_OMIT_IN_ACTIONID") != "" | ||
72 | + | ||
73 | // buildActionID computes the action ID for a build action. | ||
74 | func (b *Builder) buildActionID(a *Action) cache.ActionID { | ||
75 | p := a.Package | ||
76 | @@ -190,7 +192,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { | ||
77 | // but it does not hide the exact value of $GOPATH. | ||
78 | // Include the full dir in that case. | ||
79 | // Assume b.WorkDir is being trimmed properly. | ||
80 | - if !p.Goroot && !strings.HasPrefix(p.Dir, b.WorkDir) { | ||
81 | + if !p.Goroot && !omitGopath && !strings.HasPrefix(p.Dir, b.WorkDir) { | ||
82 | fmt.Fprintf(h, "dir %s\n", p.Dir) | ||
83 | } | ||
84 | fmt.Fprintf(h, "goos %s goarch %s\n", cfg.Goos, cfg.Goarch) | ||
85 | @@ -201,13 +203,13 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { | ||
86 | } | ||
87 | if len(p.CgoFiles)+len(p.SwigFiles) > 0 { | ||
88 | fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo")) | ||
89 | - cppflags, cflags, cxxflags, fflags, ldflags, _ := b.CFlags(p) | ||
90 | - fmt.Fprintf(h, "CC=%q %q %q %q\n", b.ccExe(), cppflags, cflags, ldflags) | ||
91 | + cppflags, cflags, cxxflags, fflags, ldflags, _ := b.CFlags(p, true) | ||
92 | + fmt.Fprintf(h, "CC=%q %q %q %q\n", b.ccExe(true), cppflags, cflags, ldflags) | ||
93 | if len(p.CXXFiles)+len(p.SwigFiles) > 0 { | ||
94 | - fmt.Fprintf(h, "CXX=%q %q\n", b.cxxExe(), cxxflags) | ||
95 | + fmt.Fprintf(h, "CXX=%q %q\n", b.cxxExe(true), cxxflags) | ||
96 | } | ||
97 | if len(p.FFiles) > 0 { | ||
98 | - fmt.Fprintf(h, "FC=%q %q\n", b.fcExe(), fflags) | ||
99 | + fmt.Fprintf(h, "FC=%q %q\n", b.fcExe(true), fflags) | ||
100 | } | ||
101 | // TODO(rsc): Should we include the SWIG version or Fortran/GCC/G++/Objective-C compiler versions? | ||
102 | } | ||
103 | @@ -2096,33 +2098,33 @@ var ( | ||
104 | // gccCmd returns a gcc command line prefix | ||
105 | // defaultCC is defined in zdefaultcc.go, written by cmd/dist. | ||
106 | func (b *Builder) GccCmd(incdir, workdir string) []string { | ||
107 | - return b.compilerCmd(b.ccExe(), incdir, workdir) | ||
108 | + return b.compilerCmd(b.ccExe(false), incdir, workdir) | ||
109 | } | ||
110 | |||
111 | // gxxCmd returns a g++ command line prefix | ||
112 | // defaultCXX is defined in zdefaultcc.go, written by cmd/dist. | ||
113 | func (b *Builder) GxxCmd(incdir, workdir string) []string { | ||
114 | - return b.compilerCmd(b.cxxExe(), incdir, workdir) | ||
115 | + return b.compilerCmd(b.cxxExe(false), incdir, workdir) | ||
116 | } | ||
117 | |||
118 | // gfortranCmd returns a gfortran command line prefix. | ||
119 | func (b *Builder) gfortranCmd(incdir, workdir string) []string { | ||
120 | - return b.compilerCmd(b.fcExe(), incdir, workdir) | ||
121 | + return b.compilerCmd(b.fcExe(false), incdir, workdir) | ||
122 | } | ||
123 | |||
124 | // ccExe returns the CC compiler setting without all the extra flags we add implicitly. | ||
125 | -func (b *Builder) ccExe() []string { | ||
126 | - return b.compilerExe(origCC, cfg.DefaultCC(cfg.Goos, cfg.Goarch)) | ||
127 | +func (b *Builder) ccExe(filtered bool) []string { | ||
128 | + return b.compilerExe(origCC, cfg.DefaultCC(cfg.Goos, cfg.Goarch), filtered) | ||
129 | } | ||
130 | |||
131 | // cxxExe returns the CXX compiler setting without all the extra flags we add implicitly. | ||
132 | -func (b *Builder) cxxExe() []string { | ||
133 | - return b.compilerExe(origCXX, cfg.DefaultCXX(cfg.Goos, cfg.Goarch)) | ||
134 | +func (b *Builder) cxxExe(filtered bool) []string { | ||
135 | + return b.compilerExe(origCXX, cfg.DefaultCXX(cfg.Goos, cfg.Goarch), filtered) | ||
136 | } | ||
137 | |||
138 | // fcExe returns the FC compiler setting without all the extra flags we add implicitly. | ||
139 | -func (b *Builder) fcExe() []string { | ||
140 | - return b.compilerExe(os.Getenv("FC"), "gfortran") | ||
141 | +func (b *Builder) fcExe(filtered bool) []string { | ||
142 | + return b.compilerExe(os.Getenv("FC"), "gfortran", filtered) | ||
143 | } | ||
144 | |||
145 | // compilerExe returns the compiler to use given an | ||
146 | @@ -2131,11 +2133,14 @@ func (b *Builder) fcExe() []string { | ||
147 | // of the compiler but can have additional arguments if they | ||
148 | // were present in the environment value. | ||
149 | // For example if CC="gcc -DGOPHER" then the result is ["gcc", "-DGOPHER"]. | ||
150 | -func (b *Builder) compilerExe(envValue string, def string) []string { | ||
151 | +func (b *Builder) compilerExe(envValue string, def string, filtered bool) []string { | ||
152 | compiler := strings.Fields(envValue) | ||
153 | if len(compiler) == 0 { | ||
154 | compiler = []string{def} | ||
155 | } | ||
156 | + if filtered { | ||
157 | + return append(compiler[0:1], filterCompilerFlags(compiler[1:])...) | ||
158 | + } | ||
159 | return compiler | ||
160 | } | ||
161 | |||
162 | @@ -2285,8 +2290,23 @@ func envList(key, def string) []string { | ||
163 | return strings.Fields(v) | ||
164 | } | ||
165 | |||
166 | +var filterFlags = os.Getenv("CGO_PEDANTIC") == "" | ||
167 | + | ||
168 | +func filterCompilerFlags(flags []string) []string { | ||
169 | + var newflags []string | ||
170 | + if !filterFlags { | ||
171 | + return flags | ||
172 | + } | ||
173 | + for _, flag := range flags { | ||
174 | + if strings.HasPrefix(flag, "-m") { | ||
175 | + newflags = append(newflags, flag) | ||
176 | + } | ||
177 | + } | ||
178 | + return newflags | ||
179 | +} | ||
180 | + | ||
181 | // CFlags returns the flags to use when invoking the C, C++ or Fortran compilers, or cgo. | ||
182 | -func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, ldflags []string, err error) { | ||
183 | +func (b *Builder) CFlags(p *load.Package, filtered bool) (cppflags, cflags, cxxflags, fflags, ldflags []string, err error) { | ||
184 | defaults := "-g -O2" | ||
185 | |||
186 | if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil { | ||
187 | @@ -2304,6 +2324,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l | ||
188 | if ldflags, err = buildFlags("LDFLAGS", defaults, p.CgoLDFLAGS, checkLinkerFlags); err != nil { | ||
189 | return | ||
190 | } | ||
191 | + if filtered { | ||
192 | + cppflags = filterCompilerFlags(cppflags) | ||
193 | + cflags = filterCompilerFlags(cflags) | ||
194 | + cxxflags = filterCompilerFlags(cxxflags) | ||
195 | + fflags = filterCompilerFlags(fflags) | ||
196 | + ldflags = filterCompilerFlags(ldflags) | ||
197 | + } | ||
198 | |||
199 | return | ||
200 | } | ||
201 | @@ -2319,7 +2346,7 @@ var cgoRe = regexp.MustCompile(`[/\\:]`) | ||
202 | |||
203 | func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, gxxfiles, mfiles, ffiles []string) (outGo, outObj []string, err error) { | ||
204 | p := a.Package | ||
205 | - cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, cgoFFLAGS, cgoLDFLAGS, err := b.CFlags(p) | ||
206 | + cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, cgoFFLAGS, cgoLDFLAGS, err := b.CFlags(p, false) | ||
207 | if err != nil { | ||
208 | return nil, nil, err | ||
209 | } | ||
210 | @@ -2679,7 +2706,7 @@ func (b *Builder) swigIntSize(objdir string) (intsize string, err error) { | ||
211 | |||
212 | // Run SWIG on one SWIG input file. | ||
213 | func (b *Builder) swigOne(a *Action, p *load.Package, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) { | ||
214 | - cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, _, _, err := b.CFlags(p) | ||
215 | + cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, _, _, err := b.CFlags(p, false) | ||
216 | if err != nil { | ||
217 | return "", "", err | ||
218 | } | ||
diff --git a/meta/recipes-devtools/go/go-1.11/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch b/meta/recipes-devtools/go/go-1.11/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch deleted file mode 100644 index b6ca40edee..0000000000 --- a/meta/recipes-devtools/go/go-1.11/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | From 5c32c38bf19b24f0aadd78012d17ff5caa82151e Mon Sep 17 00:00:00 2001 | ||
2 | From: Matt Madison <matt@madison.systems> | ||
3 | Date: Sat, 17 Feb 2018 05:24:20 -0800 | ||
4 | Subject: [PATCH] allow GOTOOLDIR to be overridden in the environment | ||
5 | |||
6 | to allow for split host/target build roots | ||
7 | |||
8 | Upstream-Status: Inappropriate [OE specific] | ||
9 | |||
10 | Signed-off-by: Matt Madison <matt@madison.systems> | ||
11 | |||
12 | --- | ||
13 | src/cmd/dist/build.go | 4 +++- | ||
14 | src/cmd/go/internal/cfg/cfg.go | 7 +++++-- | ||
15 | 2 files changed, 8 insertions(+), 3 deletions(-) | ||
16 | |||
17 | Index: go/src/cmd/dist/build.go | ||
18 | =================================================================== | ||
19 | --- go.orig/src/cmd/dist/build.go | ||
20 | +++ go/src/cmd/dist/build.go | ||
21 | @@ -228,7 +228,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 | ||
32 | Index: go/src/cmd/go/internal/cfg/cfg.go | ||
33 | =================================================================== | ||
34 | --- go.orig/src/cmd/go/internal/cfg/cfg.go | ||
35 | +++ go/src/cmd/go/internal/cfg/cfg.go | ||
36 | @@ -116,7 +116,11 @@ func init() { | ||
37 | // variables. This matches the initialization of ToolDir in | ||
38 | // go/build, except for using GOROOT rather than | ||
39 | // 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 | |||
diff --git a/meta/recipes-devtools/go/go-1.11/0004-ld-add-soname-to-shareable-objects.patch b/meta/recipes-devtools/go/go-1.11/0004-ld-add-soname-to-shareable-objects.patch deleted file mode 100644 index 004a33a023..0000000000 --- a/meta/recipes-devtools/go/go-1.11/0004-ld-add-soname-to-shareable-objects.patch +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | From 55eb8c95a89f32aec16b7764e78e8cf75169dc81 Mon Sep 17 00:00:00 2001 | ||
2 | From: Matt Madison <matt@madison.systems> | ||
3 | Date: Sat, 17 Feb 2018 06:26:10 -0800 | ||
4 | Subject: [PATCH] ld: add soname to shareable objects | ||
5 | |||
6 | so that OE's shared library dependency handling | ||
7 | can find them. | ||
8 | |||
9 | Upstream-Status: Inappropriate [OE specific] | ||
10 | |||
11 | Signed-off-by: Matt Madison <matt@madison.systems> | ||
12 | |||
13 | --- | ||
14 | src/cmd/link/internal/ld/lib.go | 4 ++++ | ||
15 | 1 file changed, 4 insertions(+) | ||
16 | |||
17 | diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go | ||
18 | index 220aab3..703925f 100644 | ||
19 | --- a/src/cmd/link/internal/ld/lib.go | ||
20 | +++ b/src/cmd/link/internal/ld/lib.go | ||
21 | @@ -1135,6 +1135,7 @@ func (ctxt *Link) hostlink() { | ||
22 | argv = append(argv, "-Wl,-z,relro") | ||
23 | } | ||
24 | argv = append(argv, "-shared") | ||
25 | + argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile))) | ||
26 | if ctxt.HeadType != objabi.Hwindows { | ||
27 | // Pass -z nodelete to mark the shared library as | ||
28 | // non-closeable: a dlclose will do nothing. | ||
29 | @@ -1146,6 +1147,8 @@ func (ctxt *Link) hostlink() { | ||
30 | argv = append(argv, "-Wl,-z,relro") | ||
31 | } | ||
32 | argv = append(argv, "-shared") | ||
33 | + argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile))) | ||
34 | + | ||
35 | case BuildModePlugin: | ||
36 | if ctxt.HeadType == objabi.Hdarwin { | ||
37 | argv = append(argv, "-dynamiclib") | ||
38 | @@ -1154,6 +1157,7 @@ func (ctxt *Link) hostlink() { | ||
39 | argv = append(argv, "-Wl,-z,relro") | ||
40 | } | ||
41 | argv = append(argv, "-shared") | ||
42 | + argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile))) | ||
43 | } | ||
44 | } | ||
45 | |||
diff --git a/meta/recipes-devtools/go/go-1.11/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch b/meta/recipes-devtools/go/go-1.11/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch deleted file mode 100644 index ace8de9eae..0000000000 --- a/meta/recipes-devtools/go/go-1.11/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | From 1bf15aa8fb773604b2524cfdab493fa4d8fa9285 Mon Sep 17 00:00:00 2001 | ||
2 | From: Matt Madison <matt@madison.systems> | ||
3 | Date: Sat, 17 Feb 2018 06:32:45 -0800 | ||
4 | Subject: [PATCH] make.bash: override CC when building dist and go_bootstrap | ||
5 | |||
6 | for handling OE cross-canadian builds. | ||
7 | |||
8 | Upstream-Status: Inappropriate [OE specific] | ||
9 | |||
10 | Signed-off-by: Matt Madison <matt@madison.systems> | ||
11 | |||
12 | --- | ||
13 | src/make.bash | 4 ++-- | ||
14 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/src/make.bash b/src/make.bash | ||
17 | index 78882d9..25943d0 100755 | ||
18 | --- a/src/make.bash | ||
19 | +++ b/src/make.bash | ||
20 | @@ -163,7 +163,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 | @@ -194,7 +194,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. | ||
diff --git a/meta/recipes-devtools/go/go-1.11/0006-cmd-dist-separate-host-and-target-builds.patch b/meta/recipes-devtools/go/go-1.11/0006-cmd-dist-separate-host-and-target-builds.patch deleted file mode 100644 index 0c0d5da80a..0000000000 --- a/meta/recipes-devtools/go/go-1.11/0006-cmd-dist-separate-host-and-target-builds.patch +++ /dev/null | |||
@@ -1,282 +0,0 @@ | |||
1 | From fe0fcaf43ef3aab81541dad2a71b46254dc4cf6a Mon Sep 17 00:00:00 2001 | ||
2 | From: Matt Madison <matt@madison.systems> | ||
3 | Date: Sat, 17 Feb 2018 10:03:48 -0800 | ||
4 | Subject: [PATCH] cmd/dist: separate host and target builds | ||
5 | |||
6 | Change the dist tool to allow for OE-style cross- | ||
7 | and 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 | |||
24 | Note that for --host-only builds, it would be nice to specify | ||
25 | just the "cmd" package to build only the go commands/tools, | ||
26 | the staleness checks in the dist tool will fail if the "std" | ||
27 | library has not also been built. So host-only builds have to | ||
28 | build everything anyway. | ||
29 | |||
30 | Upstream-Status: Inappropriate [OE specific] | ||
31 | |||
32 | Signed-off-by: Matt Madison <matt@madison.systems> | ||
33 | |||
34 | more dist cleanup | ||
35 | |||
36 | --- | ||
37 | src/cmd/dist/build.go | 153 ++++++++++++++++++++++++++++++------------ | ||
38 | 1 file changed, 111 insertions(+), 42 deletions(-) | ||
39 | |||
40 | Index: go/src/cmd/dist/build.go | ||
41 | =================================================================== | ||
42 | --- go.orig/src/cmd/dist/build.go | ||
43 | +++ go/src/cmd/dist/build.go | ||
44 | @@ -39,6 +39,7 @@ var ( | ||
45 | goldflags string | ||
46 | workdir string | ||
47 | tooldir string | ||
48 | + build_tooldir string | ||
49 | oldgoos string | ||
50 | oldgoarch string | ||
51 | exe string | ||
52 | @@ -50,6 +51,7 @@ var ( | ||
53 | |||
54 | rebuildall bool | ||
55 | defaultclang bool | ||
56 | + crossBuild bool | ||
57 | |||
58 | vflag int // verbosity | ||
59 | ) | ||
60 | @@ -231,6 +233,8 @@ func xinit() { | ||
61 | if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" { | ||
62 | tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) | ||
63 | } | ||
64 | + build_tooldir = pathf("%s/pkg/tool/native_native", goroot) | ||
65 | + | ||
66 | } | ||
67 | |||
68 | // compilerEnv returns a map from "goos/goarch" to the | ||
69 | @@ -260,7 +264,6 @@ func compilerEnv(envName, def string) ma | ||
70 | if gohostos != goos || gohostarch != goarch { | ||
71 | m[gohostos+"/"+gohostarch] = m[""] | ||
72 | } | ||
73 | - m[""] = env | ||
74 | } | ||
75 | |||
76 | for _, goos := range okgoos { | ||
77 | @@ -487,8 +490,10 @@ func setup() { | ||
78 | // We keep it in pkg/, just like the object directory above. | ||
79 | if rebuildall { | ||
80 | xremoveall(tooldir) | ||
81 | + xremoveall(build_tooldir) | ||
82 | } | ||
83 | xmkdirall(tooldir) | ||
84 | + xmkdirall(build_tooldir) | ||
85 | |||
86 | // Remove tool binaries from before the tool/gohostos_gohostarch | ||
87 | xremoveall(pathf("%s/bin/tool", goroot)) | ||
88 | @@ -1155,11 +1160,29 @@ func cmdbootstrap() { | ||
89 | |||
90 | var noBanner bool | ||
91 | var debug bool | ||
92 | + var hostOnly bool | ||
93 | + var targetOnly bool | ||
94 | + var toBuild = []string { "std", "cmd" } | ||
95 | + | ||
96 | flag.BoolVar(&rebuildall, "a", rebuildall, "rebuild all") | ||
97 | flag.BoolVar(&debug, "d", debug, "enable debugging of bootstrap process") | ||
98 | flag.BoolVar(&noBanner, "no-banner", noBanner, "do not print banner") | ||
99 | + flag.BoolVar(&hostOnly, "host-only", hostOnly, "build only host binaries, not target") | ||
100 | + flag.BoolVar(&targetOnly, "target-only", targetOnly, "build only target binaries, not host") | ||
101 | |||
102 | - xflagparse(0) | ||
103 | + xflagparse(-1) | ||
104 | + | ||
105 | + if (hostOnly && targetOnly) { | ||
106 | + fatalf("specify only one of --host-only or --target-only\n") | ||
107 | + } | ||
108 | + crossBuild = hostOnly || targetOnly | ||
109 | + if flag.NArg() > 0 { | ||
110 | + if crossBuild { | ||
111 | + toBuild = flag.Args() | ||
112 | + } else { | ||
113 | + fatalf("package names not permitted without --host-only or --target-only\n") | ||
114 | + } | ||
115 | + } | ||
116 | |||
117 | if debug { | ||
118 | // cmd/buildid is used in debug mode. | ||
119 | @@ -1207,8 +1230,13 @@ func cmdbootstrap() { | ||
120 | xprintf("\n") | ||
121 | } | ||
122 | |||
123 | - gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now | ||
124 | - goldflags = os.Getenv("GO_LDFLAGS") | ||
125 | + // For split host/target cross/cross-canadian builds, we don't | ||
126 | + // want to be setting these flags until after we have compiled | ||
127 | + // the toolchain that runs on the build host. | ||
128 | + if ! crossBuild { | ||
129 | + gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now | ||
130 | + goldflags = os.Getenv("GO_LDFLAGS") | ||
131 | + } | ||
132 | goBootstrap := pathf("%s/go_bootstrap", tooldir) | ||
133 | cmdGo := pathf("%s/go", gobin) | ||
134 | if debug { | ||
135 | @@ -1237,7 +1265,11 @@ func cmdbootstrap() { | ||
136 | xprintf("\n") | ||
137 | } | ||
138 | xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n") | ||
139 | - os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch)) | ||
140 | + if crossBuild { | ||
141 | + os.Setenv("CC", defaultcc[""]) | ||
142 | + } else { | ||
143 | + os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch)) | ||
144 | + } | ||
145 | goInstall(goBootstrap, append([]string{"-i"}, toolchain...)...) | ||
146 | if debug { | ||
147 | run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full") | ||
148 | @@ -1274,50 +1306,84 @@ func cmdbootstrap() { | ||
149 | } | ||
150 | checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...) | ||
151 | |||
152 | - if goos == oldgoos && goarch == oldgoarch { | ||
153 | - // Common case - not setting up for cross-compilation. | ||
154 | - timelog("build", "toolchain") | ||
155 | - if vflag > 0 { | ||
156 | - xprintf("\n") | ||
157 | + if crossBuild { | ||
158 | + gogcflags = os.Getenv("GO_GCFLAGS") | ||
159 | + goldflags = os.Getenv("GO_LDFLAGS") | ||
160 | + tool_files, _ := filepath.Glob(pathf("%s/*", tooldir)) | ||
161 | + for _, f := range tool_files { | ||
162 | + copyfile(pathf("%s/%s", build_tooldir, filepath.Base(f)), f, writeExec) | ||
163 | + xremove(f) | ||
164 | + } | ||
165 | + os.Setenv("GOTOOLDIR", build_tooldir) | ||
166 | + goBootstrap = pathf("%s/go_bootstrap", build_tooldir) | ||
167 | + if hostOnly { | ||
168 | + timelog("build", "host toolchain") | ||
169 | + if vflag > 0 { | ||
170 | + xprintf("\n") | ||
171 | + } | ||
172 | + xprintf("Building %s for host, %s/%s.\n", strings.Join(toBuild, ","), goos, goarch) | ||
173 | + goInstall(goBootstrap, toBuild...) | ||
174 | + checkNotStale(goBootstrap, toBuild...) | ||
175 | + // Skip cmdGo staleness checks here, since we can't necessarily run the cmdGo binary | ||
176 | + | ||
177 | + timelog("build", "target toolchain") | ||
178 | + if vflag > 0 { | ||
179 | + xprintf("\n") | ||
180 | + } | ||
181 | + } else if targetOnly { | ||
182 | + goos = oldgoos | ||
183 | + goarch = oldgoarch | ||
184 | + os.Setenv("GOOS", goos) | ||
185 | + os.Setenv("GOARCH", goarch) | ||
186 | + os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch)) | ||
187 | + xprintf("Building %s for target, %s/%s.\n", strings.Join(toBuild, ","), goos, goarch) | ||
188 | + goInstall(goBootstrap, toBuild...) | ||
189 | + checkNotStale(goBootstrap, toBuild...) | ||
190 | + // Skip cmdGo staleness checks here, since we can't run the target's cmdGo binary | ||
191 | } | ||
192 | - xprintf("Building packages and commands for %s/%s.\n", goos, goarch) | ||
193 | } else { | ||
194 | - // GOOS/GOARCH does not match GOHOSTOS/GOHOSTARCH. | ||
195 | - // Finish GOHOSTOS/GOHOSTARCH installation and then | ||
196 | - // run GOOS/GOARCH installation. | ||
197 | - timelog("build", "host toolchain") | ||
198 | - if vflag > 0 { | ||
199 | - xprintf("\n") | ||
200 | + | ||
201 | + if goos == oldgoos && goarch == oldgoarch { | ||
202 | + // Common case - not setting up for cross-compilation. | ||
203 | + timelog("build", "toolchain") | ||
204 | + if vflag > 0 { | ||
205 | + xprintf("\n") | ||
206 | + } | ||
207 | + xprintf("Building packages and commands for %s/%s.\n", goos, goarch) | ||
208 | + } else { | ||
209 | + // GOOS/GOARCH does not match GOHOSTOS/GOHOSTARCH. | ||
210 | + // Finish GOHOSTOS/GOHOSTARCH installation and then | ||
211 | + // run GOOS/GOARCH installation. | ||
212 | + timelog("build", "host toolchain") | ||
213 | + if vflag > 0 { | ||
214 | + xprintf("\n") | ||
215 | + } | ||
216 | + xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch) | ||
217 | + goInstall(goBootstrap, "std", "cmd") | ||
218 | + checkNotStale(goBootstrap, "std", "cmd") | ||
219 | + checkNotStale(cmdGo, "std", "cmd") | ||
220 | + | ||
221 | + timelog("build", "target toolchain") | ||
222 | + if vflag > 0 { | ||
223 | + xprintf("\n") | ||
224 | + } | ||
225 | + goos = oldgoos | ||
226 | + goarch = oldgoarch | ||
227 | + os.Setenv("GOOS", goos) | ||
228 | + os.Setenv("GOARCH", goarch) | ||
229 | + os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch)) | ||
230 | + xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch) | ||
231 | } | ||
232 | - xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch) | ||
233 | goInstall(goBootstrap, "std", "cmd") | ||
234 | checkNotStale(goBootstrap, "std", "cmd") | ||
235 | checkNotStale(cmdGo, "std", "cmd") | ||
236 | |||
237 | - timelog("build", "target toolchain") | ||
238 | - if vflag > 0 { | ||
239 | - xprintf("\n") | ||
240 | - } | ||
241 | - goos = oldgoos | ||
242 | - goarch = oldgoarch | ||
243 | - os.Setenv("GOOS", goos) | ||
244 | - os.Setenv("GOARCH", goarch) | ||
245 | - os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch)) | ||
246 | - xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch) | ||
247 | - } | ||
248 | - targets := []string{"std", "cmd"} | ||
249 | - if goos == "js" && goarch == "wasm" { | ||
250 | - // Skip the cmd tools for js/wasm. They're not usable. | ||
251 | - targets = targets[:1] | ||
252 | - } | ||
253 | - goInstall(goBootstrap, targets...) | ||
254 | - checkNotStale(goBootstrap, targets...) | ||
255 | - checkNotStale(cmdGo, targets...) | ||
256 | - if debug { | ||
257 | - run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full") | ||
258 | - run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch)) | ||
259 | - checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...) | ||
260 | - copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec) | ||
261 | + if debug { | ||
262 | + run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full") | ||
263 | + run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch)) | ||
264 | + checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...) | ||
265 | + copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec) | ||
266 | + } | ||
267 | } | ||
268 | |||
269 | // Check that there are no new files in $GOROOT/bin other than | ||
270 | @@ -1335,7 +1401,11 @@ func cmdbootstrap() { | ||
271 | } | ||
272 | |||
273 | // Remove go_bootstrap now that we're done. | ||
274 | - xremove(pathf("%s/go_bootstrap", tooldir)) | ||
275 | + // Except that for split host/target cross-builds, we need to | ||
276 | + // keep it. | ||
277 | + if ! crossBuild { | ||
278 | + xremove(pathf("%s/go_bootstrap", tooldir)) | ||
279 | + } | ||
280 | |||
281 | // Print trailing banner unless instructed otherwise. | ||
282 | if !noBanner { | ||
diff --git a/meta/recipes-devtools/go/go-1.11/0007-cmd-go-make-GOROOT-precious-by-default.patch b/meta/recipes-devtools/go/go-1.11/0007-cmd-go-make-GOROOT-precious-by-default.patch deleted file mode 100644 index 29ef947abd..0000000000 --- a/meta/recipes-devtools/go/go-1.11/0007-cmd-go-make-GOROOT-precious-by-default.patch +++ /dev/null | |||
@@ -1,106 +0,0 @@ | |||
1 | From 7cc60b3887be2d5674b9f5d422d022976cf205e5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Matt Madison <matt@madison.systems> | ||
3 | Date: Fri, 2 Mar 2018 06:00:20 -0800 | ||
4 | Subject: [PATCH] cmd/go: make GOROOT precious by default | ||
5 | |||
6 | The go build tool normally rebuilds whatever it detects is | ||
7 | stale. This can be a problem when GOROOT is intended to | ||
8 | be read-only and the go runtime has been built as a shared | ||
9 | library, since we don't want every application to be rebuilding | ||
10 | the shared runtime - particularly in cross-build/packaging | ||
11 | setups, since that would lead to 'abi mismatch' runtime errors. | ||
12 | |||
13 | This patch prevents the install and linkshared actions from | ||
14 | installing to GOROOT unless overridden with the GOROOT_OVERRIDE | ||
15 | environment variable. | ||
16 | |||
17 | Upstream-Status: Inappropriate [OE specific] | ||
18 | |||
19 | Signed-off-by: Matt Madison <matt@madison.systems> | ||
20 | |||
21 | --- | ||
22 | src/cmd/go/internal/work/action.go | 3 +++ | ||
23 | src/cmd/go/internal/work/build.go | 5 +++++ | ||
24 | src/cmd/go/internal/work/exec.go | 25 +++++++++++++++++++++++++ | ||
25 | 3 files changed, 33 insertions(+) | ||
26 | |||
27 | Index: go/src/cmd/go/internal/work/action.go | ||
28 | =================================================================== | ||
29 | --- go.orig/src/cmd/go/internal/work/action.go | ||
30 | +++ go/src/cmd/go/internal/work/action.go | ||
31 | @@ -600,6 +600,9 @@ func (b *Builder) addTransitiveLinkDeps( | ||
32 | if p1 == nil || p1.Shlib == "" || haveShlib[filepath.Base(p1.Shlib)] { | ||
33 | continue | ||
34 | } | ||
35 | + if goRootPrecious && (p1.Standard || p1.Goroot) { | ||
36 | + continue | ||
37 | + } | ||
38 | haveShlib[filepath.Base(p1.Shlib)] = true | ||
39 | // TODO(rsc): The use of ModeInstall here is suspect, but if we only do ModeBuild, | ||
40 | // we'll end up building an overall library or executable that depends at runtime | ||
41 | Index: go/src/cmd/go/internal/work/build.go | ||
42 | =================================================================== | ||
43 | --- go.orig/src/cmd/go/internal/work/build.go | ||
44 | +++ go/src/cmd/go/internal/work/build.go | ||
45 | @@ -147,6 +147,7 @@ See also: go install, go get, go clean. | ||
46 | } | ||
47 | |||
48 | const concurrentGCBackendCompilationEnabledByDefault = true | ||
49 | +var goRootPrecious bool = true | ||
50 | |||
51 | func init() { | ||
52 | // break init cycle | ||
53 | @@ -160,6 +161,10 @@ func init() { | ||
54 | |||
55 | AddBuildFlags(CmdBuild) | ||
56 | AddBuildFlags(CmdInstall) | ||
57 | + | ||
58 | + if x := os.Getenv("GOROOT_OVERRIDE"); x != "" { | ||
59 | + goRootPrecious = false | ||
60 | + } | ||
61 | } | ||
62 | |||
63 | // Note that flags consulted by other parts of the code | ||
64 | Index: go/src/cmd/go/internal/work/exec.go | ||
65 | =================================================================== | ||
66 | --- go.orig/src/cmd/go/internal/work/exec.go | ||
67 | +++ go/src/cmd/go/internal/work/exec.go | ||
68 | @@ -436,6 +436,23 @@ func (b *Builder) build(a *Action) (err | ||
69 | return fmt.Errorf("missing or invalid binary-only package; expected file %q", a.Package.Target) | ||
70 | } | ||
71 | |||
72 | + if goRootPrecious && (a.Package.Standard || a.Package.Goroot) { | ||
73 | + _, err := os.Stat(a.Package.Target) | ||
74 | + if err == nil { | ||
75 | + a.built = a.Package.Target | ||
76 | + a.Target = a.Package.Target | ||
77 | + a.buildID = b.fileHash(a.Package.Target) | ||
78 | + a.Package.Stale = false | ||
79 | + a.Package.StaleReason = "GOROOT-resident package" | ||
80 | + return nil | ||
81 | + } | ||
82 | + a.Package.Stale = true | ||
83 | + a.Package.StaleReason = "missing or invalid GOROOT-resident package" | ||
84 | + if b.IsCmdList { | ||
85 | + return nil | ||
86 | + } | ||
87 | + } | ||
88 | + | ||
89 | if err := b.Mkdir(a.Objdir); err != nil { | ||
90 | return err | ||
91 | } | ||
92 | @@ -1438,6 +1455,14 @@ func BuildInstallFunc(b *Builder, a *Act | ||
93 | return nil | ||
94 | } | ||
95 | |||
96 | + if goRootPrecious && a.Package != nil { | ||
97 | + p := a.Package | ||
98 | + if p.Standard || p.Goroot { | ||
99 | + err := fmt.Errorf("attempting to install package %s into read-only GOROOT", p.ImportPath) | ||
100 | + return err | ||
101 | + } | ||
102 | + } | ||
103 | + | ||
104 | if err := b.Mkdir(a.Objdir); err != nil { | ||
105 | return err | ||
106 | } | ||
diff --git a/meta/recipes-devtools/go/go-1.11/0008-use-GOBUILDMODE-to-set-buildmode.patch b/meta/recipes-devtools/go/go-1.11/0008-use-GOBUILDMODE-to-set-buildmode.patch deleted file mode 100644 index 225cf439c5..0000000000 --- a/meta/recipes-devtools/go/go-1.11/0008-use-GOBUILDMODE-to-set-buildmode.patch +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | From 0e0c247f0caec23528889ff09d98348cba9028f1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
3 | Date: Fri, 26 Oct 2018 15:02:32 +0800 | ||
4 | Subject: [PATCH] use GOBUILDMODE to set buildmode | ||
5 | |||
6 | While building go itself, the go build system does not support | ||
7 | to set `-buildmode=pie' from environment. | ||
8 | |||
9 | Add GOBUILDMODE to support it which make PIE executables the default | ||
10 | build mode, as PIE executables are required as of Yocto | ||
11 | |||
12 | Refers: https://groups.google.com/forum/#!topic/golang-dev/gRCe5URKewI | ||
13 | Upstream-Status: Denied [upstream choose antoher solution: `17a256b | ||
14 | cmd/go: -buildmode=pie for android/arm'] | ||
15 | |||
16 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
17 | --- | ||
18 | src/cmd/go/internal/work/build.go | 6 +++++- | ||
19 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
20 | |||
21 | Index: go/src/cmd/go/internal/work/build.go | ||
22 | =================================================================== | ||
23 | --- go.orig/src/cmd/go/internal/work/build.go | ||
24 | +++ go/src/cmd/go/internal/work/build.go | ||
25 | @@ -223,7 +223,11 @@ func AddBuildFlags(cmd *base.Command) { | ||
26 | |||
27 | cmd.Flag.Var(&load.BuildAsmflags, "asmflags", "") | ||
28 | cmd.Flag.Var(buildCompiler{}, "compiler", "") | ||
29 | - cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", "default", "") | ||
30 | + if bm := os.Getenv("GOBUILDMODE"); bm != "" { | ||
31 | + cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", bm, "") | ||
32 | + } else { | ||
33 | + cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", "default", "") | ||
34 | + } | ||
35 | cmd.Flag.Var(&load.BuildGcflags, "gcflags", "") | ||
36 | cmd.Flag.Var(&load.BuildGccgoflags, "gccgoflags", "") | ||
37 | cmd.Flag.StringVar(&cfg.BuildMod, "mod", "", "") | ||
diff --git a/meta/recipes-devtools/go/go-1.11/0009-ld-replace-glibc-dynamic-linker-with-musl.patch b/meta/recipes-devtools/go/go-1.11/0009-ld-replace-glibc-dynamic-linker-with-musl.patch deleted file mode 100644 index fd67375c7f..0000000000 --- a/meta/recipes-devtools/go/go-1.11/0009-ld-replace-glibc-dynamic-linker-with-musl.patch +++ /dev/null | |||
@@ -1,128 +0,0 @@ | |||
1 | From 35ea4be34e94912b00837e0f7c7385f2e98fe769 Mon Sep 17 00:00:00 2001 | ||
2 | From: Matt Madison <matt@madison.systems> | ||
3 | Date: Sun, 18 Feb 2018 08:24:05 -0800 | ||
4 | Subject: [PATCH] ld: replace glibc dynamic linker with musl | ||
5 | |||
6 | Rework of patch by Khem Raj <raj.khem@gmail.com> | ||
7 | for go 1.10. Should be applied conditionally on | ||
8 | musl being the system C library. | ||
9 | |||
10 | Upstream-Status: Inappropriate [Real fix should be portable across libcs] | ||
11 | |||
12 | Signed-off-by: Matt Madison <matt@madison.systems> | ||
13 | |||
14 | --- | ||
15 | src/cmd/link/internal/amd64/obj.go | 2 +- | ||
16 | src/cmd/link/internal/arm/obj.go | 2 +- | ||
17 | src/cmd/link/internal/arm64/obj.go | 2 +- | ||
18 | src/cmd/link/internal/mips/obj.go | 2 +- | ||
19 | src/cmd/link/internal/mips64/obj.go | 2 +- | ||
20 | src/cmd/link/internal/ppc64/obj.go | 2 +- | ||
21 | src/cmd/link/internal/s390x/obj.go | 2 +- | ||
22 | src/cmd/link/internal/x86/obj.go | 2 +- | ||
23 | 8 files changed, 8 insertions(+), 8 deletions(-) | ||
24 | |||
25 | diff --git a/src/cmd/link/internal/amd64/obj.go b/src/cmd/link/internal/amd64/obj.go | ||
26 | index 87e8091..f522a63 100644 | ||
27 | --- a/src/cmd/link/internal/amd64/obj.go | ||
28 | +++ b/src/cmd/link/internal/amd64/obj.go | ||
29 | @@ -62,7 +62,7 @@ func Init() (*sys.Arch, ld.Arch) { | ||
30 | PEreloc1: pereloc1, | ||
31 | TLSIEtoLE: tlsIEtoLE, | ||
32 | |||
33 | - Linuxdynld: "/lib64/ld-linux-x86-64.so.2", | ||
34 | + Linuxdynld: "/lib64/ld-musl-x86-64.so.1", | ||
35 | Freebsddynld: "/libexec/ld-elf.so.1", | ||
36 | Openbsddynld: "/usr/libexec/ld.so", | ||
37 | Netbsddynld: "/libexec/ld.elf_so", | ||
38 | diff --git a/src/cmd/link/internal/arm/obj.go b/src/cmd/link/internal/arm/obj.go | ||
39 | index 788be68..1d2b90e 100644 | ||
40 | --- a/src/cmd/link/internal/arm/obj.go | ||
41 | +++ b/src/cmd/link/internal/arm/obj.go | ||
42 | @@ -58,7 +58,7 @@ func Init() (*sys.Arch, ld.Arch) { | ||
43 | Gentext: gentext, | ||
44 | Machoreloc1: machoreloc1, | ||
45 | |||
46 | - Linuxdynld: "/lib/ld-linux.so.3", // 2 for OABI, 3 for EABI | ||
47 | + Linuxdynld: "/lib/ld-musl-armhf.so.1", | ||
48 | Freebsddynld: "/usr/libexec/ld-elf.so.1", | ||
49 | Openbsddynld: "/usr/libexec/ld.so", | ||
50 | Netbsddynld: "/libexec/ld.elf_so", | ||
51 | diff --git a/src/cmd/link/internal/arm64/obj.go b/src/cmd/link/internal/arm64/obj.go | ||
52 | index 405d22d..b115659 100644 | ||
53 | --- a/src/cmd/link/internal/arm64/obj.go | ||
54 | +++ b/src/cmd/link/internal/arm64/obj.go | ||
55 | @@ -57,7 +57,7 @@ func Init() (*sys.Arch, ld.Arch) { | ||
56 | Gentext: gentext, | ||
57 | Machoreloc1: machoreloc1, | ||
58 | |||
59 | - Linuxdynld: "/lib/ld-linux-aarch64.so.1", | ||
60 | + Linuxdynld: "/lib/ld-musl-aarch64.so.1", | ||
61 | |||
62 | Freebsddynld: "XXX", | ||
63 | Openbsddynld: "XXX", | ||
64 | diff --git a/src/cmd/link/internal/mips/obj.go b/src/cmd/link/internal/mips/obj.go | ||
65 | index c5d3451..fd85e63 100644 | ||
66 | --- a/src/cmd/link/internal/mips/obj.go | ||
67 | +++ b/src/cmd/link/internal/mips/obj.go | ||
68 | @@ -60,7 +60,7 @@ func Init() (*sys.Arch, ld.Arch) { | ||
69 | Gentext: gentext, | ||
70 | Machoreloc1: machoreloc1, | ||
71 | |||
72 | - Linuxdynld: "/lib/ld.so.1", | ||
73 | + Linuxdynld: "/lib/ld-musl-mipsle.so.1", | ||
74 | |||
75 | Freebsddynld: "XXX", | ||
76 | Openbsddynld: "XXX", | ||
77 | diff --git a/src/cmd/link/internal/mips64/obj.go b/src/cmd/link/internal/mips64/obj.go | ||
78 | index 83974e5..097224f 100644 | ||
79 | --- a/src/cmd/link/internal/mips64/obj.go | ||
80 | +++ b/src/cmd/link/internal/mips64/obj.go | ||
81 | @@ -59,7 +59,7 @@ func Init() (*sys.Arch, ld.Arch) { | ||
82 | Gentext: gentext, | ||
83 | Machoreloc1: machoreloc1, | ||
84 | |||
85 | - Linuxdynld: "/lib64/ld64.so.1", | ||
86 | + Linuxdynld: "/lib64/ld-musl-mips64le.so.1", | ||
87 | Freebsddynld: "XXX", | ||
88 | Openbsddynld: "XXX", | ||
89 | Netbsddynld: "XXX", | ||
90 | diff --git a/src/cmd/link/internal/ppc64/obj.go b/src/cmd/link/internal/ppc64/obj.go | ||
91 | index 273d9b4..a503abe 100644 | ||
92 | --- a/src/cmd/link/internal/ppc64/obj.go | ||
93 | +++ b/src/cmd/link/internal/ppc64/obj.go | ||
94 | @@ -62,7 +62,7 @@ func Init() (*sys.Arch, ld.Arch) { | ||
95 | Machoreloc1: machoreloc1, | ||
96 | |||
97 | // TODO(austin): ABI v1 uses /usr/lib/ld.so.1, | ||
98 | - Linuxdynld: "/lib64/ld64.so.1", | ||
99 | + Linuxdynld: "/lib64/ld-musl-powerpc64le.so.1", | ||
100 | |||
101 | Freebsddynld: "XXX", | ||
102 | Openbsddynld: "XXX", | ||
103 | diff --git a/src/cmd/link/internal/s390x/obj.go b/src/cmd/link/internal/s390x/obj.go | ||
104 | index 9ac7eb8..3825ff7 100644 | ||
105 | --- a/src/cmd/link/internal/s390x/obj.go | ||
106 | +++ b/src/cmd/link/internal/s390x/obj.go | ||
107 | @@ -57,7 +57,7 @@ func Init() (*sys.Arch, ld.Arch) { | ||
108 | Gentext: gentext, | ||
109 | Machoreloc1: machoreloc1, | ||
110 | |||
111 | - Linuxdynld: "/lib64/ld64.so.1", | ||
112 | + Linuxdynld: "/lib64/ld-musl-s390x.so.1", | ||
113 | |||
114 | // not relevant for s390x | ||
115 | Freebsddynld: "XXX", | ||
116 | diff --git a/src/cmd/link/internal/x86/obj.go b/src/cmd/link/internal/x86/obj.go | ||
117 | index 6a744dc..d81f392 100644 | ||
118 | --- a/src/cmd/link/internal/x86/obj.go | ||
119 | +++ b/src/cmd/link/internal/x86/obj.go | ||
120 | @@ -58,7 +58,7 @@ func Init() (*sys.Arch, ld.Arch) { | ||
121 | Machoreloc1: machoreloc1, | ||
122 | PEreloc1: pereloc1, | ||
123 | |||
124 | - Linuxdynld: "/lib/ld-linux.so.2", | ||
125 | + Linuxdynld: "/lib/ld-musl-i386.so.1", | ||
126 | Freebsddynld: "/usr/libexec/ld-elf.so.1", | ||
127 | Openbsddynld: "/usr/libexec/ld.so", | ||
128 | Netbsddynld: "/usr/libexec/ld.elf_so", | ||
diff --git a/meta/recipes-devtools/go/go-cross-canadian_1.11.bb b/meta/recipes-devtools/go/go-cross-canadian_1.11.bb deleted file mode 100644 index 7ac9449e47..0000000000 --- a/meta/recipes-devtools/go/go-cross-canadian_1.11.bb +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | require go-cross-canadian.inc | ||
2 | require go-${PV}.inc | ||
diff --git a/meta/recipes-devtools/go/go-cross_1.11.bb b/meta/recipes-devtools/go/go-cross_1.11.bb deleted file mode 100644 index 80b5a03f6c..0000000000 --- a/meta/recipes-devtools/go/go-cross_1.11.bb +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | require go-cross.inc | ||
2 | require go-${PV}.inc | ||
diff --git a/meta/recipes-devtools/go/go-crosssdk_1.11.bb b/meta/recipes-devtools/go/go-crosssdk_1.11.bb deleted file mode 100644 index 1857c8a577..0000000000 --- a/meta/recipes-devtools/go/go-crosssdk_1.11.bb +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | require go-crosssdk.inc | ||
2 | require go-${PV}.inc | ||
diff --git a/meta/recipes-devtools/go/go-native_1.11.bb b/meta/recipes-devtools/go/go-native_1.11.bb deleted file mode 100644 index bbf3c0dd73..0000000000 --- a/meta/recipes-devtools/go/go-native_1.11.bb +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | require ${PN}.inc | ||
2 | require go-${PV}.inc | ||
diff --git a/meta/recipes-devtools/go/go-runtime_1.11.bb b/meta/recipes-devtools/go/go-runtime_1.11.bb deleted file mode 100644 index 43b68b4e46..0000000000 --- a/meta/recipes-devtools/go/go-runtime_1.11.bb +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | require go-${PV}.inc | ||
2 | require go-runtime.inc | ||
diff --git a/meta/recipes-devtools/go/go_1.11.bb b/meta/recipes-devtools/go/go_1.11.bb deleted file mode 100644 index 42cdb0430a..0000000000 --- a/meta/recipes-devtools/go/go_1.11.bb +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | require go-${PV}.inc | ||
2 | require go-target.inc | ||
3 | |||
4 | export GOBUILDMODE="" | ||
5 | |||
6 | # Add pie to GOBUILDMODE to satisfy "textrel" QA checking, but mips | ||
7 | # doesn't support -buildmode=pie, so skip the QA checking for mips and its | ||
8 | # variants. | ||
9 | python() { | ||
10 | if 'mips' in d.getVar('TARGET_ARCH'): | ||
11 | d.appendVar('INSANE_SKIP_%s' % d.getVar('PN'), " textrel") | ||
12 | else: | ||
13 | d.setVar('GOBUILDMODE', 'pie') | ||
14 | } | ||