Why Clang?

Matthew Seaman matthew at FreeBSD.org
Mon Jun 18 07:29:13 UTC 2012


On 18/06/2012 05:37, Thomas Mueller wrote:
> What is the current status of Clang vs. GCC as default compiler for ports and for
> "make buildworld" and "make buildkernel" in HEAD and 9.0-STABLE?

Most ports work fine with clang -- at the last count 18252 out of 23661
ports compiled just fine.  Of the failing ports, around a thousand are
caused by a broken dependency, so the situation is actually better than
it appears.

See: http://wiki.freebsd.org/PortsAndClang

> Now one concern is wine not working when Clang is used to "make buildworld".

That's not one of the ports listed as failing in the page above (but
that only tests building the port, not if it actually performs its
intended function), nor are there any open PRs on the subject.  Please
can you open a PR showing how to reproduce the problem?

> I see from reading the emailing lists that the intention is to make
> Clang the default (or only?) compiler suite for 10.0-RELEASE.

clang will be the only compiler in the base system, true.  However there
are a number of C/C++ compilers available from ports, and there is work
going on to allow switching between those and the base system compiler
more easily when compiling ports.  You aren't going to be forced to use
clang if you don't want to (although I can't understand why you wouldn't
want to. It's an excellent compiler.)

> I realize that still leaves much time to work out many of the bugs.

clang already compiles the system perfectly well.  I'm using it by
default for that on my personal machines without problems.  Any
remaining clang-bugs in the system would be few and far between and
generally in areas which are quite hard to trigger.

clang with ports is less well covered.  A lot of ported code is not
written to the highest quality, nor does it conform to recently (or not
so recently) published standards.  It's a hard task for any compiler.

One point that possibly hasn't been as apparent as it might is that
FreeBSD adopting clang has had a big effect on clang development, and
not just the other way round.  We're discovering bugs and getting fixes
committed upstream pretty effectively.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20120618/86731d04/signature.pgp


More information about the freebsd-questions mailing list