Date: Tue, 4 Feb 92 15:32:17 EST From: DJ Delorie To: ressler AT cs DOT cornell DOT edu Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Bootstrapping djgpp Status: O >The mail group discussion on compiling gpp with itself makes me >wonder how you did it. - - - History of djgpp - - - The first step in building djgpp from a dead stop is to get a unix system based on a 386/PC. In my case, I used 386/ix from ISC. I got the gnu code for gcc and built it, giving me a gnu compiler that ran on 386/ix and produced 386/ix binaries. The next step is to replace all the system calls with special functions by linking in a special .o just before libc.a that replaced such functions as read(), open(), exit(), etc. After building this, I had a version of gcc (et al) that ran under DOS and produced 386/ix code. The special functions were designed to interface with Phar Lap's 386 extender, and I had a special program that read COFF executables and produced .EXE's. Special switches were required for the linker to do this without killing yourself, and a special crt0.o was also required. Now that I had a program that ran on a PC and created executables that ran on a PC, the fun part began. First, I wrote an extender that could deal with coff files, basically to get rid of the Phar Lap extender ($$). I had to do this first because I needed the virtual memory that Phar Lap at the time didn't support. I used this extender to run the compiler in order to compile itself, on a PC, for the first time. Now that I could recompile the compiler, the next stage was to switch back over to the a.out format, which at the time was the native format for all the GNU programs. The extender was modified to accept either coff or a.out format, which I believe it still does, and the compiler was reconfigured to produce a.out format and recompiled with -O. After that, I reported 1.39.1 (the first rev was 1.37). The extender has had enough functionality added to it so that gcc 2.0 porting was a breeze (it's not out yet). So there you have it. DJ dj AT ctron DOT com Life is a banana.