blob: 608f1eb5a01aa226656fc2014a3d737a1d6720e6 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001From 8f020921c464e95ded850950382115154448580a Mon Sep 17 00:00:00 2001
Andrew Geissler595f6302022-01-24 19:11:47 +00002From: Alex Kube <alexander.j.kube@gmail.com>
3Date: Wed, 23 Oct 2019 21:17:16 +0430
4Subject: [PATCH] make.bash: override CC when building dist and go_bootstrap
5
6for handling OE cross-canadian builds.
7
8Adapted to Go 1.13 from patches originally submitted to
9the meta/recipes-devtools/go tree by
10Matt Madison <matt@madison.systems>.
11
12Upstream-Status: Inappropriate [OE specific]
13
14Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
15
16---
17 src/make.bash | 4 ++--
18 1 file changed, 2 insertions(+), 2 deletions(-)
19
Patrick Williams92b42cb2022-09-03 06:53:57 -050020diff --git a/src/make.bash b/src/make.bash
21index ab2ce19..37ec1fb 100755
Andrew Geissler595f6302022-01-24 19:11:47 +000022--- a/src/make.bash
23+++ b/src/make.bash
Patrick Williams92b42cb2022-09-03 06:53:57 -050024@@ -198,7 +198,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then
Andrew Geissler595f6302022-01-24 19:11:47 +000025 exit 1
26 fi
27 rm -f cmd/dist/dist
Patrick Williams92b42cb2022-09-03 06:53:57 -050028-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off GOEXPERIMENT="" GOENV=off GOFLAGS="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
29+CC="${BUILD_CC:-${CC}}" GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off GOEXPERIMENT="" GOENV=off GOFLAGS="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
Andrew Geissler595f6302022-01-24 19:11:47 +000030
31 # -e doesn't propagate out of eval, so check success by hand.
32 eval $(./cmd/dist/dist env -p || echo FAIL=true)
Patrick Williams92b42cb2022-09-03 06:53:57 -050033@@ -223,7 +223,7 @@ fi
Andrew Geissler595f6302022-01-24 19:11:47 +000034 # Run dist bootstrap to complete make.bash.
35 # Bootstrap installs a proper cmd/dist, built with the new toolchain.
36 # Throw ours, built with Go 1.4, away after bootstrap.
37-./cmd/dist/dist bootstrap -a $vflag $GO_DISTFLAGS "$@"
38+CC="${BUILD_CC:-${CC}}" ./cmd/dist/dist bootstrap -a $vflag $GO_DISTFLAGS "$@"
39 rm -f ./cmd/dist/dist
40
41 # DO NOT ADD ANY NEW CODE HERE.