https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68358
--- Comment #6 from Nenad Vukicevic <nenad at intrepid dot com> --- On 11/24/15 9:27 AM, dominiq at lps dot ens.fr wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68358 > > --- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- >> We are getting a similar issue while linking a program with GCC and >> without '-flto' switch. We enable 'lto' when configuring languages, >> which in turn enables post ld processing inside collect2. This was done >> as part of the bug #61352 patch. > > I am not sure to understand the comment. Do you mean that your build is > configured to use '-flto' by default? Do you have a non-fortran reproducer? If > yes, could you please post it? > No, we configured for 'lto' with '--enable-languages' option, but do not use it, no '-flto' on any of the compiled objects. However, collect2 tries to find all the objects compiled with lto, it does not find any, and calls 'post_ld_pass (true)' which executes 'dsymutil'. This was the code that was added in the specified patch, lines 819-820 of collect2.c. If you configure without LTO you will not see the problem as 'dsymutil' is not getting called. If you look at the calls of procedure 'post_ld_pass()' (which calls dsymutil), I think it calls dsymutil only if true is passed in and debugging is enabled: 807: post_ld_pass (true); <--- LTO enabled, has LTO compiled objects (Fortran test issue) 814: post_ld_pass (false); <--- LTO enabled, no LTO objects, force linking 820: post_ld_pass (true); <--- LTO enabled, NO LTO objects (My issue) post_ld_pass (false); post_ld_pass (false); post_ld_pass (false); Maybe line 820 should pass 'false' as this is the case similar to LTO not being enabled? I think the problem is in the symbols we generate, or the tool itself, and this issue shows up only if you have LTO enabled. I can provide the object file that has problems and this might be enough if someone builds LLVM on Apple and tries llvm-dsymutil tool on it. This should be the same tool as Apple's dsymutil, if we can duplicate the problem then we can debug it.