Why does the Go compiler uses "X:nodwarf5" by default?

Why Fedora 43 Go compiler disables DWARF5 debugging symbols format?

I can clearly see “X:nodwarf5” every time I build any Go software… and obviously this hinders all the benefits of the newer DWARF version for debugging Go binaries.

Holly ****… I already found the anwser. Because of the hacky debugedit, DWARF5 is being disabled. This is really unfortunate, and I hope it changes for Fedora 44.

Disable DWARF 5 in Go 1.25 · Issue #75079 · golang/go

Hi Rafael. It won’t be reverted in F44. It’s a little bit more complex than just the “hacky debugedit”.

For context, I have an ongoing PR to fix this cmd/link: DWARF5 implementation breaks debugedit · Issue #76630 · golang/go · GitHub (I was out for Christmas and I need to go back to this discussion).

1 Like

Just to clarify, of course it will be reverted as soon as we can make it work (and in every single stable release, we don’t need to wait for a new release for this change). Don’t read my previous message as “it will never land in Fedora”. This is also affecting other distros (Arch, for example, also did this). Basically, if we enable DWARF5 at this point, it will break every single go package and the testing farm.

If DWARF5 is a must for you (curious exactly why), I think the best path is to compile from upstream. The Go package in Fedora is used by every single package that needs Go, and we need to consider their needs (aka just being able to update :smiley: )

1 Like

Thanks for the explanation @alexsaezm !

There are small benefits, like smaller debug symbols size, but also new annotations that I’m exploring (related to source code paths… may be one day we can stop using debugedit…), including explicit Go support. Disabling DWARF5 distribution-wide also affects delve DWARF5 support for example. Of course this is not a blocker to me, as I’m using upstream Go 1.25 for the projects I work on (and then I also need to compile Delve… things are not that smooth).

Let me know if I can help, at least with testing, and may be with coding, if I know how.

1 Like

Any update on this?

One advance:

May be for the users not to be left in the rain, adding a Go and Delve optional packages compiled without the experimental (to be removed in Go 1.26 hopefully) nodwarf5?