FOSSLC is a non-profit organization that specializes in technology and know-how to record conferences with excellent quality. Click on the icons below to view great videos from communities we are actively involved with:

 

ClangBSD

in BSDCan, BSDCan2010, gcc, Programming, BSD

Location

Ottawa, ON
Canada
45° 24' 41.6592" N, 75° 41' 53.4984" W

Replacing gcc with clang as the FreeBSD system compiler

FreeBSD currently uses gcc as its system compiler. Because of a political decision on GPLv3 we are stuck with version 4.2.1. Recently a new possible candidate for system compiler arised - clang (based on LLVM). We are currently maintaining a branch of FreeBSD that uses clang as the system compiler for C/ObjC/C++. The talk aims to describe the history, current status and future possibilities of clang in FreeBSD as presented in the clangbsd branch.

The system compiler is integral and absolutely necessary part of the FreeBSD operating system. We have used gcc for almost the whole life of FreeBSD. It supports all of the architectures we need, it provides some tweaks we added over the time and generally serves us quite well. Unfortunatelly gcc switched to GPLv3 which is incompatible with FreeBSD, as decided by core, thus we are stuck with quite old gcc version 4.2.1. There are other problems with gcc, mostly awkward dealing with upstream. A very similar story goes on with the assembler and linker.

At first a students project that grew into industry supported solution, mostly backed by Apple, the LLVM emerged. One of the LLVM's subprojects is a C/ObjC/C++ compiler. The whole package of LLVM+clang reached the state when it can compile basically all of FreeBSD and a branch of FreeBSD integrating clang into it was established and is being maintained. The other interesting LLVM subproject is llvm-mc, the assembler and dissasembler based on LLVM. There's also compiler-rt, a possible replacement for libgcc.

This talk aims to introduce you to the current state of clang/llvm on FreeBSD, what it can do, what are the advantages over gcc and what are the last missing pieces. At last I'd like to discuss the possibility of integrating clang into FreeBSD as the system compiler.

Minutes: 
14
Event: 
BSDCan2010
Speaker: 
Roman Divácký
Filmed: 
13.05.2010