On 09.09.19 15:51, Richard Biener wrote:
On Mon, 9 Sep 2019, Matthias Klose wrote:
On 09.09.19 14:02, Richard Biener wrote:
So this is really a very poor mans solution that also might
uncover issues with -g0 at compile-time vs. -g at link-time
if there are mixed -g0/g TUs in the LTO link.
Could this be documented, at least in the man page? e.g. invoke.texi. As a
bonus I would very much welcome a section in the user manual about LTO
building. E.g. what will work, what currently doesn't work, etc. Happy to
review and extend such documentation, but I don't feel comfortable to write
that on my own.
Like the following?
Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi (revision 275454)
+++ gcc/doc/invoke.texi (working copy)
@@ -10335,6 +10335,14 @@ conflicting translation units. Specific
precedence; and for example @option{-ffp-contract=off} takes precedence
over @option{-ffp-contract=fast}. You can override them at link time.
+To enable debug info generation you need to supply @option{-g} at
+compile-time. If any of the input files at link time were built
+with debug info generation enabled the link will enable debug info
+generation as well. Any elaborate debug info settings
+like the dwarf level @option{-gdwarf-5} need to be explicitely repeated
+at the linker command line and mixing different settings in different
+translation units is discouraged.
+
If LTO encounters objects with C linkage declared with incompatible
types in separate translation units to be linked together (undefined
behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
Thanks!