summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMatt Madison <matt@madison.systems>2017-12-06 09:17:03 -0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-12-07 12:23:43 +0000
commit551d18e4b86e81a44d7b81613fb945fe27461a41 (patch)
tree2a4f53a973729750b5a53e4bcdad64b6af9d5647 /meta
parent7030d5b4f9a802110a403572765a046af12d2acd (diff)
downloadpoky-551d18e4b86e81a44d7b81613fb945fe27461a41.tar.gz
go: ensure use of BUILD_CC when building bootstrap tools
For cross-canadian builds, we were accidentally using the crosssdk C compiler when building the Go compiler bootstrap. Add a patch to the make script to let us use BUILD_CC, and prepend do_compile to set it in the local environment to ensure that the trailing blank gets stripped, since that confuses Go. [YOCTO #12341] (From OE-Core rev: 70278eb86bc5bcbe3fa53c62f971fa467f61e28f) Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Ross Burton <ross.burton@intel.com> (cherry picked from commit 0dbb860924fc157880b52d8e08bad3c6c6b019b8) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/go/go-1.9.inc1
-rw-r--r--meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch43
-rw-r--r--meta/recipes-devtools/go/go-common.inc4
3 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-1.9.inc b/meta/recipes-devtools/go/go-1.9.inc
index 60292651df..7f12241dc1 100644
--- a/meta/recipes-devtools/go/go-1.9.inc
+++ b/meta/recipes-devtools/go/go-1.9.inc
@@ -15,6 +15,7 @@ SRC_URI += "\
15 file://0007-ld-add-soname-to-shareable-objects.patch \ 15 file://0007-ld-add-soname-to-shareable-objects.patch \
16 file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch \ 16 file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch \
17 file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch \ 17 file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch \
18 file://0010-make.bash-override-CC-when-building-dist-and-go_boot.patch \
18" 19"
19SRC_URI_append_libc-musl = " file://set-external-linker.patch" 20SRC_URI_append_libc-musl = " file://set-external-linker.patch"
20 21
diff --git a/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch
new file mode 100644
index 0000000000..83fd78c3d7
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch
@@ -0,0 +1,43 @@
1From 21d83dd9499e5be30eea28dd7034d1ea2a01c838 Mon Sep 17 00:00:00 2001
2From: Matt Madison <matt@madison.systems>
3Date: Tue, 14 Nov 2017 07:38:42 -0800
4Subject: [PATCH 10/10] make.bash: override CC when building dist and
5 go_bootstrap
6
7For cross-canadian builds, dist and go_bootstrap
8run on the build host, so CC needs to point to the
9build host's C compiler. Add a BUILD_CC environment
10for this, falling back to $CC if not present.
11
12Upstream-Status: Pending
13
14Signed-off-by: Matt Madison <matt@madison.systems>
15---
16 src/make.bash | 4 ++--
17 1 file changed, 2 insertions(+), 2 deletions(-)
18
19diff --git a/src/make.bash b/src/make.bash
20index 0bdadc6..f199349 100755
21--- a/src/make.bash
22+++ b/src/make.bash
23@@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then
24 exit 1
25 fi
26 rm -f cmd/dist/dist
27-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
28+CC=${BUILD_CC:-${CC}} GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
29
30 # -e doesn't propagate out of eval, so check success by hand.
31 eval $(./cmd/dist/dist env -p || echo FAIL=true)
32@@ -167,7 +167,7 @@ elif [ "$1" = "--host-only" ]; then
33 fi
34
35 if [ "$do_host_build" = "yes" ]; then
36- ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
37+ CC=${BUILD_CC:-${CC}} ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
38 # Delay move of dist tool to now, because bootstrap may clear tool directory.
39 mv cmd/dist/dist "$GOTOOLDIR"/dist
40 echo
41--
422.7.4
43
diff --git a/meta/recipes-devtools/go/go-common.inc b/meta/recipes-devtools/go/go-common.inc
index ce1eb86812..9af68738a6 100644
--- a/meta/recipes-devtools/go/go-common.inc
+++ b/meta/recipes-devtools/go/go-common.inc
@@ -20,3 +20,7 @@ B = "${S}"
20 20
21INHIBIT_PACKAGE_DEBUG_SPLIT = "1" 21INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
22SSTATE_SCAN_CMD = "true" 22SSTATE_SCAN_CMD = "true"
23
24do_compile_prepend() {
25 BUILD_CC=${BUILD_CC}
26}