Thread: OpenBSD Compilers in OpenBSD
View Single Post
  #8   (View Single Post)  
Old 1st August 2013
thirdm thirdm is offline
Spam Deminer
 
Join Date: May 2009
Posts: 248
Default

I'm not making myself clear. I'm over the idea that moving to clang is difficult because of bootstrapping or dependencies (although I now have something at home that fails to find std::cout when it links a simple C++ hello world -- never mind, I'll do the research myself). Over the course of my post I transition to wondering how compilers get bootstrapped to realizing they must be generated by other compilers, not necessarily running on the same platform, to wondering about what the ultimate root of all these compilers is.

Assembler code is kind of a red herring here. When thinking of an ultimate root I should have either said hand entered machine code or else said manually written assembly code and (arbitrarily?) decided to leave out the assembler in the compiler family tree.

So the ultimate root, the point up the tree where a human directly created the machine code rather than that code (via C, assembler or other intermediate format) being output by another program -- I leave text editor out as a generating program here -- is it Ken Thompson's B compiler, something further back, or something later? Wouldn't it be interesting (for the person looking at the chart, not the person creating it) to have a graph mapping compiler versions and platforms all the way back through each compiler build. For instance, when BSD first started using gcc, they compiled it with pcc? When Bell switched from Ken Thompson's compiler to pcc, they compiled the latter with the former and yacc, which was also compiled with the former? Or are there some other oddities in the tree, e.g. a VAX VMS system compiler in the ancestry?

It's interesting to think (if it's true) that all our C and C++ compilers were ultimately generated, across many levels of indirection as each succeeding compiler was built, by Ken Thompson. Kind of like finding out your family descends from the Mayflower, if you were an American that is. Or maybe a more universally relatable analogy would be to Carl Sagan pointing out our bodies' molecules are from supernovae.

This is the paper I referred to: http://cm.bell-labs.com/who/ken/trust.html From this you wonder if the valiant OpenBSD devs handling compiler issues ever have to find bugs in the compiler that generated the compiler they're seeing problems with. You could imagine the new compiler being bug free (okay, not bug free but not suffering from the bug at issue) at source level but having a bug in its binary caused by the old compiler. I can't even imagine how hard that would be to figure out.
Reply With Quote