This is the mail archive of the 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]

Bootstrapping a new OS in GCC.

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/
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.

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).

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 ... (; 

This time, trying to build a cross-compiler for ELF format I get this error:

Testing libgcc1.  Ignore linker warning messages.
/home/yanick/devel/src/gnu/non-native/gcc-obj/gcc/xgcc -B/home/yanick/devel/src/gnu/non-native/gcc-obj/gcc/ -B/home/yanick/devel/src/gnu/non-native/yanos-compilers/i386-unknown-yanos/bin/ -I/home/yanick/devel/src/gnu/non-native/yanos-compilers/i386-unknown-yanos/include -DCROSS_COMPILE -DIN_GCC     -g -O2 -I./include
libgcc1-test.o -o libgcc1-test \
  -nostartfiles -nostdlib `/home/yanick/devel/src/gnu/non-native/gcc-obj/gcc/xgcc -B/home/yanick/devel/src/gnu/non-native/gcc-obj/gcc/ -B/home/yanick/devel/src/gnu/non-native/yanos-compilers/i386-unknown-yanos/bin/ -I/home/yanick/devel/src/gnu/non-native/yanos-compilers/i386-unknown-yanos/include --print-libgcc-file-name`
/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
collect2: ld returned 1 exit status
gmake[1]: *** [libgcc1-test] Error 1
gmake[1]: Leaving directory `/home/yanick/devel/src/gnu/non-native/gcc-obj/gcc'
gmake: *** [all-gcc] Error 2

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
binutils is setup for the elf format.

Anyway, any help on that would be greatly apreciated. 


	- Yannick

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