Linking Bitcode Files on MacOS X

Dear All,

I'm trying to create whole bitcode files for applications on Mac OS X (i.e., compiling everything to LLVM bitcode and then linking it together into one large bitcode file). I'm currently doing this by modifying Makefiles to compile programs with llvm-gcc/g++ and then linking with llvm-ld.

Is there a simpler way to do this? I've heard that the native linker on Mac OS X now supports LLVM bitcode files. Is this true, and if so, can it be used to make this process easier?

Thanks in advance.

-- John T.

Yep, just download Xcode 3.1 or later. /Developer/usr/bin/ld will do the job. IIRC, /usr/bin/ld won't, because it looks relative to itself for liblto.dylib, and there is no liblto installed in /usr/lib. You can install it there yourself of course, and you can also install a liblto from mainline LLVM and it should work with the system ld.