Tom Hawkins wrote:
Hi, I'm attempting to build a GCC cross compiler to target embedded powerpc targets with no OS. I have a couple questions. Sorry if these have been answered before.
Build --target=powerpc-eabi.
First, why does GCC needed to be built twice -- once before, and once after building the standard library -- even if GCC is already installed on the host platform?
This is to insure that target system characteristics specified in the library's header files are used to build the final gcc.
And second, is it possible to build a GCC cross compiler without a standard library? My applications are very low level. Basically my C code just reads and writes hardware registers; it has no use for anything in stdlib.h, stdio.h, math.h, etc. I'm having a hard time finding the magic combinations of binutils, gcc, and newlib that can build without errors. I may have better luck if I can remove newlib and the second GCC build from the equation.
You'll probably find it easier to use an established build model rather than try to create your own. Build binutils, gcc, and newlib for --target=powerpc-eabi. If you never use any of the functionality in the library, then there's really no cost. You will need to create *crt* files which set up the C runtime environment for your target if one of the variants in GCC or Newlib/libgloss is not suitable. -- Michael Eager eager@xxxxxxxxxxxx 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077