Link error with -flto

cat test.c
int main( void ) { return 0; }
clang test.c
clang test.c -flto
ld: in /var/folders/52/jjd304908xjcn40059bbtdr80000gq/T/test-uMP2UG.o, could not parse object file /var/folders/52/jjd304908xjcn40059bbtdr80000gq/T/test-uMP2UG.o: Invalid MODULE_CODE_FUNCTION record for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is with clang TOT (139788), in OS X 10.7.1.

Robert P.

In TOT, bitcode formate has change. You need to install libLTO from TOT or use clang that is shipped with the entire tools set you have.