Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Nov 2012 22:29:45 -0500
From:      Brooks Davis <brooks@freebsd.org>
To:        freebsd-current@freebsd.org
Subject:   November 5th is Clang-Day
Message-ID:  <20121102032945.GF65074@lor.one-eyed-alien.net>

next in thread | raw e-mail | index | archive | help

--Ls2Gy6y7jbHLe9Od
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Monday, November 5th I plan to commit the following patch to make
clang the default compiler on i386 and amd64.  Many people have worked
long and hard to make this a reality and we're finally close enough to
throw the switch.  For many users the transition should be transparent.
Others will likely hit some bumps, but I think we've addresses most
major issues at this point and the LLVM community has demonstrated it's
ability and willingness to help given actionable bug reports.

Known Issues
 - Not all ports compile with clang.  This can be worked around in
   individual ports by setting USE_GCC=any which will cause the base gcc
   to be used.  Depending how things shake out we may end up making
   USE_GCC=any the default for a period. [0]
 - Not all libm tests pass.  More work by subject matter experts is
   required to create tests cases for LLVM developers.  Most problems are
   not expected to be major in practice given that LLVM is being used for
   scientific computing in a number of products including Cray's FORTRAN
   compiler, most OpenCL compilers, and the Julia language.
 - Small but noticeable slowdown in some benchmarks.  For example
   sysbench against mysql was found to run about 1% slower on top of a
   clang compiled world+kernel. http://people.freebsd.org/~flo/perf.pdf

Known Non-Issues
 - "make buildenv" works fine with clang.

-- Brooks

[0] Work is underway to switch to building ports with a ports specific
compiler version.  Likely this will be gcc-4.6 initially.  This would
help insulate ports from the base compiler.  That being said, there are
significant advantages to getting as many ports as possible to build
with clang.  Among other things, cross building for embedded systems is
much easier with clang.


Index: share/mk/bsd.own.mk
===================================================================
--- share/mk/bsd.own.mk	(revision 242464)
+++ share/mk/bsd.own.mk	(working copy)
@@ -426,7 +426,6 @@
     BIND_XML \
     BSDCONFIG \
     CLANG_EXTRAS \
-    CLANG_IS_CC \
     CTF \
     HESIOD \
     ICONV \
@@ -455,6 +454,12 @@
 .else
 __DEFAULT_NO_OPTIONS+=CLANG
 .endif
+# Clang the default system compiler only on x86.
+.if ${__T} == "amd64" || ${__T} == "i386"
+__DEFAULT_YES_OPTIONS+=CLANG_IS_CC
+.else
+__DEFAULT_NO_OPTIONS+=CLANG_IS_CC
+.endif
 # FDT is needed only for arm, mips and powerpc
 .if ${__T:Marm*} || ${__T:Mpowerpc*} || ${__T:Mmips*}
 __DEFAULT_YES_OPTIONS+=FDT

--Ls2Gy6y7jbHLe9Od
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iD8DBQFQkz4oXY6L6fI4GtQRAsA+AJwJRcrP2jdf6pex1HXFdvlOYOzr3ACguuiw
sIeHeLUDCA2RXQgr4se+js4=
=pOe0
-----END PGP SIGNATURE-----

--Ls2Gy6y7jbHLe9Od--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121102032945.GF65074>