]> Cypherpunks repositories - gostls13.git/commit
cmd/go: always use --whole-archive for gccgo packages
authorIan Lance Taylor <iant@golang.org>
Tue, 10 Nov 2015 19:25:15 +0000 (11:25 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 10 Nov 2015 20:22:13 +0000 (20:22 +0000)
commit2fdff9586b9bd82be784e5f55cbf5a75e54b9b1f
tree094b5f21d147db364be7e8949e6f85b1cdac69d5
parent07a6cbf58acd812dd935ef6373d567fd75e5ca3f
cmd/go: always use --whole-archive for gccgo packages

This is, in effect, what the gc toolchain does.  It fixes cases where Go
code refers to a C global variable; without this, if the global variable
was the only thing visible in the C code, the generated cgo file might
not get pulled in from the archive, leaving the Go variable
uninitialized.

This was reported against gccgo as https://gcc.gnu.org/PR68255 .

Change-Id: I3e769dd174f64050ebbff268fbbf5e6fab1e2a1b
Reviewed-on: https://go-review.googlesource.com/16775
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
misc/cgo/test/cgo_test.go
misc/cgo/test/gcc68255.go [new file with mode: 0644]
misc/cgo/test/gcc68255/a.go [new file with mode: 0644]
misc/cgo/test/gcc68255/c.c [new file with mode: 0644]
misc/cgo/test/gcc68255/c.h [new file with mode: 0644]
src/cmd/go/build.go