More on OpenBSD’s new compiler

A few weeks ago, the OpenBSD Project announced that the Portable C Compiler (PCC) had been added to the OpenBSD source tree. There has already been some explanation of why the traditional GNU Compiler Collection (GCC) is troublesome and why a new compiler is needed, but there are still some details left uncovered. In this interview, Theo de Raadt and Otto Moerbeek of the OpenBSD Project offer more information about PCC and GCC and where they are headed within the project.

Do you plan on refactoring or rewriting the code to be more in line with OpenBSD’s standards, as OpenBSD programmers have done with other older (and sometimes GPL-governed) programs like CVS and NTPD? In other words, will this be OpenPCC?

Theo de Raadt: There will be attempts to ensure that the code remains simple and short, as a priority.

Otto Moerbeek: There are no plans to fork, even though we have pcc imported into the OpenBSD tree. There are and will be some minor differences as compared to the main pcc repository. For example, our build method can be more simple, since the compiler will always run on OpenBSD. There might also be (experimental) OpenBSD-specific features in the future. But I like to reach the point where we can build the complete tree of OpenBSD using pcc first.

How far is PCC from being a GCC replacement in OpenBSD?

TdR: A lot ways. It can compile a large part of our i386 tree, though. But it is missing PIC, other architectures, and various gcc extensions that are rather critical.

OM: I’ve nothing to add to that — the road is still long.

What other hurdles remain in replacing GPL-licensed programs in OpenBSD?

TdR: But that’s never really been the agenda, see. Some people think we hate GNU code. But the thing is we hate large code, and buggy code that upstream does not maintain. That’s the real problem… gcc gets about 5-6% slower every release, has new bugs, generates crappy code, and drives us nuts. This is just an attempt to see if something better can show up.

We’re just fighting against an open source monopoly…

OM: Like in any environment, monopolies are bad. They create dependency. Dependency means you cannot decide completely by yourself on the route to take, because choices are lacking. Removing all dependencies may be a utopia, but it does not hurt to strive to be self-supporting.

Apart from that, compiler hacking is fun. I see programming largely as a craft (of course backed by things like the theory of algorithms and data structures). Working on a compiler, one of the most important tools for a developer, touches all aspects of that craft.

Discuss this article now on our forum.

Copyright 2007 JEM Electronic Media, Inc. No reprints without written permission.

About the Author:

Leave A Reply

Your email address will not be published. Required fields are marked *