Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to build gcc without a c compiler already on the machine? If so, how?

share|improve this question
You can always get a binary... If you're getting into such considerations, you usually are pretty screwed. – Antoine Benkemoun Jan 6 '10 at 17:56
up vote 15 down vote accepted

What you're talking about is known as bootstrapping a compiler.

Typically this is done by cross-compiling the compiler on another machine for the target architecture. You can find some background here and here. It's not a trivial process, though. If your target isn't architecture that GCC already supports then you've got a lot of work ahead of you.

share|improve this answer
I remember reading some old gcc installation instructions that were about building a minimal compiler with as and using it to build the real gcc. – grawity Jan 7 '10 at 13:30
I've always thought that bootstrapping a compiler on a new architecture would be fun. Of course, designing a processor ISA and implementing it in discrete logic or FPGAs sounds like a lot of fun, too... smile Oh, if I only had free time... – Evan Anderson Jan 7 '10 at 17:29

Wow - I'm only 99.9% sure but no, no I really don't believe you can.

That said it might be worth asking on SO.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.