This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][LTO][RFC] AR archive support for LTO
On Sun, 1 Nov 2009, Rafael Espindola wrote:
> > Comments?
>
> Thanks!
> Some general comments. Will try to review the patch on Monday:
>
> *) The plugin knows the offsets and sizes of each object. Maybe we
> could pass that to lto1 instead of having it understand the .a format.
Maybe - but that's going to make a collect2 implementation harder
as it would need to communicate via the command-line.
> *) Correct implementation in collect2 is not going to be simple, since
> collect2 doesn't know which members are going to be used.
Well, collect2 uses nm at the moment to decide which .o files have
lto data - it could as well use nm to decide which ar members have
lto data (which is what I would do here). The alternative would
of course be to pass the whole archive to lto1 and let it discover
which members to use and which not.
> *) What is the problem with archives with mixed IL and regular ELF
> files? The plugin should pass only the ones with IL to lto1.
Right. But see above - if we'd pass the whole archive lto1 would
need to figure this out. The question is also what to pass to
the final link step - I suppose linking against the archive again
should work as long as you don't force in the whole archive. And
is even necessary if regular ELF file members are in there.
> > Volunteers to hack this support into the linker-plugin?
>
> I can do it. Will removed the part of it that needed the most cleanup :-)
Yeah ;) I'll investigate how difficult collect2 support would be.
Richard.