Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
cgo gcc ld error: undefined reference to `mk_datum' #41727
Coming from this issue: go-delve/delve#2187
What version of Go are you using (
I think this is working as expected, as how gcc performs optimization with inline function. Example, this program:
fails to compile, but this does:
Thank you, @cuonglm, I submitted a PR. I'm not even close to be a compiler expert, but intuitively it looks strange that this case works with more aggressive optimization (O1, O2) and breaks with minimal optimization (O0). I'm not arguing with the fact that it may indeed be an expected behavior, just pointing out that it feels misleading to me.