Re:How can the Linux kernel compile itself?
by FedRegister on Tuesday September 17, 2013 @12:04PM
(#6400070)
If a new architecture was developed you could bring up the whole stack by cross-{assembling,compiling} from an already supported target. By doing so you could test the output using a simulator (or actual hardware) and then when the assembler/compiler is stable enough you could then cross-assemble/compile the assembler/compiler and then be self-hosting on the new architecture.
Re:How can the Linux kernel compile itself?
by PeterisP on Tuesday September 17, 2013 @06:59PM
(#6402459)
For any practical purposes, it is best to simply use the full complex software stack on another computer to generate binary code meant for that new architecture.
If we'd really need to bootstrap a compiler from scratch, then a possibility would be to hand-code a Forth system, and then find/modify/make an assembler written in forth; then write a compiler for some small language (scheme?) in that assembler, and then from scheme you can easily get to some C compiler that can compile the full GCC.
Re:How can the Linux kernel compile itself?
by seclorum on Wednesday September 18, 2013 @05:05AM
(#6404283)
>Can a very minimal gcc be written which would be capable of bootstrapping the entire gcc compiler?
Yes. In fact, this is how gcc is built - in stages. First stage: build a compiler that can build the compiler. Recompile the compiler with the newly built compiler. Do it again. Repeat until completion. ;)
It seems like it would be relevant if a new architecture was developed at least.