Progress on LLVM clang

| 1 Comment

As some of you already know, FreeBSD, along with some other Open Source projects, is moving away from GCC due to GPLv3. From a technology perspective, this also makes sense since the (likely) candidate, BSD-style licensed, LLVM based clang, a C compiler, is making reasonably good progress.

So, what should we expect from LLVM or clang?

Here is a good comparison between GCC and clang. Despite GCC is popular, considerably more mature, and supports more languages (especially C++, which clang's support is incomplete at this moment), clang provides cleaner AST (Abstract Syntax Tree), much more modularized (if you take a look at GCC's history, Richard Stallman intentionally made GCC's code not reusable in other software), provided much more information for optimizer, is much faster and use much less memory, etc.

For FreeBSD, currently, clang can compile its kernel with only very few tweaks.

Why yet another compiler is so important?

First off, LLVM provided a very nice infrastructure that is being used by a wide variety of applications, including open source and closed-source commercial product. Being exercised by various parties, the code would get mature more faster, and more likely, bugs are being found and fixed fast. LLVM and clang has been supported by companies that uses it, giving full time developers and code back to the project.

Moreover, the design decision of LLVM/clang is technology oriented, giving it better chance to survive in complex optimization scenarios, and the clean design means it is much easier to debug the compiler toolchain itself, and the compiler can run faster.

The final point. As an Open Source project, for FreeBSD itself, GPLv3 does not actually limit our ability to publish our code. However, adopting GPLv3 code into the base system, may cause problems for users who does not wish to be encumbered by the license terms. We believe that giving the user more choices would be beneficial.

1 Comment

什么时候LLVM能替代GCC变成默认的编译系统?

Leave a comment

About this Entry

This page contains a single entry by Xin LI published on January 29, 2009 2:28 AM.

New strlen(3) committed was the previous entry in this blog.

GCC运行环境豁免条款再次狠狠地打了苹果的耳光 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Pages

OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.01