summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/go-cross/go-1.5/fix-cc-handling.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/go-cross/go-1.5/fix-cc-handling.patch')
-rw-r--r--recipes-devtools/go-cross/go-1.5/fix-cc-handling.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/recipes-devtools/go-cross/go-1.5/fix-cc-handling.patch b/recipes-devtools/go-cross/go-1.5/fix-cc-handling.patch
new file mode 100644
index 00000000..85770a93
--- /dev/null
+++ b/recipes-devtools/go-cross/go-1.5/fix-cc-handling.patch
@@ -0,0 +1,46 @@
1Index: go/src/cmd/go/build.go
2===================================================================
3--- go.orig/src/cmd/go/build.go 2015-07-29 14:48:40.323185807 -0700
4+++ go/src/cmd/go/build.go 2015-07-30 07:37:40.529818586 -0700
5@@ -2805,12 +2805,24 @@
6 return b.ccompilerCmd("CC", defaultCC, objdir)
7 }
8
9+// gccCmd returns a gcc command line prefix
10+// defaultCC is defined in zdefaultcc.go, written by cmd/dist.
11+func (b *builder) gccCmdForReal() []string {
12+ return envList("CC", defaultCC)
13+}
14+
15 // gxxCmd returns a g++ command line prefix
16 // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
17 func (b *builder) gxxCmd(objdir string) []string {
18 return b.ccompilerCmd("CXX", defaultCXX, objdir)
19 }
20
21+// gxxCmd returns a g++ command line prefix
22+// defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
23+func (b *builder) gxxCmdForReal() []string {
24+ return envList("CXX", defaultCXX)
25+}
26+
27 // ccompilerCmd returns a command line prefix for the given environment
28 // variable and using the default command when the variable is empty.
29 func (b *builder) ccompilerCmd(envvar, defcmd, objdir string) []string {
30Index: go/src/cmd/go/env.go
31===================================================================
32--- go.orig/src/cmd/go/env.go 2015-07-29 14:48:40.323185807 -0700
33+++ go/src/cmd/go/env.go 2015-07-30 07:40:54.461655721 -0700
34@@ -52,10 +52,9 @@
35
36 if goos != "plan9" {
37 cmd := b.gccCmd(".")
38- env = append(env, envVar{"CC", cmd[0]})
39+ env = append(env, envVar{"CC", strings.Join(b.gccCmdForReal(), " ")})
40 env = append(env, envVar{"GOGCCFLAGS", strings.Join(cmd[3:], " ")})
41- cmd = b.gxxCmd(".")
42- env = append(env, envVar{"CXX", cmd[0]})
43+ env = append(env, envVar{"CXX", strings.Join(b.gxxCmdForReal(), " ")})
44 }
45
46 if buildContext.CgoEnabled {