]> 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>
Mon, 18 Sep 2023 18:37:17 +0000 (19:37 +0100)
commit47346acb72b50d178dae72393c851d57beec383f
treedadd5d2d470ab59f772363e6bcd22987ab21a85f
parentce7a757fd9ecb99c4f54cfde5cf5ef9a9e7819fc
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.
gcc/config/darwin-protos.h
gcc/config/darwin.cc