This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Help on building an cross toolchain
- From: Brian Dessent <brian at dessent dot net>
- To: Manuel Carlos <coyote21 dot manuel at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sat, 06 Oct 2007 08:48:37 -0700
- Subject: Re: Help on building an cross toolchain
- References: <e3dfd62f0710060532k3488dfd5gca4206fa858b0633@mail.gmail.com>
- Reply-to: gcc-help at gcc dot gnu dot org
Manuel Carlos wrote:
> I wanted to know if there is some way to produce an and an cross
> toolchain, based on gcc, but without being coupled to an operating
> system like linux. Since all the howto's that I've found, said that in
> order to build an cross toolchain I have to compile an linux kernel
> for the target... But, I want my executables to not being dependable
> of an linux version... Since, I plan to compile my own simple os with
> it.
There are a number of "bare metal" targets that you can configure gcc
for. They are typically called just *-elf, e.g. mips-elf, sh-elf,
sparc-elf, m32r-elf, arm-elf, i386-elf, etc. But these usually
represent embedded boards that have no operating system, so without
either a libc or some other kind of support library a cross compiler of
this kind isn't going to be able to do much of anything. Even just a
printf("hello world") requires a large chunk of libc stdio code, plus
the syscall glue to translate writing to a fd to the actual underlying
kernel call. So this idea of "a compiler divorced from the target
system" doesn't make a lot of sense. Keep in mind that gcc is just a
compiler, not a libc, so without putting it in the context of some
defined target system (even if that just means using newlib and libgloss
stubs at first) you aren't going to get very far.
Brian