diff options
Diffstat (limited to 'meta/recipes-devtools/go/go-1.13/0008-use-GOBUILDMODE-to-set-buildmode.patch')
| -rw-r--r-- | meta/recipes-devtools/go/go-1.13/0008-use-GOBUILDMODE-to-set-buildmode.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-1.13/0008-use-GOBUILDMODE-to-set-buildmode.patch b/meta/recipes-devtools/go/go-1.13/0008-use-GOBUILDMODE-to-set-buildmode.patch new file mode 100644 index 0000000000..68e132f30a --- /dev/null +++ b/meta/recipes-devtools/go/go-1.13/0008-use-GOBUILDMODE-to-set-buildmode.patch | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | From 971b5626339ce0c4d57f9721c9a81af566c5a044 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alex Kube <alexander.j.kube@gmail.com> | ||
| 3 | Date: Wed, 23 Oct 2019 21:19:26 +0430 | ||
| 4 | Subject: [PATCH 8/9] cmd/go: Use GOBUILDMODE to set buildmode | ||
| 5 | |||
| 6 | Upstream-Status: Denied [upstream choose antoher solution: `17a256b | ||
| 7 | cmd/go: -buildmode=pie for android/arm'] | ||
| 8 | |||
| 9 | While building go itself, the go build system does not support | ||
| 10 | to set `-buildmode=pie' from environment. | ||
| 11 | |||
| 12 | Add GOBUILDMODE to support it which make PIE executables the default | ||
| 13 | build mode, as PIE executables are required as of Yocto | ||
| 14 | |||
| 15 | Refers: https://groups.google.com/forum/#!topic/golang-dev/gRCe5URKewI | ||
| 16 | |||
| 17 | Adapted to Go 1.13 from patches originally submitted to | ||
| 18 | the meta/recipes-devtools/go tree by | ||
| 19 | Hongxu Jia <hongxu.jia@windriver.com> | ||
| 20 | |||
| 21 | Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com> | ||
| 22 | --- | ||
| 23 | src/cmd/go/internal/work/build.go | 8 +++++++- | ||
| 24 | 1 file changed, 7 insertions(+), 1 deletion(-) | ||
| 25 | |||
| 26 | diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go | ||
| 27 | index 6560317..5f3a988 100644 | ||
| 28 | --- a/src/cmd/go/internal/work/build.go | ||
| 29 | +++ b/src/cmd/go/internal/work/build.go | ||
| 30 | @@ -231,7 +231,13 @@ func AddBuildFlags(cmd *base.Command) { | ||
| 31 | |||
| 32 | cmd.Flag.Var(&load.BuildAsmflags, "asmflags", "") | ||
| 33 | cmd.Flag.Var(buildCompiler{}, "compiler", "") | ||
| 34 | - cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", "default", "") | ||
| 35 | + | ||
| 36 | + if bm := os.Getenv("GOBUILDMODE"); bm != "" { | ||
| 37 | + cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", bm, "") | ||
| 38 | + } else { | ||
| 39 | + cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", "default", "") | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | cmd.Flag.Var(&load.BuildGcflags, "gcflags", "") | ||
| 43 | cmd.Flag.Var(&load.BuildGccgoflags, "gccgoflags", "") | ||
| 44 | cmd.Flag.StringVar(&cfg.BuildMod, "mod", "", "") | ||
| 45 | -- | ||
| 46 | 2.17.1 (Apple Git-112) | ||
| 47 | |||
