[cfe-dev] Bug with -O4

Robert Purves listrp at gmail.com
Sat May 2 02:42:02 PDT 2009


Shantonu Sen wrote:

>> $ cat test.c
>> int main( void ) { return 0; }

>> $ clang test.c -O4
>> ld warning: in /var/folders/88/88AKX+F62RWmd++8ZOxBkU+++TI/-Tmp-/cc-
>> NuzMfl.o, file is not of required architecture
>> Undefined symbols:
>>  "_main", referenced from:
>>      start in crt1.10.5.o
>> ld: symbol(s) not found
>
> There may be rev-locks between the Mac OS X linker and the version  
> of /Developer/usr/lib/libLTO.dylib (which is built out of the llvm  
> source tree). Also you need clang installed in /Developer/usr/bin  
> (not in a local build tree) so that it uses /Developer/usr/bin/ld  
> for linking and doesn't back to /usr/bin/ld, which won't find ../lib/ 
> libLTO.dylib
>
> So I'd suggest first installing clang in /Developer/usr/bin and  
> clang-cc in /Developer/usr/libexec, and see if that just works.

No.

> If not, try installing libLTO.dylib to /Developer/usr/lib (and keep  
> a backup).

Yes! Thanks.

Robert P.




More information about the cfe-dev mailing list