aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2017-03-07 22:40:22 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-10 14:50:16 +0000
commit78615e9260fb5d6569de4883521b049717fa4340 (patch)
treeaf9eba2be44d6d2baeed35bbd6c0446d70fd61d1 /meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch
parent056a9da9f3ac2bc175f19243b11864ca90eee28b (diff)
downloadopenembedded-core-78615e9260fb5d6569de4883521b049717fa4340.tar.gz
go: Add recipes for golang compilers and tools
* This is converging the recipes for go from meta-virtualization and oe-meta-go * Add recipes for go 1.7 * go.bbclass is added to ease out writing recipes for go packages * go-examples: Add an example, helloworld written in go This should serve as temlate for writing go recipes * Disable for musl, at least for now * Disable for x32/ppc32 which is not supported Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch')
-rw-r--r--meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch b/meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch
new file mode 100644
index 0000000000..dc9b811b2a
--- /dev/null
+++ b/meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch
@@ -0,0 +1,50 @@
+Accept CC with multiple words in its name
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: go/src/cmd/go/build.go
+===================================================================
+--- go.orig/src/cmd/go/build.go
++++ go/src/cmd/go/build.go
+@@ -3100,12 +3100,24 @@ func (b *builder) gccCmd(objdir string)
+ return b.ccompilerCmd("CC", defaultCC, objdir)
+ }
+
++// gccCmd returns a gcc command line prefix
++// defaultCC is defined in zdefaultcc.go, written by cmd/dist.
++func (b *builder) gccCmdForReal() []string {
++ return envList("CC", defaultCC)
++}
++
+ // gxxCmd returns a g++ command line prefix
+ // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
+ func (b *builder) gxxCmd(objdir string) []string {
+ return b.ccompilerCmd("CXX", defaultCXX, objdir)
+ }
+
++// gxxCmd returns a g++ command line prefix
++// defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
++func (b *builder) gxxCmdForReal() []string {
++ return envList("CXX", defaultCXX)
++}
++
+ // gfortranCmd returns a gfortran command line prefix.
+ func (b *builder) gfortranCmd(objdir string) []string {
+ return b.ccompilerCmd("FC", "gfortran", objdir)
+Index: go/src/cmd/go/env.go
+===================================================================
+--- go.orig/src/cmd/go/env.go
++++ go/src/cmd/go/env.go
+@@ -63,10 +63,9 @@ func mkEnv() []envVar {
+ }
+
+ cmd := b.gccCmd(".")
+- env = append(env, envVar{"CC", cmd[0]})
++ env = append(env, envVar{"CC", strings.Join(b.gccCmdForReal(), " ")})
+ env = append(env, envVar{"GOGCCFLAGS", strings.Join(cmd[3:], " ")})
+- cmd = b.gxxCmd(".")
+- env = append(env, envVar{"CXX", cmd[0]})
++ env = append(env, envVar{"CXX", strings.Join(b.gxxCmdForReal(), " ")})
+
+ if buildContext.CgoEnabled {
+ env = append(env, envVar{"CGO_ENABLED", "1"})