From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25403 invoked by alias); 15 Feb 2008 06:02:00 -0000 Received: (qmail 25380 invoked by uid 22791); 15 Feb 2008 06:01:57 -0000 X-Spam-Check-By: sourceware.org Received: from smtpauth01.csee.onr.siteprotect.com (HELO smtpauth01.csee.onr.siteprotect.com) (64.26.60.145) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 15 Feb 2008 06:01:38 +0000 Received: from cornfed (unknown [67.162.139.200]) (Authenticated sender: fwmiller@cornfed.com) by smtpauth01.csee.onr.siteprotect.com (Postfix) with ESMTP id 2215E1C8031 for ; Thu, 14 Feb 2008 23:13:54 -0600 (CST) From: "Frank W. Miller" To: Subject: RE: Building a cross compiler for x86_64 Date: Fri, 15 Feb 2008 06:02:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <47B4EB88.26AA36C@dessent.net> Message-Id: <20080215051354.2215E1C8031@smtpauth01.csee.onr.siteprotect.com> X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-02/txt/msg00172.txt.bz2 I should have been more specific. I'm migrating an existing 32-bit OS kernel to be 64-bit, ia32e mode, i.e. x86_64. I have my own libs but the result is a kernel that is a standalone executable. 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. 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? Thanks, 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 6:32 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've determined that my gcc build does not support the -w64 compile > option. (I'm running FC8 and its not compiled in by default apparently) I'm assuming you mean -m64 here. > So, I need to build a cross compiler. I have binutils-2.18 and Not necessarily. The gcc i386 backend is bi-arch, meaning that it targets both ia32 and x86_64 from a single backend. So you can simply build a 32 bit gcc that also supports 64 bit. This would not necessarily be a cross compiler, but you of course wouldn't be able to run the resulting binary on the host. To make this work, you first need to install a 64 bit libc however. This means headers, libs, crt*.o, etc. You should be able to do this through your distro. Once you have that you can configure with --enable-targets=all and you should get a 32 bit gcc with -m64. You can still go the cross route but it's more work, you'd need to first create a sysroot containing full 32 and 64 bit libc-devel's, then configure with --target=x86_64-pc-linux --with-sysroot=whatever. Brian