FreeBSD 10 To Use Clang Compiler, Deprecate GCC
An anonymous reader writes "Shared in last quarter's FreeBSD status report are developer plans to have LLVM/Clang become the default compiler and to deprecate GCC. Clang can now build most packages and suit well for their BSD needs. They also plan to have a full BSD-licensed C++11 stack in FreeBSD 10."
Says the article, too: "Some vendors have also been playing around with the idea of using Clang to build the Linux kernel (it's possible to do with certain kernel configurations, patches, and other headaches)."
The GPL.
Aside from the more or less irrelevant licensing issue, clang is all about the source analysis tools, refactoring, rewriting support. Uses less memory and time. Both caused by lack of optimization.
"Science flies us to the moon. Religion flies us into buildings." - Victor Stenger
Clang and FreeBSD aren't proprietary software. They're BSD-licensed open source. That code doesn't magically disappear when a company uses it.
Avoiding te GPL is the main reason. But Clang also has many technical superiorities to GCC too. Wikipedia gives a quick outline of them.
http://en.wikipedia.org/wiki/Clang
What's wrong with GCC?
Some people argue that LLVM/Clang offers better code generation, compile time warnings, and code analysis. Some compiler developers think the gcc code has become too bloated and complicated. Even gcc devs have described the gcc code as "cumbersome".
There are various efforts to get Linux building under LLVM/Clang. Especially for embedded environments.
1) It compiles slower than clang at -O0
2) It produces slower code than clang at -O3 and -Os
3) It's error and warning messages are not as good
4) It's not as modular as clang, which can be used in parts, to produce useful tools like CSA
5) The GPL.
the topic of this thread is "What's Wrong With GCC?", not "What's Wrong with the GPL"
One of the key design objectives of Clang is that it is highly modular, and implemented in such a way that various compilation stages are self-contained, and have clean APIs and data structures. This allows development tools such as IDEs to link directly against the stages of the compilation pipeline then need to implement syntax highlighting, code completion, refactoring tools and so on.
Apple's XCode does precisely this, and licensing and lack of modularity in the GCC source tree would have been major factors in their choice to support Clang and LLVM development.
The traditional way of implementing these functions in IDEs has been to effectively re-implement the front-end of the compiler (often not completely). This is a big deal when developing in C++ against the STL/Boost/TR1 when you find that code completion can't grok template properly. This is something that XCode and Visual Studio (which takes a similar approach) are both capable of doing.
There's a reason even the shining monument of GPL (Linux) uses GPLv2...
Even if Linus did want to move the kernel to GPLv3 (he doesn't), he would have to get every kernel contributor to agree to the license change, AFAIK.
Do what thou wilt shall be the whole of the Law
1) It compiles slower than clang at -O0
2) It produces slower code than clang at -O3 and -Os
3) It's error and warning messages are not as good
4) It's not as modular as clang, which can be used in parts, to produce useful tools like CSA
5) The GPL.
Got facts to back this up? Every benchmark I have seen as showed GCC producing faster code than Clang on 90% of the time, Phoronix benchmarks has in the last week showed this to be true.
---- GENERATION 26: The first time you see this, copy it into your sig on any forum and add 1 to the generation.
I'm just on my way back from BSDCan and the FreeBSD DevSummit. At the DevSummit, there was a Vendor Summit, for companies that use FreeBSD in their products. Not all were there (Sony, for example, was absent), but companies like Fusion IO, Yahoo, IX Systems, Juniper, Apple, and so on all sent people. There were about 40 companies represented in total, for a developer meeting with about 70 attendees.
I am TheRaven on Soylent News
Linux depends on gcc-specific extensions, and not just typedefs but exact layout in memory (which C doesn't specify), in-line assembly syntax http://www.ibm.com/developerworks/linux/library/l-gcc-hacks/
I am TheRaven on Soylent News
Tivo did exactly what RMS started the Free Software Foundation to prevent (The Printer Story). What did you expect would happen?
We don't have to guess which model works best, at this point we have historical data. Your model failed with respect to X. MIT created and maintained an X that they released via. the MIT license. All the UNIX vendors then took this MIT code and intermixed it with their custom code creating value add X's that were specific to their platform, and closed source. The effect was that the X that existed in the public domain was worthless for end users, and the X's that were worthwhile were closed. X itself couldn't progress because it fragmented so all the interesting stuff existed in other layers. Years later when there was a desire for a workable open X, the XFree86 project had to start, essentially from scratch and this took years. We still haven't gotten all the features that existed in those proprietary Xs 2 decades ago.
That is the classic example of why BSD style licensing doesn't work. The primary maintainer is not unchanging.
Conversely the GPL has a long history of successful multi corporate contributions over time. The historical data simply refutes your theory of what should work.