mirror of
https://git.yoctoproject.org/poky
synced 2026-02-20 08:29:42 +01:00
go: Drop GOBUILDMODE
This is local invention which is no longer needed, pie-mode works good now a days to build go for target (From OE-Core rev: 118411a565fb39df4bbae2a0ef2b25f03607a3a5) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -11,7 +11,6 @@ SRC_URI += "\
|
||||
file://0005-make.bash-override-CC-when-building-dist-and-go_boot.patch \
|
||||
file://0006-cmd-dist-separate-host-and-target-builds.patch \
|
||||
file://0007-cmd-go-make-GOROOT-precious-by-default.patch \
|
||||
file://0008-use-GOBUILDMODE-to-set-buildmode.patch \
|
||||
file://0001-exec.go-do-not-write-linker-flags-into-buildids.patch \
|
||||
file://0001-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch \
|
||||
"
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
From 971b5626339ce0c4d57f9721c9a81af566c5a044 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Kube <alexander.j.kube@gmail.com>
|
||||
Date: Wed, 23 Oct 2019 21:19:26 +0430
|
||||
Subject: [PATCH 8/9] cmd/go: Use GOBUILDMODE to set buildmode
|
||||
|
||||
Upstream-Status: Denied [upstream choose antoher solution: `17a256b
|
||||
cmd/go: -buildmode=pie for android/arm']
|
||||
|
||||
While building go itself, the go build system does not support
|
||||
to set `-buildmode=pie' from environment.
|
||||
|
||||
Add GOBUILDMODE to support it which make PIE executables the default
|
||||
build mode, as PIE executables are required as of Yocto
|
||||
|
||||
Refers: https://groups.google.com/forum/#!topic/golang-dev/gRCe5URKewI
|
||||
|
||||
Adapted to Go 1.13 from patches originally submitted to
|
||||
the meta/recipes-devtools/go tree by
|
||||
Hongxu Jia <hongxu.jia@windriver.com>
|
||||
|
||||
Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
|
||||
---
|
||||
src/cmd/go/internal/work/build.go | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/src/cmd/go/internal/work/build.go
|
||||
+++ b/src/cmd/go/internal/work/build.go
|
||||
@@ -283,7 +283,13 @@ func AddBuildFlags(cmd *base.Command, ma
|
||||
|
||||
cmd.Flag.Var(&load.BuildAsmflags, "asmflags", "")
|
||||
cmd.Flag.Var(buildCompiler{}, "compiler", "")
|
||||
- cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", "default", "")
|
||||
+
|
||||
+ if bm := os.Getenv("GOBUILDMODE"); bm != "" {
|
||||
+ cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", bm, "")
|
||||
+ } else {
|
||||
+ cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", "default", "")
|
||||
+ }
|
||||
+
|
||||
cmd.Flag.Var(&load.BuildGcflags, "gcflags", "")
|
||||
cmd.Flag.Var(&load.BuildGccgoflags, "gccgoflags", "")
|
||||
if mask&OmitModFlag == 0 {
|
||||
@@ -3,7 +3,6 @@ require go-target.inc
|
||||
|
||||
inherit linuxloader
|
||||
|
||||
export GOBUILDMODE=""
|
||||
export GO_LDSO = "${@get_linuxloader(d)}"
|
||||
export CC_FOR_TARGET = "gcc"
|
||||
export CXX_FOR_TARGET = "g++"
|
||||
|
||||
Reference in New Issue
Block a user