From: Torok Edwin
gold, ar and nm all support plugins now, so everything should be + in place for an easy to use LTO build of autotooled projects:
++export CC="$PREFIX/bin/llvm-gcc -use-gold-plugin" +export AR="$PREFIX/bin/ar --plugin libLLVMgold.so" +export NM="$PREFIX/bin/nm --plugin libLLVMgold.so" +export RANLIB=/bin/true #ranlib is not needed, and doesn't support .bc files in .a +export CFLAGS="-O4" ++
The environment variable settings may work for non-autotooled projects + too, but you may need to set the LD environment variable as well.
+