Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame^] | 1 | From 2055a46b396e272616c0b2273903e02c3b49a2ff Mon Sep 17 00:00:00 2001 |
| 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
| 3 | Date: Tue, 10 Nov 2020 16:33:27 +0000 |
| 4 | Subject: [PATCH] src/cmd/dist/buildgo.go: do not hardcode host compilers into |
| 5 | target binaries |
| 6 | |
| 7 | These come from $CC/$CXX on the build host and are not useful on targets; |
| 8 | additionally as they contain host specific paths, this helps reproducibility. |
| 9 | |
| 10 | Upstream-Status: Inappropriate [needs upstream discussion] |
| 11 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
| 12 | --- |
| 13 | src/cmd/dist/buildgo.go | 8 ++++---- |
| 14 | 1 file changed, 4 insertions(+), 4 deletions(-) |
| 15 | |
| 16 | diff --git a/src/cmd/dist/buildgo.go b/src/cmd/dist/buildgo.go |
| 17 | index caafc13..4eb1c96 100644 |
| 18 | --- a/src/cmd/dist/buildgo.go |
| 19 | +++ b/src/cmd/dist/buildgo.go |
| 20 | @@ -34,8 +34,8 @@ func mkzdefaultcc(dir, file string) { |
| 21 | fmt.Fprintf(&buf, "package cfg\n") |
| 22 | fmt.Fprintln(&buf) |
| 23 | fmt.Fprintf(&buf, "const DefaultPkgConfig = `%s`\n", defaultpkgconfig) |
| 24 | - buf.WriteString(defaultCCFunc("DefaultCC", defaultcc)) |
| 25 | - buf.WriteString(defaultCCFunc("DefaultCXX", defaultcxx)) |
| 26 | + buf.WriteString(defaultCCFunc("DefaultCC", map[string]string{"":"gcc"})) |
| 27 | + buf.WriteString(defaultCCFunc("DefaultCXX", map[string]string{"":"g++"})) |
| 28 | writefile(buf.String(), file, writeSkipSame) |
| 29 | return |
| 30 | } |
| 31 | @@ -46,8 +46,8 @@ func mkzdefaultcc(dir, file string) { |
| 32 | fmt.Fprintf(&buf, "package main\n") |
| 33 | fmt.Fprintln(&buf) |
| 34 | fmt.Fprintf(&buf, "const defaultPkgConfig = `%s`\n", defaultpkgconfig) |
| 35 | - buf.WriteString(defaultCCFunc("defaultCC", defaultcc)) |
| 36 | - buf.WriteString(defaultCCFunc("defaultCXX", defaultcxx)) |
| 37 | + buf.WriteString(defaultCCFunc("defaultCC", map[string]string{"":"gcc"})) |
| 38 | + buf.WriteString(defaultCCFunc("defaultCXX", map[string]string{"":"g++"})) |
| 39 | writefile(buf.String(), file, writeSkipSame) |
| 40 | } |
| 41 | |