X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: fdjhngslgsgh AT hotmail DOT com (os_dev) Newsgroups: comp.os.msdos.djgpp,alt.os.development Subject: Port/Recompile GCC (using DJGPP) Date: 21 Apr 2004 01:42:39 -0700 Organization: http://groups.google.com Lines: 51 Message-ID: <3a014972.0404210042.6c42fc@posting.google.com> NNTP-Posting-Host: 131.155.33.123 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1082536959 15434 127.0.0.1 (21 Apr 2004 08:42:39 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Wed, 21 Apr 2004 08:42:39 +0000 (UTC) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hey, I have a question about recompiling GCC, hope somebody can help me with this. I was trying to port GCC to another OS (some hobby OS so I can't use any pre-existing configure options). I already have a LibC + include files which should contain all the functions needed to compile GCC/Binutils (standard i/o, process, etc.). But my problem is that I don't really know where to start. I decided to try to recompile everything under Win/DOS using DJGPP since I use this platform to compile most of my programs. I first tried to recompile GCC to normal .exe-files by following the steps in DJGPP/GNU/GCC-3.33/README.DJGPP. This works OK, and after a few minutes of compiling and configuring I get new .exe-files. But these are (naturally) MS-DOS executables linked to the DJGPP LibC. What I want is the compiler to link all the new output files it produces to my own LibC and output a COFF or ELF executable, not a MS-DOS GO32-EXE. I tried the following already, which works perfectly for Binutils: Replace DJGPP/LIB/LIBC.A by MyLibc.A Replace DJGPP/INCLUDE/*.h files by MyIncludeFiles/*.h Edit DJGPP/LIB/GCC-LIB/DJGPP/3.33/DJGPP-X.DJL: OUTPUT_FORMAT("coff") ENTRY(_START) <- Entry point for MyLibc SECTIONS { .... section info ... } All files that are compiled now by `gcc' are COFF executables statically linked to MyLibc.A, so these files can be run on the other OS. When I run configure with these changes a config.h-file is created with the right settings for the other OS, and when I run make, the binutils compile correctly into COFF executables which can be run on the other OS. But this doesn't work for compiling GCC: during the make process of GCC some MS-DOS .exe files are created (gen*.exe, such as genemit.exe) which are needed during the make process (?). So if I use the same trick to compile GCC as I did with the binutils, these files are also compiled to COFF executables and thus cannot be run during the make process and 'make' will therefore fail. If there some other way I can solve this? Makeing a cross compiler seems to be no problem, but recompiling the GCC executables to another target is. Thanks for reading all this :)