LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to compile GCC if you don't have GCC? (https://www.linuxquestions.org/questions/linux-software-2/how-to-compile-gcc-if-you-dont-have-gcc-179515/)

khermans 05-09-2004 01:45 AM

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

Shade 05-09-2004 01:58 AM

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

crashmeister 05-09-2004 06:59 AM

There is a very confusing howto at the gcc website.

khermans 05-09-2004 08:27 AM

Quote:

Originally posted by crashmeister
There is a very confusing howto at the gcc website.
Do you have a link? I could not find one ;-(

khermans

crashmeister 05-10-2004 07:07 AM

Can't even get to their site right now - seems to be down.

khermans 05-10-2004 01:58 PM

Yeah, I noticed that gcc.gnu.org was down. Can you post a link from Google cache?

Kristian Hermansen

Inexactitude 05-10-2004 04:20 PM

There site seems to be up again as I was just able to get to it at gcc.gnu.org.

khermans 05-10-2004 10:59 PM

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

win32sux 05-12-2004 12:41 AM

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...

vinay_s_s 05-12-2004 01:45 AM

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)

crashmeister 05-12-2004 04:06 AM

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.

khermans 05-12-2004 08:30 AM

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

crashmeister 05-12-2004 05:51 PM

http://gcc.gnu.org/install/build.html
should be it

jailbait 05-12-2004 06:42 PM

"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.