2012
The Challenges of GCC adoption
Picking up from last week’s entry, on the genesis of GCC, now leads to the heart of our story. GCC is suffering technically and legally. On the technical side, GCC is now a vast sprawl of code developed and enhanced repeatedly over the last 30 years. While principles and practices in compiler theory have remained largely the same, software design principles have advanced.
In particular, the modularity of GCC is very limited, which reduces it usefulness in the current world where component elements of an overall compiler environment are needed for experimental and production software programs. Additionally GCC is primarily written in C, which limits the software engineering potential of the compiler. The tenets of modern object-oriented software design, such as abstraction, encapsulation, and polymorphism, cannot be easily applied to the GCC codebase, and so the sprawl continues.
On the legal side, GCC had “advanced” to a new version of the GNU Public License, specifically version 3. Version 3 of the GPL contains legal elements that raise substantial concerns about the independence of software (and devices running the software) that is compiled with the compiler. While it is not our intention to debate the specifics of GPLv3 and the substance of those concerns, the simple fact is that those concerns are a tremendous driver towards more “business friendly” alternatives.
In the early-2000’s, a new compiler technology got started by Chris Lattner at the University of Illinois at Urbana-Champaign, call LLVM, for “low level virtual machine”. This new technology has been developed into a very robust, highly modular and modern suite of compiler components focused on the middle and back-end elements of the compilation process (such as code generation, registers allocation, and optimization vs. the front-end high level language parsing component). Well-defined intermediate representations of object code (“bit code”) along with standardized API’s into the LLVM components for manipulation of bit code enables a wide variety of language related tools to be built from or integrated into this technology.
Also, on the legal side, LLVM is licensed with a “BSD” style license. This license, in contrast to the GPLv3, is extremely business friendly, generally allowing anyone to take a copy and privatize it if they wish, or alternative develop and contribute source code back into the LLVM community and body of code. Use of derived versions of LLVM is burdened with no legal restrictions.
The front-end of compilers built with LLVM have historically been based on GCC code, but that now is evolving rapidly. A prime industrial supporter of the LLVM technology has been and continues to be Apple, and they have developed an open source (also BSD licensed) front-end called “clang” (for “C language”). Where LLVM provides the highly modular back-end platform, clang provides a platform for building front-end tools with better diagnostics, IDE integration potential, and a focus on the primary languages of software engineering (C/C++/ObjC/ObjC++).
Apple is so committed to these technologies that Xcode, the Apple toolset for building Mac and iOS apps, uses the clang compiler as the default compiler and is showing no signs of looking back. With the release of LLVM 3.0, support and maintenance for the LLVM-GCC front-end has ceased. The clang front-end is rapidly maturing and evolving to cover broad areas of modern language support, such as being the first to support a majority of the C++11 specification.
For reasons of modularity, license flexibility and “business friendliness” and ease of customization, LLVM technology has been utilized here at Arxan Technologies for development of our mobile application protection technology solution called EnsureIT. Our early versions utilized GCC based front end compilers using LLVM, and now we are moving to Clang-LLVM based compilers. We see the overall value of the combination of Clang and LLVM as a new and extremely powerful technology force in computing systems in general. In adopting our advance software protection solution, our customers are adopting the new compiler paradigm.
While GCC is highly venerable and worthy of great praise, in our opinion, GCC has had its day, and the march of technology in compilers has moved on. Clang-LLVM is now leading the way into the future of commercial computing systems of all types.
Forward, LLVM and Clang!
-Featured guest blogger Joe Abbey, Arxan Technologies
