This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bootstrapping a new OS in GCC.


Yannick Cote wrote:
> 
> Hello there,
> 
> I'm interested in using the gcc compiler and the gnu binutils to build and 
> develop a real-time operating system. Right now, since the system is more than
> primitive, I'm just wondering what entries to put in gcc-2.95.3/gcc/configure.in
> to produce a compiler that will generate x86 assembly code that can be 
> translated in ELF object by binutils. No special options, only the bare minimum
> that I can translate with a elf_exec() routine to make it run on the CPU.

Why not start with a port that is already there?

amylaar@meolyon:~/fsf/gcc/gcc/config/i386 > grep naked *.{c,h,md}
i386-aout.h:/* Definitions for "naked" Intel 386 using a.out (or coff encap'd
i386-coff.h:/* Definitions for "naked" Intel 386 using coff object format files

> I got through the bootstrapping once and began to develop the OS. In fact, 
> I was interested a little bit more in a.out format for now so then I 
> reconfigured gcc and binutils to generate a.out binaries. Surprise was that 
> the little bit of OS code I had would never run again :-) Even translating 
> little stuff like (.align 8 -> .align .3).

balign / p2align are useful to make explicit what you want your alignment
directive to mean.

> When i got the cross-compiler working on an OpenBSD host the first time, I 
> based my ELF configuration work on what "*-*-gnu*)" had. Clearly, this time 
> I would like to make it cleaner. I was wondering if there's documentation 
> on how it should be done. A documentation that explain what are the various 
> configuration files for a target, like tm_file, tmake_file, etc. I guess that
> this process is probably something done by people who dont need that kind of
> documentation usually ... (; 

Well, you can look at any existing target to see what makes it tick
(preferably a simple, but not too old one), and then look up what goes
in the files in the GCC manual.
Collection (GCC)') ?

> /home/yanick/devel/src/gnu/non-native/gcc-obj/gcc/libgcc.a: could not read symbols: Archive has no index; run ranlib to add one
...
> I though providing an empty libgcc1.a file in the gcc tree would have solve that
> problem like said in the GCC manual, but i doesnt seem to. :-) And of course

Where does it say that?  I don't see any mention of libgcc1.a in the entire
doc directory.
Note that the error message is about libgcc.a .
Does the binutils testsuite pass?

-- 
Joern Rennecke                  |            gcc expert for hire
amylaar@onetel.net.uk           |  send enquiries to: jwr_jobs@onetel.net.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]