Skip to content

Commit fc28f64

Browse files
authored
cmd/go: re-enable CGO for Go toolchain commands (#190)
1 parent b46ff8f commit fc28f64

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

patches/015-fix-linkage.patch

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
2+
index 32e59b446a..b55f29298b 100644
3+
--- a/src/cmd/dist/build.go
4+
+++ b/src/cmd/dist/build.go
5+
@@ -1309,7 +1309,9 @@ func toolenv() []string {
6+
// we disable cgo to get static binaries for cmd/go and cmd/pprof,
7+
// so that they work on systems without the same dynamic libraries
8+
// as the original build system.
9+
- env = append(env, "CGO_ENABLED=0")
10+
+ //
11+
+ // Setting CGO_ENABLED to 0 prevents cmd/go and the like from linking with vendored openssl symbols.
12+
+ // env = append(env, "CGO_ENABLED=0")
13+
}
14+
if isRelease || os.Getenv("GO_BUILDER_NAME") != "" {
15+
// Add -trimpath for reproducible builds of releases.

0 commit comments

Comments
 (0)