Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Sep 2012 08:58:23 +0100
From:      David Chisnall <theraven@FreeBSD.org>
To:        toolchain@FreeBSD.org
Cc:        current@FreeBSD.org
Subject:   Re: Clang as default compiler November 4th
Message-ID:  <004BADDB-E79D-4497-89EE-641F0359E9BE@FreeBSD.org>
In-Reply-To: <20120910211207.GC64920@lor.one-eyed-alien.net>
References:  <20120910211207.GC64920@lor.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help
I'd add one more thing that needs fixing:

Clang should default to c89 mode when invoked as cc.  I had a patch to =
do this, but I seem to have misplaced it.  I'll try to find or rewrite =
it in the next couple of days. =20

A lot of the ports failures I saw were due to ports using cc as the =
default C compiler (autoconf seems to select it) and then using GNU89 =
inlining rules, so that they died with linker failures.  Given that =
POSIX deprecated cc in 1997, I'm quite tempted to say that we should =
just remove it entirely and just have c89, c99 and c11 (which the spec =
for cc says you should use instead), forcing people to explicitly select =
their language dialect, but that's a bikeshed for another day.

David

On 10 Sep 2012, at 22:12, Brooks Davis wrote:

> [Please confine your replies to toolchain@freebsd.org to keep the =
thread
> on the most relevant list.]
>=20
> For the past several years we've been working towards migrating from
> GCC to Clang/LLVM as our default compiler.  We intend to ship FreeBSD
> 10.0 with Clang as the default compiler on i386 and amd64 platforms.  =
To
> this end, we will make WITH_CLANG_IS_CC the default on i386 and amd64
> platforms on November 4th.
>=20
> What does the mean to you?
>=20
> * When you build world after the default is changed /usr/bin/cc, cpp, =
and
>   c++ will be links to clang.
>=20
> * This means the initial phase of buildworld and "old style" kernel
>   compilation will use clang instead of gcc.  This is known to work.
>=20
> * It also means that ports will build with clang by default.  A major
>   of ports work, but a significant number are broken or blocked by
>   broken ports. For more information see:
>     http://wiki.freebsd.org/PortsAndClang
>=20
> What issues remain?
>=20
> * The gcc->clang transition currently requires setting CC, CXX, and =
CPP
>   in addition to WITH_CLANG_IS_CC.  I will post a patch to toolchain@
>   to address this shortly.
>=20
> * Ports compiler selection infrastructure is still under development.
>=20
> * Some ports could build with clang with appropriate tweaks.
>=20
> What can you do to help?
>=20
> * Switch (some of) your systems.  Early adoption can help us find =
bugs.
>=20
> * Fix ports to build with clang.  If you don't have a clang system, =
you
>   can use the CLANG/amd64 or CLANG/i386 build environments on
>   redports.org.
>=20
> tl;dr: Clang will become the default compiler for x86 architectures on =
2012-11-04
>=20
> -- Brooks




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?004BADDB-E79D-4497-89EE-641F0359E9BE>