You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @juri-t, thanks for reaching to us. It's possible that you are forcing internal linking mode, which it isn't well supported when compiling with CGO enabled.
We were able to reproduce it. Assuming a simple program like this one:
Compiled as is, it doesn't complain. If we set GOFLAGS='-ldflags=-linkmode=internal' we get the warnings you see:
❯ export GOFLAGS='-ldflags=-linkmode=internal'
❯ go clean && go build .
# go-http-puppy
github.com/shoenig/go-m1cpu(__DATA/__cfstring): unexpected reloc for dynamic symbol __CFConstantStringClassReference
github.com/shoenig/go-m1cpu(__DATA/__cfstring): unexpected reloc for dynamic symbol __CFConstantStringClassReference
github.com/shirou/gopsutil/v3/cpu._Cvar_mach_task_self_: relocation target mach_task_self_ not defined
If we set CGO_ENABLED=0, the warnings go away:
❯ export CGO_ENABLED=0
❯ go clean && go build .
❯ echo $?
0
Make sure you don't use internal linking mode unless strictly required. In that case, if you can work with CGO_ENABLED=0, that will get rid of the warnings.
After updating dd-trace-go, I encountered an issue where running unit tests outputs the following error log:
github.com/shoenig/go-m1cpu(__DATA/__cfstring): unexpected reloc for dynamic symbol __CFConstantStringClassReference
This appears to have been introduced in this PR, where the library github.com/shoenig/go-m1cpu was added as a dependency.
While the tests continue to work as expected, this log is very noisy and clutters the output, making debugging other issues difficult.
Could you provide guidance on how to suppress or resolve this error log?
Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: