Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #2496
| From | gah4@u.washington.edu |
|---|---|
| Newsgroups | comp.compilers |
| Subject | Re: Compiler bootstrapping and the standard header files |
| Date | 2020-03-21 15:32 -0700 |
| Organization | Compilers Central |
| Message-ID | <20-03-025@comp.compilers> (permalink) |
| References | <20-03-018@comp.compilers> |
On Thursday, March 19, 2020 at 2:45:16 PM UTC-7, cvo wrote: > I've been going through come compiler sources available online and study > them, in particular C compilers. One reason for the inability to use such is copyright. But for now, I will assume that isn't the question. > 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. As well as I remember the early days of gcc, though I wasn't so interested in it at the time, it was a replacement for an existing compiler, such as the one for SunOS. For some years, Sun had only one C compiler, distributed with SunOS, but at some point they licensed it separately. The compiler that came with SunOS was only meant to be enough to compile the kernel modules needed for sysgen. (But I believe gcc started before this.) In any case, at that time they used the existing SunOS (and maybe others, but I was mostly using Sun at the time) library. Much of the C header files have data structures (C struct) that match with library routines. I believe that gcc was trying to build a better optimizing compiler, and to get people to use it over the SunOS compiler. (Personal opinion, so anyone can disagree if they want to.) It was only sometime later that GNU wrote their own glibc as a replacement for the C library. Some data structures match system calls, and so are system dependent, where others are only need to be library internally consistent. As for cross compilers, much of the data structures are consistent across different architectures for the same system version, such as 68020 SunOS and Sparc SunOS, such that the header files would be the same, or almost the same. (As well as I remember, Sun keeps the system dependent ones separate, with a symbolic link to the actual version.) Writing the compiler first, using the existing library, conveniently allows one to get something working earlier.
Back to comp.compilers | Previous | Next — Previous 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