Godebug issue with cgo `//export` marked go functions.
dmccarney opened this issue · comments
Daniel McCarney commented
It appears that godebug causes some issues with Go functions that are marked //export
for use with native code via cgo.
E.g. running godebug to instrument a package that uses cgo to define a vsl_dispatch_catcher
native function that in turn invokes a go function vsl_noise_handler
that is marked //export vsl_noise_handler
in the source produces:
$ godebug run -instrument=github.com/fastly/fst-noise/vsl noise/noise.go
# github.com/fastly/fst-noise/vsl
/tmp/go-build703672289/github.com/fastly/fst-noise/vsl/_obj/log.cgo2.o: In function `vsl_dispatch_catcher':
/tmp/godebug453289544/src/github.com/fastly/fst-noise/vsl/log.go:36: undefined reference to `vsl_noise_handler'
collect2: error: ld returned 1 exit status
Is there a workaround known?