Talk:Clang

Some ideas
Hey! Here are some ideas...


 * 1) I think it'd be great to include on the wiki a few examples of packages that do compile fine with Clang.  That would help newbies start using it (without the risk of messing up their system).
 * 2) Also, perhaps you could have an FAQ with questions like,  "Should I file a bug if the package fails to build with Clang?  If not, is there some place I should report it?"
 * 3) Would it be kosher to post a link on this wiki to http://en.gentoo-wiki.com/wiki/Llvm ?

- David 15:51, 13. May 2012 (UTC)


 * As to your (3), yes, it is allowed to link to external resources. It would be even better to make a page in the wiki here with all relevant information. — yngwin 07:36, 15 June 2012 (UTC)

What compiles and what doesn't
As at 28th of July, 2012, the following packages require GCC to compile on a x86 Gentoo build, Intel CPU, in a VirtualBox VM.

- Lyallp 07:39, 28. Jul. 2012 (UTC)

Gentoo bugs for compilation failures

 * General tracker bug for Gentoo FreeBSD
 * dev-libs/libffi-3.0.11
 * dev-libs/openssl-1.0.0j
 * sys-libs/ncurses-5.9-r2

The bugs I listed above have patches that fix build failures.

- Gentoofan 12:42, 11. Jun. 2012 (UTC)

is clang-ar still needed?
In my llvm/clang installation I found /usr/bin/llvm-ar (describes itself as "OVERVIEW: LLVM Archiver (llvm-ar)"). I've replaced my AR make.conf variable with it, and it seems to work?

1. Is the wrapper you proposed still needed?

2. If not, and I can use the llvm-ar, I shouldn't need to pass parameters to it (it doesn't work if I set it to "AR=/usr/bin/llvm-ar --plugin /usr/lib/llvm/LLVMgold.so"), right?

3. Besides I found other llvm-* executables like llvm-link, llvm-as, and llvm-ranlib. Should I change LD, AS and RANLIB variable (respectively) in my make.conf?

- Spitfire 23:02, 5. Mar. 2015


 * This looks outdated. /usr/lib/llvm no longer exists. The llvm-ar manual doesn't list --plugin as an option so I would assume that's not the way to go. The gcc manual by contrast says that gcc-{ar,nm,etc} are just wrappers. --Ormaaj (talk) 13:08, 13 February 2016 (UTC)

The library path for the gold plugin is outdated on the article. LLVMgold.so resides in /usr/lib64/LLVMgold.so so it wouldn't be surprising if things have changed. For example, I can't get games-emulation/higan to compile based on the clang-lto.conf example in the article using clang-3.8.0. I can if I don't use lto. However, changing it to the following allows higan to compile and install.

This should be invoking lto via the -O4 flag and I'm not using the clang-ar wrapper posted in the article. I don't know how to see if it's actually linking though. Thoughts? - Moonchilde July 3, 2016