Jump to content
Read the Funtoo Newsletter: Summer 2023 ×

Clang and Portage


Recommended Posts

I'm curious if there is any current effort to track packages not building under Clang/LLVM.  FreeBSD switched as a default, and I've heard that Debian was considering a switch at one point.  Gentoo seemed to have an effort to track packages, but it seems like it may have fallen off the radar.


There are some major blockers, like glibc, but the list already seems fairly small.  Are there any formal plans for support Clang/LLVM as a system compiler going forward?

Link to comment
Share on other sites

The Gentoo tracker bug is just for Gentoo FreeBSD. That's probably because Clang is the default compiler for FreeBSD. Keep in mind that the primary reason FreeBSD switched to Clang as the default compiler was because Clang is BSD-licensed instead of GPL-licensed. It wasn't because of technical reasons. GCC is still a more reliable compiler.


That said, I'm assuming that the current attitude toward package compatibility with Clang is that it's primarily an upstream issue. In other words, if a package fails to compile with Clang, bugs should be filed either with the developers of Clang if it is a compiler bug or with the developers of specific software if it is an issue with the code. Gentoo would probably accept patches which allow packages to compile with Clang if they were submitted, but those patches should also be submitted upstream -- assuming the package is still being developed.

Link to comment
Share on other sites

Technically it's UoI-NCSA licensed, which essentially is BSD-3.  Clang/LLVM is still a newer compiler, and GCC is generally still more mature particularly where optimization is important.  Although, my experience is that compiling against more than one compiler tends to improve overall code quality, generally regardless.


Actually, I had noticed a funtoo wiki page on it (also gentoo), so I was curious if there were plans going forward.  I've personally been experimenting with it on my laptop, and I've had somewhat stable results so far.  There are some blockers and show stoppers though,  I'm submitting what I can upstream as I have time.


If anyone is curious or wants to experiment, I'm keeping track of issue packages here, generally including versions.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...