This is the mail archive of the gcc-help@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]
Other format: [Raw text]

RE: Building a cross compiler for x86_64


I'm not sure why I would need to have a different libc.  I'm going to run
the cross compiler and binutils on my Linux box.  I only want to use them to
generate an x86_64 binary kernel that I'll boot on another machine.
Wouldn't the cross compiler just use the fc8 libc to do its work?

May I assume you're talking about providing some libc functionality for the
target?  If that's the case, the kernel is standalone, i.e. its built using
--freestanding.  That way no other libs get linked in except what I specify
exactly.

FM


-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Brian Dessent
Sent: Thursday, February 14, 2008 11:31 PM
To: Frank W. Miller
Cc: gcc-help@gcc.gnu.org
Subject: Re: Building a cross compiler for x86_64

"Frank W. Miller" wrote:

> I probably want to build the binutils too, its not that much extra work
and
> I'll know for sure what I've got if I do that.

That's not optional.  Binutils provides (among other things) the
assembler and linker, without which gcc is just a glorified
C-to-assembler text filter.

> The development machine is an ia32 pc running fc8.  The target will be a
> standalone kernel running in ia32e mode.  It sounds like x86_64-pc-linux
> will probably work for me.
> 
> What I really want is for the resulting cross tools, gcc, gas, ld, etc. to
> be 64-bit only.  Will that be the case with this build or will I still
need
> to use -m64 in my compile steps?

Okay, so you probably do want to build a cross.  But since the target is
not running linux you should not use the x86_64-pc-linux triplet.  You
might try the bare metal target x86_64-elf.  You will have to provide
some amount of libc functionality (such as basic headers, startup
objects, and possibly a linker script) before you will be able to build
the cross compiler, as otherwise it will be unable to build libgcc since
it won't be able to link.  Typically people use newlib and libgloss for
this role, but if you are rolling your own libc then you can take care
of that yourself.

Brian


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