IT Pro is supported by its audience. When you purchase through links on our site, we may earn an affiliate commission. Learn more

GCC and LLVM - What's in a licence?

Richard Hillesley discusses the pros and cons of the GCC and LLVM compiler collections, and the difference a licence makes.

GCC is constructed from 'front ends', which consists of the language specific compilation code, a 'middle end' or code optimistation phase, and 'back ends' which streamline the compiled code for specific architectures. As this suggests, the code should and could be modular, but GCC, untypically for free software, tends to be monolithic.

It is difficult to decouple the 'front ends' and 'back ends' from the rest of the code, which means that the path of least resistance for those who wish to extend GCC by adding language or machine specific extensions is to release their changes under the GPL, which in turn makes the languages and architectures more accessible to other free software. The portability of GCC has enhanced the scalability and portability of the Linux kernel, and the relative opacity of GCC has made it incorruptible and difficult to divert for proprietary ends.

Joe Buck notes that Richard Stallman, otherwise known as RMS, "believes that people who extend GCC, hoping to take their extensions proprietary, and then finding that they can't, will then just decide to contribute the code, if it is useful, since otherwise they can't distribute and have to support it by themselves forever, or else they have to risk legal problems. RMS has some evidence that this sometimes happens (C++, Objective-C, many contributed back ends). So the intent isn't to prevent certain people from using it, but to have those people contribute the changes back even if that isn't their preference."

In other words GCC is constructed in such a way that those who wish to provide extensions with licences that are incompatible with the GPL and copyleft are persuaded to contribute the software back to the community in the shape of the GPL - and this has been beneficial to the community - in that it has opened up architectures and languages that might not otherwise have been available to other users of GCC.

It may be the case that this policy was a by-product of the early development of GCC and its beginnings as a C compiler, rather than a deliberate design decision, but "RMS would tell you that we only have a GNU C++ compiler because Mike Tiemann's employer could not make it proprietary, and we only have a GNU Objective-C compiler because Steve Jobs could not make it proprietary. Had the equivalent of dump formats existed at the time, we'd only have C. (Of course, that's the inverse issue: proprietary front ends connecting to GNU back ends). By making just building onto GCC and GPLing the code the path of least resistance, RMS hopes to motivate more people to produce free software" - and this approach has worked.

Buck's view is "that's fine as far as it goes, but when it becomes a defense of an opaque, non-extendable architecture we have a problem."

Featured Resources

Accelerating AI modernisation with data infrastructure

Generate business value from your AI initiatives

Free Download

Recommendations for managing AI risks

Integrate your external AI tool findings into your broader security programs

Free Download

Modernise your legacy databases in the cloud

An introduction to cloud databases

Free Download

Powering through to innovation

IT agility drive digital transformation

Free Download

Most Popular

Former Uber security chief to face fraud charges over hack coverup
data breaches

Former Uber security chief to face fraud charges over hack coverup

29 Jun 2022
Macmillan Publishers hit by apparent cyber attack as systems are forced offline
Security

Macmillan Publishers hit by apparent cyber attack as systems are forced offline

30 Jun 2022
FCC commissioner urges Apple and Google to remove TikTok from app stores
data protection

FCC commissioner urges Apple and Google to remove TikTok from app stores

29 Jun 2022