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

Quote:
Originally Posted by rocket357 View Post
Building gcc is a nightmare...at least if it is done right. You have to build gcc-newver with gcc-oldver, then build gcc-newver with gcc-newver. Not the most efficient use of time, as you can imagine.
Yeah, I guess I was missing the obvious fact that an existing gcc binary (or other C++ compiler) is also a prerequisite for building gcc itself. And there, what, there must be a window of versions you'd have to use to get whatever ISO C++98 features they use now (bound to expand over time -- perhaps eventually to C++11). Now that my clang build's finished I'm thinking it wasn't so bad at all. The dependencies were very minimal -- less than gcc's I think, looking here: http://gcc.gnu.org/install/prerequisites.html (except gcc's dependencies are clang's dependencies transitively, in a way).

So if you're starting from the beginning on a new platform that's not supported yet how do you bootstrap the compiler? You have to cross compile, I guess. It would be interesting if someone somehow kept track of what compilers are the parents of what binaries all the way back. Do our present compilers have as their ultimate parent the original pcc in the 70s or Ken Thompson's original compiler written in assembly? Or is there a more recent C compiler written in assembler (which is written in...?) that's the root of what we have now? Or could it be multirooted if pcc's yacc was based on one thing and the compiler processing yacc's output something else. I guess more likely it would be all rooted at Ken Thompson, maybe his B compiler. Maybe he's having a laugh on us all and played the trick he wrote about in that paper.
Reply With Quote