linux-mips
[Top] [All Lists]

Re: Trouble compiling MIPS cross-compiler

To: linux-mips@linux-mips.org
Subject: Re: Trouble compiling MIPS cross-compiler
From: Kumba <kumba@gentoo.org>
Date: Sun, 18 Jan 2004 02:18:43 -0500
In-reply-to: <200401181646.04740@korath>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <200401171711.34964@korath> <200401181510.35686@korath> <400A1B5F.6010307@gentoo.org> <200401181646.04740@korath>
Reply-to: kumba@gentoo.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007
Adam Nielsen wrote:

Thanks for all the info! Well, I tried building gcc-3.3.2 with your options and that worked (hooray!) but I couldn't find binutils-2.14.90.0.7, the closest I could see was 2.14 so I used that. It all compiled ok, but now when I go to compile the kernel I get this error:

cc1: error: invalid option `cpu=r3000'

http://www.kernel.org/pub/linux/devel/binutils/

The 2.14.90.0.X series of binutils is a linux-only release maintained by HJ Lu, while the 2.14 version is more or less the official GNU version.

As for the kernel, -mcpu was deprecated in gcc-3.2.x, and totally removed in gcc-3.3.x. You'll want to use the -march option (or -mips[1234] as a synonym), although if you use a recent kernel source tree off linux-mips anoncvs, selecting the right CPU/Machinetype in menuconfig will supply the proper -march/-mipsX commands to the compiler. You'll also want to pass something like this:

make ARCH=mips CROSS_COMPILE=mips-unknown-linux-gnu- <target>

Note: CROSS_COMPILE needs to be set to the CHOST the cross compiler was built with, in my cases, I use the extended CHOST form. The more common form is mips[el]-linux (or mips64[el]-linux)

For 2.4, if you want a mips64 kernel, pass ARCH=mips64. For 2.6, pass ARCH=mips and select 64-bit mode in menuconfig (or oldconfig or xconfig)


--Kumba

--
"Such is oft the course of deeds that move the wheels of the world: small hands do them because they must, while the eyes of the great are elsewhere." --Elrond


<Prev in Thread] Current Thread [Next in Thread>