Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 408963 (systemwide-clang) - [TRACKER] Support LLVM/Clang as alternative system compiler
Summary: [TRACKER] Support LLVM/Clang as alternative system compiler
Status: CONFIRMED
Alias: systemwide-clang
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All All
: High enhancement with 56 votes (vote)
Assignee: Richard Yao
URL:
Whiteboard:
Keywords: Goal, Tracker
Depends on: 410945 427346 502464 509696 509700 523260 523560 557874 587094 588226 596352 603738 624070 624186 403071 406163 409267 409269 417171 417181 417349 417537 417541 417545 417547 417703 freebsd-clang-3.1 417913 418137 418141 420121 422829 427206 427298 427300 427304 427310 427314 427316 427318 427320 427322 427324 427326 427330 427338 427342 427344 427348 427350 427352 427796 427808 430040 432924 434928 435506 446080 448714 449060 449366 449368 449370 449376 449378 449380 450270 451986 454980 455414 456298 457630 457950 457966 458134 458142 458154 458254 458316 458324 458916 458932 462608 462832 464758 464882 464982 466010 466312 467986 476554 478338 483376 483408 483412 483540 485146 485310 502408 502450 502452 502454 502458 502460 502462 502466 502470 502472 502474 502476 502478 502480 503352 504170 504228 506902 506934 508214 509698 509702 509704 509712 510102 513054 517554 517620 519006 519362 520182 520194 523096 526832 526842 551238 551466 551518 554384 554392 558080 558084 561662 561726 564526 587122 587248 587442 587996 588488 588772 589936 589948 595286 596504 596506 596546 601504 607848 608248 624190 624192 629410 630634 646360 688730 695612 698022
Blocks:
  Show dependency tree
 
Reported: 2012-03-20 07:13 UTC by Richard Yao
Modified: 2019-10-19 01:01 UTC (History)
61 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Yao gentoo-dev 2012-03-20 07:13:22 UTC
LLVM/Clang seems to be the future as far as open source compilers go. The FreeBSD developers switched to LLVM/Clang in FreeBSD 9 and the Debian project appears to be considering a switch as well. They did a survey that shows that only 8.8% of their packages fail to build with LLVM/Clang 3.0:

http://clang.debian.net/

It is probably a good time to look into building Gentoo with LLVM/Clang. FreeBSD upstream has already switched, so this should work well for Gentoo/FreeBSD. With some work, this could be leveraged by Gentoo Linux and Gentoo Prefix as well.

As per a chat I had with bonsaikitten (Patrick Lauer) in IRC, I am filing this bug to serve as a tracker for progress on this.
Comment 1 Alexandre 2012-08-03 02:17:11 UTC
I found this project and then I think it's may be interesting:

https://github.com/chneukirchen/obase

They are porting the OpenBSD useland for Linux.

In Arch Linux AUR are some PKGBUILDs about, but I don't know if already functional.

https://aur.archlinux.org/packages.php?ID=56826
Comment 2 gentoo@aoibh.in 2012-11-27 21:35:44 UTC
I'd love to start a project within the Gentoo community to start the transition from the inferior GCC to Clang. Would be a very interesting and rewarding project I think.
Comment 3 Richard Yao gentoo-dev 2012-12-16 05:31:36 UTC
(In reply to comment #2)
> I'd love to start a project within the Gentoo community to start the
> transition from the inferior GCC to Clang. Would be a very interesting and
> rewarding project I think.

I am going to blame Hurricane Sandy for putting me behind on bug mail. Gentoo is quite large and I am one developer. It would be better to do this as a community effort and if people are interested in that, then it would be best to take this to the gentoo-dev mailing list. If you are strongly interested in doing this, I suggest that you subscribe to the gentoo-dev mailing list and send an email to the list about this. Instructions on how to subscribe are on the following webpage:

http://www.gentoo.org/main/en/lists.xml
Comment 4 Oleg Ageev 2013-07-17 21:04:27 UTC
If we want have systemwide-clang
first we need remove dependencies from gcc
remove from all packages
and first remove from llvm ebuild
llvm don't need dependency on gcc
we can check gcc version at pkg_pretend
and throw error if have broken gcc version
but this check need only if we use gcc as CC for build llvm.
Determine which compiler we use we can in pkg_pretend,
but we need remove gcc_version and Co from toolchain-funcs.eclass and split that in separate gcc-version.eclass
or clang-vesion.eclass
gcc-version
use CPP for determine version of gcc,
but for clang it's work too
clang return 4.2 if CPP=clang and call gcc-version
but...
what does what mean?
and determine compiler from tc-getCC
it's not best way
what if CC=cc and cc it's symlink to clang or script that call clang?
maybe we have better solution?

PS: dependencies to gcc don't need for all package
systemwide compiler it's part of system
and we have systemwide compiler in /usr/portage/profile/../packages
systemwide compiler always have last supported version
and if some package need specific version of system wide compiler
we should determine this in pkg_pretend
Comment 5 Austin English (RETIRED) gentoo-dev 2014-02-26 01:28:21 UTC
There are a couple missing dependencies:
bug 417795 (dev-libs/openssl)
bug 458932 (media-libs/libaacplus)

as well as a few I just filed:
bug 502450 (app-crypt/seahorse)
bug 502452 (dev-lang/tcc)
bug 502454 (media-libs/gstreamer)
bug 502458 (net-libs/glib-networking)
bug 502460 (net-libs/libsoup)
bug 502462 (sci-libs/fftw)
bug 502464 (sys-apps/memtest86+)
bug 502466 (sys-apps/ipmiutil)
bug 502470 (sys-boot/efibootmgr)
bug 502472 (sys-devel/autogen)
bug 502474 (sys-fs/udisks)
bug 502476 (sys-libs/glibc)
bug 502478 (x11-libs/cairo)
bug 502480 (x11-misc/lightdm)

btw, bugzilla seems to have an off by one, it's skipping all odd numbers. See above numbers ;)
Comment 6 andrey.kudryavtsev 2014-02-26 22:19:26 UTC
I'm slowly (manually) moving lots of my packages over to LLVM/Clang (using the environment portage feature).
Here's a gist of packages that work! (I'll update it periodically).
Once I'm finished with my porting, I'll also file a bug report for every package that _doesn't_ work.

https://gist.github.com/Shingetsu-Kurai/9235783