The llvm compiler does support link time optimization ( http://llvm.org/docs/LinkTimeOptimization.html ). For this to work correctly a plugin for the gold linker is necessary ( http://llvm.org/docs/GoldPlugin.html ). The gold linker comes automatically shipped with >=sys-devel/binutils-2.21 as ld.gold (along with the necessary plugin support enabled). So the only thing left to do is to provide the "--with-binutils-include=<...>" flag in the configure phase of the llvm ebuild. So I propose a new USE-flag "gold" for doing this. As soon as binutils-2.21 go stable, or the gold linker does replace the old GNU linker this USE-flag will become obsolete (one can just always enable --with-binutils-include). In the meantime the USE-flag would have the main effect that if a user doesn't care about the gold plugin he doesn't have to upgrade to an unstable binutils just for having llvm. Reproducible: Always
Created attachment 277285 [details, diff] Proposed ebuild with USE-flag "gold" The proposed ebuild with support for a "gold" USE-flag. This would go along with a line sys-devel/llvm:gold - Build the LLVMgold.so plugin for the gold linker necessary for link time optimization in use.local.desc
Created attachment 277291 [details, diff] Proposed ebuild with USE-flag "gold" *blush*
Thanks for the report! While working on llvm 3.0 ebuild (still rc), I tried to enable the gold plugin, but sadly binutils 2.21.1 is not new enough for it: http://llvm.org/bugs/show_bug.cgi?id=9674 Keeping the bug open in the meantime :) Also I think the "gold" USE-flag will stay for some time, as I am not sure binutils-apple has gold linker
With binutils 2.22 out , I could finally test the plugin compilation. Support for gold plugin is available in 3.0_rc ebuild based on your patch, and will soon be available when 3.0 final is out. Thanks again for the report!
(In reply to comment #4) > Thanks again for the report! Thanks for including the patch :)