[LLVMdev] libLTO on Mac OS X

Chris Lattner clattner at apple.com
Thu Nov 12 11:51:30 PST 2009


On Nov 12, 2009, at 11:43 AM, John Criswell wrote:

> Dear LLVMers,
>
> I'm currently working on creating an alternate libLTO.so that will run
> some whole-program analysis and transforms of mine during the final
> linking of an executable.  The idea is for it to link all of the  
> bitcode
> files together, run the regular LTO passes, and then run my passes.   
> For
> Linux, I should be able to get the Gold linker to load my libLTO.so
> instead of the standard one, thereby allowing my passes to be run
> seamlessly when compiling large programs with complicated build  
> systems.
>
> Can something similar be done on Mac OS X?  Does the XCode linker
> dynamically load libLTO.dylib to perform link-time optimization?

Yes, it looks relative to itself to find it.  If you link with / 
Developer/usr/bin/ld, it uses /Developer/usr/lib/libLTO.dylib.

-Chris



More information about the llvm-dev mailing list