Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 May 2010 12:33:18 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        rdivacky@FreeBSD.org
Cc:        current@FreeBSD.org
Subject:   Re: Importing clang/LLVM into FreeBSD HEAD
Message-ID:  <20100531.123318.1097297678389159803.imp@bsdimp.com>
In-Reply-To: <20100531161713.GA60782@freebsd.org>
References:  <20100531075248.GA15206@freebsd.org> <20100531161409.A399B5B30@mail.bitblocks.com> <20100531161713.GA60782@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20100531161713.GA60782@freebsd.org>
            Roman Divacky <rdivacky@freebsd.org> writes:
: On Mon, May 31, 2010 at 09:14:09AM -0700, Bakul Shah wrote:
: > On Mon, 31 May 2010 09:52:48 +0200 Roman Divacky <rdivacky@freebsd.org>  wrote:
: > > 
: > > I would like to propose to integrate clang/LLVM into FreeBSD HEAD
: > > in the near future (days, not weeks).
: > > 
: > > clang/LLVM is a C/C++/ObjC compiler (framework) which aims to possibly
: > > replace gcc. It is BSDL-like licensed. The sources are ~45MB (the
: > > svn checkout is 97MB). Clang/LLVM is written in C++.
: > > 
: > > Clang can compile all of FreeBSD on i386/amd64 including world and booting
: > > kernel. Other architectures that are close to working are MIPS, PowerPC
: > > and ARM. We have a branch (clangbsd-import) that just includes clang/LLVM
: > > sources and the build infrastructure and this is what we aim to integrate
: > > at first.
: > >
: > > The import of clang/LLVM was discussed at the toolchain summit May 10th
: > > but I would like to hear your opinion. I got approval from core@ on
: > > importing it.
: > > 
: > > So please share your support or resistance to the idea of importing clang.
: > > 
: > > Roman Divacky
: > 
: > I already use clang for some things but I think the issue
: > here is not support/resistance but something else:
: > 
: > * IMHO for a change of this nature the core needs to publish
: >   a set of clear acceptance criteria for importing clang.
: >   Can this be done?
:  
: I asked core@ and they support the import

They support the import, in the context of the larger plan, which
you've not articulated.  Let's be clear here.

: > * Since clang doesn't support all the archs, what is the plan
: >   for unsupported archs?
: >   a. Is FreeBSD going to have both compilers in the base?
: 
: yes, this is what this import is about - importing clang, 
: nothing else changes

There's more context here too.  To improve the support of various
architectures, we're planning on doing two things.  First, we're
updating binutils to the latest gplv2 version.  This will solve many
problems.  There's some other plans in this area as well, but the
summary is basically integrating some important vendor patches.
Second, we're planning to have the ability to use an external, perhaps
vendor supplied, tool chain.  You can kludge this together today, but
it is tedious and difficult.

: >   b. Is the project drop these FreeBSD ports? or
: 
: no, of course not
: 
: >   c. Do people have to import gcc from ports to build these
: >      FreeBSD ports?
:  
: nothing is being changed, just one more application after
: a buildworld/installworld appears (that being clang)
: 
: > * What about ports?

The plan that was articulated at the toolchain summit was to install
clang as clang, and gcc as cc, so that /usr/ports continue to work.
There's a lot of work needed to make all the ports work with clang.
There's a summer of code project to make it possible to select a
default compiler to built ports.

There's a missing piece of functionality that was agreed to in the
clang tree right now.  There needs to be support for
'WITH_CLANG_BOOTSTRAP' to build the system with the clang, but leave
gcc as the default compiler for ports.  There also needs to be support
for WITH_CLANG_IS_CC which would also make clang the default.

: > * Basically the core needs to lay out a roadmap.

There was supposed to be a summary of the roadmap posted, but that's
not yet happened...  Roman really should have waited to push ahead
until this was posted because it does answer the bigger picture
questions.

: > It is clear that not everyone has the same view of what the
: > acceptance criteria might be so publishing it would help
: > people understand what to expect.
: 
: nothing changes for the ports, there's an ongoing project to enable
: ports to be usable with clang (or some other compiler) but thats
: orthogonal to this.

Part of the problem with this thread is that the whole, agreed plan
wasn't laid out at the first part of it, so people are freaking out
about what the plans are for the future.  They were discussed and
first order agreement was reached at the tool chains summit.  But part
of the agreement was to post the whole agreement so people know and
understand the various trade offs.

I think that would go a long way towards answering the questions that
are being raised and to quell the visceral reaction that I've seen in
this thread....

Warner



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