[cfe-dev] LTO on FreeBSD

SKL skl at simplekindalife.com
Tue Jun 29 15:05:58 PDT 2010


Hi.

I'm testing out clang on FreeBSD & OS X and have a few quick questions. 

On the Mac, I've managed to compile some basic C code with no issues. I can compile with the -O4 or -flto flags and everything works as expected.
On the FreeBSD side, I can compile with clang just fine, so long as I keep it at -O3 or lower. If I try to use any of the linktime optimization flags, I get the error:

clang: error: 'i386-portbld-freebsd9.0': unable to pass LLVM bit-code files to linker

>From my admittedly limited knowledge of clang/llvm, my understanding is that it's trying to link using the standard GNU binutils/ld instead of llvm-ld. GNU ld then chokes, not knowing what to do with the llvm-generated data. Is this right? 

What is the OS X version finding and using that the FreeBSD version isn't? I see mention on the llvm site of compiling and using the ld gold plugins, but that appears to be more for llvm-gcc than clang.

I'd appreciate any pointers in this area. 

Thanks,
SK






More information about the cfe-dev mailing list