[cfe-dev] Self build with LTO on OS X

Domagoj Saric domagoj.saric at littleendian.com
Wed May 18 04:20:20 PDT 2011


--------------------------------------------------
From: "Jean-Daniel Dupas" <devlists at shadowlab.org>
Sent: Tuesday, May 17, 2011 6:06 PM

> Le 17 mai 2011 à 17:35, Domagoj Saric a écrit :
>
>>
>> Should Clang be able to build itself with LTO/-O4?
>>
>> Trying it with both 2.8 and 2.9 official releases fails at link time on
>> OS X
>> 10.6.7...
>>
>> If this problem is the same as the general "LTO on OS X" problem, is
>> this/will this be solvable at all? Or will Mac Clang users simply have to
>> work with whatever Clang version (and accompanying system linker) Apple
>> provides them with?
>>
>> I install Clang (first built with Apple's llvm-gcc) into /usr/bin (thus
>> overwriting the official one) which, I suppose, should be equivalent or
>> 'better' than setting DYLD_LIBRARY_PATH (as recommended here
>> http://blog.mozilla.com/respindola/2011/03/04/lto-on-os-x and here
>> http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-December/027709.html) but
>> it still does not work.
>
> Overriding clang without updating the LTO library used by the linker
> (/usr/lib/libLTO.dylib) is probably not a good idea, as the clang TOT
> may produce bitcode than an old library cannot read.

AFAICT, installing (Clang) in /usr does update/overwrite
/usr/lib/libLTO.dylib but it does not seem to be enough...

That's why I first asked is this possible at all. First whether Clang should
be able to self build with LTO enabled at all and, if so, should this also
work on OS X, and if so, is there a tutorial/documentation somewhere on how
to get LTO working with the latest Clang on OS X...


--
"What Huxley teaches is that in the age of advanced technology, spiritual
devastation is more likely to come from an enemy with a smiling face than
from one whose countenance exudes suspicion and hate."
Neil Postman 




More information about the cfe-dev mailing list