2002-04-03 19:09:44

by Abdij Bhat

[permalink] [raw]
Subject: error compiling kernel for mips

Hi,
When i try compiling the Kernel for mips i get errors. The kernel is 2.4.17
downloaded from http://www.kernel.org. I have the mips developments environment
set. I have (hopefully) the right headers and have modified the makefile to
get the headers from those include directories.
My main problem is changing the architecture from arch686 ( mine ) to mips.
How to i do this? What do i need to do inorder for the make to get the right
architecture? Or is there some other problem too?

Here is the error listing

mipsel-linux-gcc -D__KERNEL__ -I/usr/tools/mipsel-linux/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -march=i686 -c -o init/main.o
init/main.c
cc1: bad value (i686) for -march= switch
Assembler messages:
Fatal error: invalid architecture -march=i686
make: *** [init/main.o] Error 2

Thanks and Regards,
Abdij


2002-04-03 19:25:34

by Justin Carlson

[permalink] [raw]
Subject: Re: error compiling kernel for mips

On Wed, 2002-04-03 at 14:05, Abdij Bhat wrote:
> Hi,
> When i try compiling the Kernel for mips i get errors. The kernel is 2.4.17
> downloaded from http://www.kernel.org. I have the mips developments environment
> set. I have (hopefully) the right headers and have modified the makefile to
> get the headers from those include directories.
> My main problem is changing the architecture from arch686 ( mine ) to mips.
> How to i do this? What do i need to do inorder for the make to get the right
> architecture? Or is there some other problem too?
>

Check out this line in the base level makefile:

ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e
s/arm.*/arm/ -e s/sa110/arm/)

This actually looks broken for cross-compile, but I haven't been
following the changes particularly closely...try using this instead:

ARCH := mips

Really, though if you're compiling for mips you should probably grab the
mips-linux CVS sources here:

cvs -d :pserver:[email protected]:/cvs login
(Only needed the first time you use anonymous CVS, the password is
"cvs")
cvs -d :pserver:[email protected]:/cvs co <repository>

There's a 2.4 tagged branch that's probably closer to what you want. You
can ask for mips-specific on [email protected], and you'll be much
more likely to get a prompt and useful answer.

-Justin


Attachments:
signature.asc (232.00 B)
This is a digitally signed message part

2002-04-03 20:05:25

by M. R. Brown

[permalink] [raw]
Subject: Re: [Linux-mips-kernel]error compiling kernel for mips

* Abdij Bhat <[email protected]> on Thu, Apr 04, 2002:

> Hi,
> When i try compiling the Kernel for mips i get errors. The kernel is 2.4.17
> downloaded from http://www.kernel.org. I have the mips developments environment
> set. I have (hopefully) the right headers and have modified the makefile to
> get the headers from those include directories.
> My main problem is changing the architecture from arch686 ( mine ) to mips.
> How to i do this? What do i need to do inorder for the make to get the right
> architecture? Or is there some other problem too?
>

You need to pass something like:

$ make ARCH=mips CROSS_COMPILE=mipsel-linux- config dep clean vmlinux

So that the kernel build system knows that you are cross-compiling.

M. R.


Attachments:
(No filename) (742.00 B)
(No filename) (189.00 B)
Download all attachments

2002-04-04 17:13:05

by Maciej W. Rozycki

[permalink] [raw]
Subject: Re: error compiling kernel for mips

On 3 Apr 2002, Justin Carlson wrote:

> Check out this line in the base level makefile:
>
> ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e
> s/arm.*/arm/ -e s/sa110/arm/)
>
> This actually looks broken for cross-compile, but I haven't been
> following the changes particularly closely...try using this instead:
>
> ARCH := mips

Or shortly:

$ make "ARCH=<arch>" "CROSS_COMPILE=<prefix>" <whatever>

Here <arch> is "mips" and <prefix> is whatever prefix is is used for your
cross-compiling toolchain (e.g. "mips-linux-" or "mipsel-linux-", etc.).

> Really, though if you're compiling for mips you should probably grab the
> mips-linux CVS sources here:
>
> cvs -d :pserver:[email protected]:/cvs login
> (Only needed the first time you use anonymous CVS, the password is
> "cvs")
> cvs -d :pserver:[email protected]:/cvs co <repository>
>
> There's a 2.4 tagged branch that's probably closer to what you want. You
> can ask for mips-specific on [email protected], and you'll be much
> more likely to get a prompt and useful answer.

Actually 2.4.19 should contain most bits from the current linux_2_4
branch from oss. Just grab the current "-pre" version.

Getting a CVS snapshot from oss is certainly a solution as well, but the
server seems to be broken for the last few days (including its CVS server,
its mailing list server and its web server).

--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: [email protected], PGP key available +