llvm/clang once more
ahornung at gmail.com
Tue Mar 17 01:00:36 PDT 2009
Matt, sorry for sending this twice to your mail; I forgot to add the
mailing list as CC the first time.
clang uses __clang__ as preprocessor "identifier". Be sure not to
conditionalize the other branch on __GNUC__ or similar, as clang also
PS: For the curious (from lib/Lex/Preprocessor.cpp):
// Compiler version introspection macros.
DefineBuiltinMacro(Buf, "__llvm__=1"); // LLVM Backend
DefineBuiltinMacro(Buf, "__clang__=1"); // Clang Frontend
// Currently claim to be compatible with GCC 4.2.1-5621.
DefineBuiltinMacro(Buf, "__VERSION__=\"4.2.1 (Apple Computer, Inc. "
"build 5621) (dot 3)\"");
On Mon, 2009-03-16 at 16:36 -0700, Matthew Dillon wrote:
> :I've managed to get our GENERIC kernel to compile with llvm/clang.
> :is still one temporary fix (at least until clang guys fix the related
> :bug), but the kernel definitely compiles, boots and works stable.
> :As a stress test I've done a buildworld, which it survived without
> :I've put everything about DragonFly and llvm/clang so far together on
> :one page, http://leaf.dragonflybsd.org/~alexh/clang/clang.html in
> :you are interested in details or even want to try it yourself.
> I assume clang defines a preprocessor symbol identifying that
> is the compiler? What is that symbol? I would be happy to commit
> that patch at the end suitably conditionalized for clang (just so
> know the hack is for clang and can remove it later on when clang
> Matthew Dillon
> <dillon at backplane.com>
More information about the Kernel