We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ce5095 commit 049eea1Copy full SHA for 049eea1
src/cmd/cgo/out.go
@@ -168,6 +168,11 @@ func (p *Package) writeDefs() {
168
if *gccgo {
169
fmt.Fprintf(fc, "extern byte *%s;\n", n.C)
170
} else {
171
+ // Only emit the following symbols if they are not for
172
+ // a function pointer variable. The function symbol is already defined
173
+ // and redefining it here as such will break compilation when
174
+ // used in conjunction with link time optimization in external
175
+ // linkers.
176
if n.Kind != "fpvar" {
177
fmt.Fprintf(fm, "extern char %s[];\n", n.C)
178
fmt.Fprintf(fm, "void *_cgohack_%s = %s;\n\n", n.C, n.C)
0 commit comments