[whopr] Design/implementation alternatives for the driver and WPA

Chris Lattner clattner@apple.com
Wed Jun 4 16:41:00 GMT 2008


On Jun 4, 2008, at 9:29 AM, Chris Lattner wrote:

>> Suppose the linker is invoked on a
>> sequence of object files, some with with LTO information, some
>> without, all interspersed.  Suppose some symbols are defined in
>> multiple .o files, through the use of common symbols, weak symbols,
>> and/or section groups.  The LLVM interface simply passes each object
>> file to the plugin.
>
> No, the native linker handles all the native .o files.

Incidentally, this is very easy to verify, as you can download this  
today and try it out.  LTO works fine in the Xcode 3.1 beta, which is  
available off developer.apple.com, including when you mix and match  
LLVM-compiled LTO .o files with GCC compiled ones.

For example, this works fine and does LTO across a.c/b.cpp/c.m:

llvm-gcc a.c   -O4 -o a.o -c
llvm-g++ b.cpp -O4 -o b.o -c
llvm-gcc c.m   -O4 -o c.o -c
gcc d.m        -O3 -o d.o -c
g++ a.o b.o c.o d.o -o a.out

-Chris



More information about the Gcc mailing list