https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81968
--- Comment #70 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> --- > --- Comment #63 from Jakub Jelinek <jakub at gcc dot gnu.org> --- > Are the remaining issues only related to .debug_macro, or other stuff too? > If only .debug_macro, does: > --- gcc/dwarf2out.c 2018-03-11 17:48:53.498068316 +0100 > +++ gcc/dwarf2out.c 2018-03-13 10:58:03.477514623 +0100 > @@ -28282,6 +28282,7 @@ output_macinfo (const char *debug_line_l > case DW_MACINFO_undef: > if ((!dwarf_strict || dwarf_version >= 5) > && HAVE_COMDAT_GROUP > + && !flag_lto > && vec_safe_length (files) != 1 > && i > 0 > && i + 1 < length > help? If yes, we could go for && (!flag_lto || !HAVE_BROKEN_LD_WHATEVER) > and add configure test for that. It does (bootstrapped on both i386-pc-solaris2.11 and sparc-sun-solaris2.11). One could also add -z relax=comdat in the ld invocation inlto-wrapper if everything else fails. ld(1) has -z relax=item1,item2,... The link-editor performs validity checks in order to ensure that the resulting output object is valid and usable at runtime. In addition, the link-editor can transition a variety of relocations to generate more optimal instruction sequences. The -z relax option can be used to relax these operations in order to produce an output object that would otherwise be rejected. Note - Disabling validity checks can result in the creation of a corrupt or otherwise unusable object. The -z relax option is a special- ized option, mainly of interest to compiler authors, and is not intended for general use. The following item tokens are recognized. [...] comdat A relocation that remains against a symbol that has been elimi- nated as part of a COMDAT section, results in a fatal error. The -z relax=comdat option redirects such relocations to an equivalent symbol in a retained COMDAT section.