# LLVM/Clang - Default compiler in FreeBSD 9?



## frooyo (Dec 21, 2011)

1a. Is LLVM/Clang the default C/C++ compiler for FreeBSD 9 (amd64)?

1b. If so, how do I envoke the llvm compiler, meaning - what's the equivalent of running "gcc ..."?

2. Was all of FreeBSD 9 (amd64) built using LLVM/Clang solely (no GCC)?

3. Is GCC completely removed from FreeBSD 9 (amd64)?


----------



## darcsis (Dec 21, 2011)

1. No
2. Search 'clang build' on wiki.freebsd.org for details about how to employ 'llvm/clang' while compile things.
3. For kernel and base system, yes. for the ports system, no. Many ports need patches to be built with clang. And some won't compile if clang is used.
4. No


----------



## wblock@ (Dec 21, 2011)

1a. No, but it's available as an alternate to gcc.
1b. "clang ..."

2. No, although it can be: http://wiki.freebsd.org/BuildingFreeBSDWithClang

3. No.  Maybe later.


----------



## frooyo (Dec 21, 2011)

wblock@ said:
			
		

> 1a. No, but it's available as an alternate to gcc.
> 1b. "clang ..."
> 
> 2. No, although it can be: http://wiki.freebsd.org/BuildingFreeBSDWithClang
> ...



What's the current planned date to complete replace GCC with LLVM/Clang?

That status page doesn't make it clear.


----------



## wblock@ (Dec 21, 2011)

Probably no date, just "when it's ready".


----------



## frooyo (Dec 21, 2011)

Thanks.
We can mark this topic closed.


----------



## gkontos (Dec 22, 2011)

frooyo said:
			
		

> What's the current planned date to complete replace GCC with LLVM/Clang?
> 
> That status page doesn't make it clear.



Just to add here a few things. The main issue with this replacement is not with FreeBSD world & kernel. At least on i386 and amd64 architectures. The problem is getting ports to successfully compile. You can get some clues here:

http://wiki.freebsd.org/PortsAndClang


----------



## arrowdodger (Dec 22, 2011)

IIRC, removing all GPL bits from base is planned for FreeBSD 10.


----------



## frooyo (Dec 23, 2011)

arrowdodger said:
			
		

> IIRC, removing all GPL bits from base is planned for FreeBSD 10.



Excellent!


----------



## Oleg_NYC (Dec 23, 2011)

So, gcc 4.2.1 will be removed from the base system of FreeBSD 10? That's good news.


----------



## vertexSymphony (Dec 23, 2011)

oleglelchuk said:
			
		

> So, gcc 4.2.1 will be removed from the base system of FreeBSD 10? That's good news.



Well, as long as base system and ports cant be comfortably built with Clang, GCC will be there ... once that problem is gone, yeah, GCC 4.2 will be killed wih fire from base system and if a ports depends on it, well, it will depend on the gcc-4.2 (or a newer) port x'3
Here's the actual status of all this:

http://wiki.freebsd.org/BuildingFreeBSDWithClang
http://wiki.freebsd.org/GPLinBase
http://wiki.freebsd.org/PortsAndClang


----------



## Beastie (Dec 23, 2011)

gkontos said:
			
		

> http://wiki.freebsd.org/PortsAndClang





> On the most recent run, you will note hundreds of regressions from a comparable run: 18036 packages were built (out of 22938), and there were 1161 errors.


It's still relatively early but already looking quite promising. Over 18,000 is not that bad!


----------



## vertexSymphony (Dec 23, 2011)

Beastie said:
			
		

> It's still relatively early but already looking quite promising. Over 18,000 is not that bad!



Well, the fact that they build doesn't mean that they work, they may fail at runtime.
But it's a promising number indeed


----------

