https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82005
--- Comment #8 from rguenther at suse dot de <rguenther at suse dot de> --- On Wed, 30 Aug 2017, dominiq at lps dot ens.fr wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82005 > > --- Comment #7 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- > With the patch in comment 6, compiling the test in comment 0 with -g -flto > gives > > while processing > /var/folders/8q/sh_swgz96r7f5vnn08f7fxr00000gn/T//ccqniUp8.ltrans0.ltrans.o: > warning: could not find referenced DIE > while processing > /var/folders/8q/sh_swgz96r7f5vnn08f7fxr00000gn/T//ccqniUp8.ltrans0.ltrans.o: > warning: could not find referenced DIE > while processing > /var/folders/8q/sh_swgz96r7f5vnn08f7fxr00000gn/T//ccqniUp8.ltrans0.ltrans.o: > warning: could not find referenced DIE > while processing > /var/folders/8q/sh_swgz96r7f5vnn08f7fxr00000gn/T//ccqniUp8.ltrans0.ltrans.o: > warning: could not find referenced DIE I guess that's expected given the missing implementation of simple-objects copy_lto_debug_sections for Mach-O. If you manually do the extraction / renaming and link with the early debug part it should work(?) (I didn't try myself, doing this manually might be a bit tricky -- look at the compile assembler, remove the DWARF segment and rename the GNU_DWARF_LTO segment to DWARF, remove all text and data sections and assemble.