[cfe-dev] Link error with -flto
Devang Patel
dpatel at apple.com
Thu Sep 15 09:29:12 PDT 2011
On Sep 15, 2011, at 4:06 AM, Robert Purves wrote:
>
> 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.
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.
-
Devang
More information about the cfe-dev
mailing list