summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-devtools/go/go-1.15.inc5
-rw-r--r--meta/recipes-devtools/go/go-1.15/0009-cmd-go-permit-CGO_LDFLAGS-to-appear-in-go-ldflag.patch100
-rw-r--r--meta/recipes-devtools/go/go-binary-native_1.15.6.bb (renamed from meta/recipes-devtools/go/go-binary-native_1.15.5.bb)4
3 files changed, 4 insertions, 105 deletions
diff --git a/meta/recipes-devtools/go/go-1.15.inc b/meta/recipes-devtools/go/go-1.15.inc
index ccfb0c5987..abe74e5eb7 100644
--- a/meta/recipes-devtools/go/go-1.15.inc
+++ b/meta/recipes-devtools/go/go-1.15.inc
@@ -1,7 +1,7 @@
1require go-common.inc 1require go-common.inc
2 2
3GO_BASEVERSION = "1.15" 3GO_BASEVERSION = "1.15"
4PV = "1.15.5" 4PV = "1.15.6"
5FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:" 5FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
6 6
7LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707" 7LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
@@ -15,6 +15,5 @@ SRC_URI += "\
15 file://0006-cmd-dist-separate-host-and-target-builds.patch \ 15 file://0006-cmd-dist-separate-host-and-target-builds.patch \
16 file://0007-cmd-go-make-GOROOT-precious-by-default.patch \ 16 file://0007-cmd-go-make-GOROOT-precious-by-default.patch \
17 file://0008-use-GOBUILDMODE-to-set-buildmode.patch \ 17 file://0008-use-GOBUILDMODE-to-set-buildmode.patch \
18 file://0009-cmd-go-permit-CGO_LDFLAGS-to-appear-in-go-ldflag.patch \
19" 18"
20SRC_URI[main.sha256sum] = "c1076b90cf94b73ebed62a81d802cd84d43d02dea8c07abdc922c57a071c84f1" 19SRC_URI[main.sha256sum] = "890bba73c5e2b19ffb1180e385ea225059eb008eb91b694875dd86ea48675817"
diff --git a/meta/recipes-devtools/go/go-1.15/0009-cmd-go-permit-CGO_LDFLAGS-to-appear-in-go-ldflag.patch b/meta/recipes-devtools/go/go-1.15/0009-cmd-go-permit-CGO_LDFLAGS-to-appear-in-go-ldflag.patch
deleted file mode 100644
index b57041f1db..0000000000
--- a/meta/recipes-devtools/go/go-1.15/0009-cmd-go-permit-CGO_LDFLAGS-to-appear-in-go-ldflag.patch
+++ /dev/null
@@ -1,100 +0,0 @@
1From 4759221d46b1666de96b8047cec3160bfe4d3d5d Mon Sep 17 00:00:00 2001
2From: Ian Lance Taylor <iant@golang.org>
3Date: Fri, 13 Nov 2020 11:05:37 -0800
4Subject: [PATCH] cmd/go: permit CGO_LDFLAGS to appear in //go:ldflag
5
6Fixes #42565
7
8Upstream-Status: Backport [https://github.com/golang/go/commit/782cf560db4c919790fdb476d1bbe18e5ddf5ffd]
9Change-Id: If7cf39905d124dbd54dfac6a53ee38270498efed
10Reviewed-on: https://go-review.googlesource.com/c/go/+/269818
11Trust: Ian Lance Taylor <iant@golang.org>
12Run-TryBot: Ian Lance Taylor <iant@golang.org>
13TryBot-Result: Go Bot <gobot@golang.org>
14Reviewed-by: Jay Conrod <jayconrod@google.com>
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 src/cmd/go/internal/work/exec.go | 15 +++++++++
18 src/cmd/go/testdata/script/ldflag.txt | 44 +++++++++++++++++++++++++++
19 2 files changed, 59 insertions(+)
20 create mode 100644 src/cmd/go/testdata/script/ldflag.txt
21
22diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
23index 575a2df..9209e3d 100644
24--- a/src/cmd/go/internal/work/exec.go
25+++ b/src/cmd/go/internal/work/exec.go
26@@ -2821,6 +2821,21 @@ func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgo
27 idx = bytes.Index(src, []byte(cgoLdflag))
28 }
29 }
30+
31+ // We expect to find the contents of cgoLDFLAGS in flags.
32+ if len(cgoLDFLAGS) > 0 {
33+ outer:
34+ for i := range flags {
35+ for j, f := range cgoLDFLAGS {
36+ if f != flags[i+j] {
37+ continue outer
38+ }
39+ }
40+ flags = append(flags[:i], flags[i+len(cgoLDFLAGS):]...)
41+ break
42+ }
43+ }
44+
45 if err := checkLinkerFlags("LDFLAGS", "go:cgo_ldflag", flags); err != nil {
46 return nil, nil, err
47 }
48diff --git a/src/cmd/go/testdata/script/ldflag.txt b/src/cmd/go/testdata/script/ldflag.txt
49new file mode 100644
50index 0000000..6ceb33b
51--- /dev/null
52+++ b/src/cmd/go/testdata/script/ldflag.txt
53@@ -0,0 +1,44 @@
54+# Issue #42565
55+
56+[!cgo] skip
57+
58+# We can't build package bad, which uses #cgo LDFLAGS.
59+cd bad
60+! go build
61+stderr no-such-warning
62+
63+# We can build package ok with the same flags in CGO_LDFLAGS.
64+env CGO_LDFLAGS=-Wno-such-warning -Wno-unknown-warning-option
65+cd ../ok
66+go build
67+
68+# Build a main program that actually uses LDFLAGS.
69+cd ..
70+go build -ldflags=-v
71+
72+# Because we passed -v the Go linker should print the external linker
73+# command which should include the flag we passed in CGO_LDFLAGS.
74+stderr no-such-warning
75+
76+-- go.mod --
77+module ldflag
78+
79+-- bad/bad.go --
80+package bad
81+
82+// #cgo LDFLAGS: -Wno-such-warning -Wno-unknown-warning
83+import "C"
84+
85+func F() {}
86+-- ok/ok.go --
87+package ok
88+
89+import "C"
90+
91+func F() {}
92+-- main.go --
93+package main
94+
95+import _ "ldflag/ok"
96+
97+func main() {}
98--
992.29.2
100
diff --git a/meta/recipes-devtools/go/go-binary-native_1.15.5.bb b/meta/recipes-devtools/go/go-binary-native_1.15.6.bb
index 1fb11b0435..622557ad2b 100644
--- a/meta/recipes-devtools/go/go-binary-native_1.15.5.bb
+++ b/meta/recipes-devtools/go/go-binary-native_1.15.6.bb
@@ -8,8 +8,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
8PROVIDES = "go-native" 8PROVIDES = "go-native"
9 9
10SRC_URI = "https://dl.google.com/go/go${PV}.${BUILD_GOOS}-${BUILD_GOARCH}.tar.gz;name=go_${BUILD_GOTUPLE}" 10SRC_URI = "https://dl.google.com/go/go${PV}.${BUILD_GOOS}-${BUILD_GOARCH}.tar.gz;name=go_${BUILD_GOTUPLE}"
11SRC_URI[go_linux_amd64.sha256sum] = "9a58494e8da722c3aef248c9227b0e9c528c7318309827780f16220998180a0d" 11SRC_URI[go_linux_amd64.sha256sum] = "3918e6cc85e7eaaa6f859f1bdbaac772e7a825b0eb423c63d3ae68b21f84b844"
12SRC_URI[go_linux_arm64.sha256sum] = "a72a0b036beb4193a0214bca3fca4c5d68a38a4ccf098c909f7ce8bf08567c48" 12SRC_URI[go_linux_arm64.sha256sum] = "f87515b9744154ffe31182da9341d0a61eb0795551173d242c8cad209239e492"
13 13
14UPSTREAM_CHECK_URI = "https://golang.org/dl/" 14UPSTREAM_CHECK_URI = "https://golang.org/dl/"
15UPSTREAM_CHECK_REGEX = "go(?P<pver>\d+(\.\d+)+)\.linux" 15UPSTREAM_CHECK_REGEX = "go(?P<pver>\d+(\.\d+)+)\.linux"