How to compile GCC if you don't have GCC?
I was wondering the other day. How do you compile GCC if you don't have GCC and GCC is a dependency? And how did the first version of GCC get compiled? And how do future versions of GCC get compiled, by older versions? And then after they finish compiling the new version of GCC with the old version of GCC, do they then go ahead and recompile the new version of GCC with the newly compiled version of GCC which they just built??? /me brain explodes just thinking about it
khermans |
I've done it ;)
You use a host system with gcc already installed. I suppose you could do it without gcc, with say, the intel compiler. But when I did LFS, I use my host system's gcc to compile my own gcc. --Shade |
There is a very confusing howto at the gcc website.
|
Quote:
khermans |
Can't even get to their site right now - seems to be down.
|
Yeah, I noticed that gcc.gnu.org was down. Can you post a link from Google cache?
Kristian Hermansen |
There site seems to be up again as I was just able to get to it at gcc.gnu.org.
|
I still couldn't find anything in depth on the GCC site. I noticed something about the prerequisites, but they don't say how they build new versions of GCC. Did they use GCC 2.xx to build the GCC 3.xx compiler? And then after they built the GCC 3.xx compiler, did they rebuild the 3.xx compiler again with the new 3.xx binary?!?!?!
Kristian Hermansen |
i have a sorta related question that i'm hoping one of you can help me with...
how do you compile something on slackware 9.1 using gcc 2.95.x which comes with slackware 8.1, instead of slackware 9.1's gcc 3.2.x??? here's the thread i started for this question last month: http://www.linuxquestions.org/questi...hreadid=174925 any clue you can throw my way would be greatly appreciated... thanks so much... |
actually, the gcc tarball has its own static compiler which is used for compiling once.
afterwards, it uses the now compiled gcc to compile itself again, i think the loop repeates for abt 3 times (and the process is called as bootstraping or something like that) |
Thats how gentoo does it but you can also build it from scratch if you follow the steps on the gcc site but I already get lost with the configuration part.
If you ever loose your compiler with gentoo best thing is to either install rpm's,compile the compiler and get rid of the rpm's after or chroot from a installation cd and install it. |
Thanks for the replies, that clears things up a bit!!! Still, if anyone does locate that GCC link to the bootstrapping process let me know. Also, others who browse this thread may be interested in the link as well ;-)
Kristian Hermansen |
http://gcc.gnu.org/install/build.html
should be it |
"And how do future versions of GCC get compiled, by older versions?"
Yes "And then after they finish compiling the new version of GCC with the old version of GCC, do they then go ahead and recompile the new version of GCC with the newly compiled version of GCC which they just built???" This is possible but unnecessary. "And how did the first version of GCC get compiled?" It was compiled on some other compiler. The first C compiler was probably written in an assembly language. The first assembler was written in octal machine code about 1946. ___________________________________ Be prepared. Create a LifeBoat CD. http://users.rcn.com/srstites/LifeBo...home.page.html Steve Stites |
All times are GMT -5. The time now is 07:35 PM. |