This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug go/68255] cgo-generated constructor not being called
- From: "ian at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 10 Nov 2015 20:31:43 +0000
- Subject: [Bug go/68255] cgo-generated constructor not being called
- Auto-submitted: auto-generated
- References: <bug-68255-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68255
--- Comment #3 from ian at gcc dot gnu.org <ian at gcc dot gnu.org> ---
Author: ian
Date: Tue Nov 10 20:31:11 2015
New Revision: 230120
URL: https://gcc.gnu.org/viewcvs?rev=230120&root=gcc&view=rev
Log:
PR go/68255
cmd/go: always use --whole-archive for gccgo packages
This is a backport of https://golang.org/cl/16775.
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 .
Reviewed-on: https://go-review.googlesource.com/16778
Modified:
trunk/gcc/go/gofrontend/MERGE
trunk/libgo/go/cmd/go/build.go