]> git.ipfire.org Git - thirdparty/gcc.git/commit
Darwin,debug : Switch to DWARF 3 or 4 when dsymutil supports it.
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 17 Sep 2023 14:56:07 +0000 (15:56 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Thu, 4 Apr 2024 19:00:59 +0000 (20:00 +0100)
commite67f95ca64748f9b85a00925aa1fe63550bf61d0
tree4dcd55415ffa79484ee92b85c0134a2e26418c66
parent02a1d49da8f95a128d131747546921b67818d144
Darwin,debug : Switch to DWARF 3 or 4 when dsymutil supports it.

The main reason that Darwin has been using DWARF2 only as debug is that
earlier debug linkers (dsymutil) did not support any extensions to this
so that the default "non-strict" mode used in GCC would cause tool errors.

There are two sources for dsymutil, those based off a closed source base
"dwarfutils" and those based off LLVM.

For dsymutil versions based off LLVM-7+ we can use up to DWARF-4, and for
versions based on dwarfutils 121+ we can use DWARF-3.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/ChangeLog:

* config/darwin-protos.h (enum darwin_external_toolchain): New.
* config/darwin.cc (DSYMUTIL_VERSION): New.
(darwin_override_options): Choose the default debug DWARF version
depending on the configured dsymutil version.

(cherry picked from commit 47346acb72b50d178dae72393c851d57beec383f)
gcc/config/darwin-protos.h
gcc/config/darwin.cc