Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #2491
| From | Christian Gollwitzer <auriocus@gmx.de> |
|---|---|
| Newsgroups | comp.compilers |
| Subject | Re: Compiler bootstrapping and the standard header files |
| Date | 2020-03-20 10:21 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <20-03-020@comp.compilers> (permalink) |
| References | <20-03-018@comp.compilers> |
Hi codevisio, Am 19.03.20 um 13:40 schrieb codevisio@gmail.com: > I've been going through come compiler sources available online and study > them, in particular C compilers. > > Since all of them implement the C standards headers, my assumption was that > during the development of the compiler I cannot use the the standard headers > coming from the host environment & C compiler, but instead I have to use my > own standard headers I created for my compiler. No, such a rule does not exist and it would not make sense, either. The easiest way to see this is by considering a cross-compiler. Assume that your new compiler runs on host A (e.g. x86 PC) and compiles a program for host B (e.g. ARM Raspberry Pi). Then for running the compiler on the PC, you need the headers for the Raspi on the PC. But the resulting binary does not run there. The compiler itself must have been compiled by a compiler on the PC - because if you compile it with itself, it would not run on th PC. Therefore, to compile the compiler, you need the host compiler of the PC and the headers and libraries from there. Actually, a "cross compiler" is the regular case, and a "non-cross compiler" is a special case, albeit many developers only use one machine for compilation and testing, and therefore use a "non-cross compiler" where the target is the same as the host.
Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar
Compiler bootstrapping and the standard header files codevisio@gmail.com - 2020-03-19 05:40 -0700
Re: Compiler bootstrapping and the standard header files Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2020-03-20 01:34 +0100
Re: Compiler bootstrapping and the standard header files Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2020-03-20 06:21 -0400
Re: Compiler bootstrapping and the standard header files cvo <codevisio@gmail.com> - 2020-03-20 15:52 -0700
Re: Compiler bootstrapping and the standard header files Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2020-03-22 04:22 +0100
Re: Compiler bootstrapping and the standard header files Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2020-03-22 13:51 -0400
Re: Compiler bootstrapping and the standard header files Kaz Kylheku <493-878-3164@kylheku.com> - 2020-03-23 13:49 +0000
Re: Compiler bootstrapping and the standard header files Christian Gollwitzer <auriocus@gmx.de> - 2020-03-20 10:21 +0100
Re: Compiler bootstrapping and the standard header files gah4@u.washington.edu - 2020-03-21 15:32 -0700
csiph-web