1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Memory
  5. Motherboards
  6. Processors
  7. Software
  8. Storage
  9. Operating Systems


Facebook RSS Twitter Twitter Google Plus


Phoronix Test Suite

OpenBenchmarking.org

FreeBSD 10 To Use Clang Compiler, Deprecate GCC

BSD

Published on 12 May 2012 08:01 PM EDT
Written by Michael Larabel in BSD
93 Comments

As indicated by the Q1-2012 FreeBSD Status Report, LLVM's Clang compiler is quickly replacing GCC for this popular BSD operating system. The developers are also making much progress in a GNU-free C++11 stack. For FreeBSD 10 they're aiming for Clang as the default C/C++ compiler, deprecate GCC, and to have a BSD-licensed C++ stack.

While the Q1-2012 FreeBSD Status Report was just talked about in the afore-linked article, the Clang and C++ items warranted their own more detailed article.

Going back to 2009, FreeBSD developers have worked to replace GCC with LLVM/Clang. Over time, there's been numerous improvements especially with the FreeBSD 9.0 release. The FreeBSD developers are interested in doing away with the GPL-licensed GNU Compiler Collection and instead use the Apple-sponsored LLVM/Clang work that's under a BSD-like license.

As reported in the status report for the last quarter, Clang 3.0 is now installed by default for FreeBSD 10.0-CURRENT and 9.0-STABLE. They're also working to import a newer Clang snapshot since LLVM 3.1 and Clang 3.1 are about to be released (next week). On FreeBSD 10.0-CURRENT, Clang can now build world and the generic FreeBSD kernel without emitting any error warnings. With more recent revisions, a new WITH_CLANG_IS_CC option will make Clang become the default cc, c++, and cpp commands.

The intent is to make Clang become the default compiler for FreeBSD 10.0 and to then deprecate GCC from FreeBSD. "The intent is to switch on this option by default rather sooner than later, so we can start preparing for shipping 10.0-RELEASE with Clang as as the default system compiler, and deprecating gcc."

Additional information on building FreeBSD with Clang is available from this FreeBSD.org Wiki page. Any FreeBSD package not building under Clang should be treated as a bug; "One of the most important tasks at the moment is to actually build and run your entire FreeBSD system with Clang, as much as possible. Any compile-time or run-time problems should be reported to the appropriate mailing list, or filed as a PR. If you have patches and/or workarounds, that would be even better."

There's also been other non-Apple operating systems toying with Clang for different use-cases. There was also the Debian Clang experiment, which could build most of the Debian packages for popular architectures, but LLVM/Clang still falls behind in its support of the more obscure CPU architectures and platforms compared to GCC. 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).

LLVM/Clang is unlikely to replace GCC on any tier-one Linux distribution as the default in the foreseeable future, but it's interesting as a complementary option. Clang is quite good with its static analysis abilities, among other benefits.

In terms of FreeBSD's mission for a GNU-free C++11 stack, the libc++ and libcxxrt libraries have gained new features, support for the ARM EABI, and with Clang 3.1 can now pass all C++11 atomic tests. The libcxxrt library is the new C++ run-time that was given by PathScale. There's still some work ahead in this area, but the status report mentions, "we're on track for a BSD licensed C++ stack in 10.0."

About The Author
Michael Larabel is the principal author of Phoronix.com and founded the web-site in 2004 with a focus on enriching the Linux hardware experience and being the largest web-site devoted to Linux hardware reviews, particularly for products relevant to Linux gamers and enthusiasts but also commonly reviewing servers/workstations and embedded Linux devices. Michael has written more than 10,000 articles covering the state of Linux hardware support, Linux performance, graphics hardware drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated testing software. He can be followed via and or contacted via .
Latest Linux Hardware Reviews
  1. Even With Re-Clocking, Nouveau Remains Behind NVIDIA's Proprietary Linux Driver
  2. The Power Consumption & Efficiency Of Open-Source GPU Drivers
  3. AMD R600g/RadeonSI Performance On Linux 3.16 With Mesa 10.3-devel
  4. Intel Pentium G3258 On Linux
Latest Linux Articles
  1. AMD Catalyst 14.6 Does Slightly Better With APITest OpenGL Tests
  2. Updated Source Engine Benchmarks On The Latest AMD/NVIDIA Linux Drivers
  3. Nouveau vs. Radeon vs. Intel Tests On Linux 3.16, Mesa 10.3-devel
  4. KVM Benchmarks On Ubuntu 14.10
Latest Linux News
  1. Fedora Assembles A Security Team
  2. AMD Launches The A10-7800, The 65 Watt Kaveri
  3. Builder: A New Development IDE Being Built For GNOME
  4. GDB 7.8 Betters Python Scripting, Adds Guile Support
  5. GNOME's GTK+ Is Still Striving For A Scene Graph, Canvas API
  6. Unreal Tournament Looks Great For Team Deathmatch
  7. LibreOffice 4.3 Released With Many Exciting Changes
  8. GNOME/GTK On Wayland Gains Focus At GUADEC
  9. GNOME Stakeholders Take Issue With Groupon Over their Gnome
  10. GStreamer VA-API Plug-In Update Adds New Features
Latest Forum Discussions
  1. Grand Theft Auto Running On Direct3D Natively On Linux Shows Gallium3D Potential
  2. AMD Publishes Open-Source Linux HSA Kernel Driver
  3. Linus Torvalds On GCC 4.9: Pure & Utter Crap
  4. Debian + radeonsi
  5. Open-source drivers on ATI R7 260X
  6. AMD Athlon 5350 APU On Linux
  7. Updated and Optimized Ubuntu Free Graphics Drivers
  8. List of Linux friendly Kickstarter projects