The imported binutils in base supports DWARF 3.
I'm using this change: https://github.com/emaste/freebsd/commit/1c3deab6d518feb1a7e88de5b342a139e4022a21
In FreeBSD 12 and later we use Clang, lld, and ELF Tool Chain. (We still have gas and objdump from the outdated binutils 2.17.50.)
Will you upstream this commit (I can abandon this one)? I created this revision because I was learning clangDriver... I had a vague and probably incorrect impression that some folks said kgdb or dtrace or whatever might not support DWARF 3 or 4.
Hmm, somehow I forgot about this until being reminded by @arichardson just now. I will upstream it.
The primary motivation for staying with DWARF2 was indeed kgdb, based on gdb 6.1.1, and dtrace (specifically dtrace's build tool ctfconvert) also did not support DWARF >2. However, these issues have all been addressed:
- We're deprecating gdb 6.1.1-based kgdb, using a contemporary gdb port.
- In any case the kernel is still building with explicit -gdwarf2 today so it doesn't matter anyhow, there's no need for the toolchain default to be set based on the kernel's needs.
- DTrace tooling limitations arose as a side effect of our (well, ELF Tool Chain's) libdwarf but it has been updated to handle DWARF4 some time ago.
Perhaps I should just upload a new diff to this review?