Mark Mitchell <[EMAIL PROTECTED]> writes: > 1. Add a --lto option to collect2. When collect2 sees this option, > treat all .o files as if they were .rpo files and recompile them. We > will do this after all C++ template instantiation has been done, since > we want to optimize the .o files after the program can actually link. > > 2. Modify the driver so that --lto passes -flto to the C front-end and > --lto to collect2.
Sounds workable in general. I note that in your example of gcc --lto foo.c bar.o this presumably means that bar.o will be recompiled using the compiler options specified on that command line, rather than, say, the compiler options specified when bar.o was first compiled. This is probably the correct way to handle -march= options. I assume that in the long run, the gcc driver with --lto will invoke the LTO frontend rather than collect2. And that the LTO frontend will then open all the .o files which it is passed. Ian