https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91287
--- Comment #27 from rguenther at suse dot de <rguenther at suse dot de> --- On Fri, 2 Aug 2019, linkw at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91287 > > Kewen Lin <linkw at gcc dot gnu.org> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > CC| |linkw at gcc dot gnu.org > > --- Comment #26 from Kewen Lin <linkw at gcc dot gnu.org> --- > > The odd thing is that if you omit libfoo1.so then it will consider > > libfoo.a later but not when it can resolve from libfoo1.so. > > > > That's a bit inconsistent but arguably the bug is with GCCs > > symbol table creation of the LTO IR. > > Do we have option to dump the actual final linking command to link all ltrans > objects? I can only see the command to generate ltrans object with as. Is it > possible a library order issue in final linking? The ld invocation for the final link is the same as the one spawning the LTO WPA and LTRANS phases - the LTO plugin feeds back extra objects for the re-link done by the very same ld process. Not sure if ld prints anything like an "effective final link command" when adding verbosity (try -Wl,-v -Wl,-debug etc.). So - there isn't something like a "final linking command" and the final linking approach also differs from BFD and gold for example.