Subject: MIPS kernel!

From: Nicu Popovici <[email-masked]>
Date: Wed, 08 Nov 2000 10:46:07 -0500

Hello ,

I tried to cross compile the kernel from ftp.embedix.com, meaning that
I found that this embedix Linux is made to work on any platform . I have
an Atlas board and a QED processsor (  a mips one ) and I fail in trying
to cross compile the linux-2.2.13. I get the following errors.

/home/nicu/Kituri/Lineo/linux-2.2.13/scripts/mkdep amigaffs.c bitmap.c
di
/home/nicu/Kituri/Lineo/linux-2.2.13/include/asm/atomic.h:47: invalid
operands to binary +
/home/nicu/Kituri/Lineo/linux-2.2.13/include/asm/atomic.h: In function
`atomic_sub':
/home/nicu/Kituri/Lineo/linux-2.2.13/include/asm/atomic.h:57: invalid
operands to binary -
/home/nicu/Kituri/Lineo/linux-2.2.13/include/asm/atomic.h: In function
`atomic_add_return':
/home/nicu/Kituri/Lineo/linux-2.2.13/include/asm/atomic.h:67:
incompatible types in assignment
/home/nicu/Kituri/Lineo/linux-2.2.13/include/asm/atomic.h:69:
incompatible types in assignment
/home/nicu/Kituri/Lineo/linux-2.2.13/include/asm/atomic.h: In function
`atomic_sub_return':
/home/nicu/Kituri/Lineo/linux-2.2.13/include/asm/atomic.h:81:
incompatible types in assignment
/home/nicu/Kituri/Lineo/linux-2.2.13/include/asm/atomic.h:83:
incompatible types in assignment
/home/nicu/Kituri/Lineo/linux-2.2.13/include/asm/timex.h: In function
`get_cycles':
In file included from
/home/nicu/Kituri/Lineo/linux-2.2.13/include/linux/timex.h:138,
                 from
/home/nicu/Kituri/Lineo/linux-2.2.13/include/linux/sched.h:14,
                 from
/home/nicu/Kituri/Lineo/linux-2.2.13/include/linux/mm.h:4,
                 from
/home/nicu/Kituri/Lineo/linux-2.2.13/include/linux/slab.h:14,
                 from
/home/nicu/Kituri/Lineo/linux-2.2.13/include/linux/malloc.h:4,
                 from
/home/nicu/Kituri/Lineo/linux-2.2.13/include/linux/proc_fs.h:5,
                 from init/main.c:15:
/home/nicu/Kituri/Lineo/linux-2.2.13/include/asm/timex.h:36: warning:
implicit declaration of function `read_32bit_cp0_register'
/home/nicu/Kituri/Lineo/linux-2.2.13/include/asm/timex.h:36: `CP0_COUNT'

undeclared (first use this function)
/home/nicu/Kituri/Lineo/linux-2.2.13/include/asm/timex.h:36: (Each
undeclared identifier is reported only once
/home/nicu/Kituri/Lineo/linux-2.2.13/include/asm/timex.h:36: for each
function it appears in.)
make: *** [init/main.o] Error 1

Another weird thing . When I received my Atlas board I gqt a CD with the
kernel sources and binaries. I installed the binaries on the Atlas board
and it works fine but when I tried to cross compile the kernel I get
some stupid errors like the one above. I realy do not understand
anything , does anyone cross compiled a kernele for MIPS processors and
Atlas boards ? The version is linux 2.2.12.( the Hard Hat Linux ).

Thak you for all your help.

Regards,
Nicu

---

From: "Kevin D. Kissell" <[email-masked]>
Date: Wed, 8 Nov 2000 10:53:14 +0100

> to cross compile the linux-2.2.13. I get the following errors.
...
[errors snipped] 
...
> Atlas boards ? The version is linux 2.2.12.( the Hard Hat Linux ).

In general, at MIPS, we generally build native or semi-native
(mipsel on mipseb machines and vice versa).  In cross-builds
of other components, however, I have observed that problems
such as those you describe can result from include files
on the host platform being erroneously pulled in to the cross-build.
Cross-gcc and the makefiles have been known to be set up such
that, if the needed include file can be found neither in the explicitly
requested directories nor in the cross-compiler's default includes, 
it will silently search the host /usr/include directories.

One quick-and-dirty way to test this would be to temporarily rename
/usr/include on your host platform to /usr/include.native or whatever,
and then make your  /usr/include a symbolic link to the include 
directory of your MIPS Linux tree.  This should either let you build
correctly or give you a more useful error message telling you which
include file is missing from your cross-environment or MIPS kernel 
distribution. Just don't forget to put things back the way they were! 

            Regards,

            Kevin K.

---

From: Ralf Baechle <[email-masked]>
Date: Wed, 8 Nov 2000 15:10:48 +0100

> it will silently search the host /usr/include directories.

This is either a bug in the version that you're using, a wrongly installed
compiled or simply wrong -I directives passed to the compiler.  The
crosscompiler rpms as distributed on oss will only search:

 /usr/lib/gcc-lib/mips-linux/egcs-2.91.66/include
 /usr/mips-linux/include

by default.  I just tried, egcs-1.1.2-2 also doesn't search silently in
other directories.  So it's not a problem of gcc itself which leaves the
makefiles.  If you find any instance of the wrong directories being
searched, please tell me.  Or better, include a patch :-)

  Ralf

---

From: "Kevin D. Kissell" <[email-masked]>
Date: Wed, 08 Nov 2000 12:07:04 -0800

Ralf Baechle wrote:
> compiled or simply wrong -I directives passed to the compiler.  

Obviously.  And my thought was that Nicu may well be being
bit by one or the other.

> The crosscompiler rpms as distributed on oss will only search:
> 

I saw an instance of this on the order of a year ago.  I don't
remember which compiler I was using, nor where I got it.  I have
no ability nor really much desire to try to reconstruct the
environment to reproduce the problem!

			Kevin K.

---

From: Ralf Baechle <[email-masked]>
Date: Wed, 8 Nov 2000 21:11:55 +0100

> environment to reproduce the problem!

It think you can missconfigure a compiler to do something like that on a
i386-linux host by ``configure mips-linux'' or so.  That will or course
also hose your native compiler.

  Ralf

---

From: Nicu Popovici <[email-masked]>
Date: Thu, 09 Nov 2000 09:57:23 -0500

Ralf Baechle wrote:

> On Wed, Nov 08, 2000 at 05:41:16PM -0500, Nicu Popovici wrote:
>
> > I managed to pass that stage with crosscompiler.
> > I managed to make the following thing
> > make CROSS_COMPILE=mips-linux-
> >
> > and I get the follwing error.
>
> What kernel are you trying to build and where did you download it from?
>
>   Ralf

I try to compile the linux 2.2.13 and   I got that one from ftp.lineo.com.
I also tried to cross compile the linux_2_2 from CVS repository from
oss.sgi.com and I managed but that one does not have support for my
ATLAS borad and I can not run it on my machine.

Regards,
Nicu

---

From: Klaus Naumann <[email-masked]>
Date: Thu, 9 Nov 2000 09:24:09 +0100 (CET)

> ATLAS borad and I can not run it on my machine.

Did you also try 2.4 from oss.sgi.com ? If not you should try it,
because IIRC 2.2 doesn't have ATLAS support but 2.4 has.
I think I remember seeing a CVS commit which included ATLAS support
into 2.4 ... correct me if I'm wrong.

		HTH, Klaus

-- 
Full Name   : Klaus Naumann     | (http://www.mgnet.de/) (Germany)
Nickname    : Spock             | Org.: Mad Guys Network
Phone / FAX : ++49/177/7862964  | E-Mail: ([email-masked])
PGP Key     : www.mgnet.de/keys/key_spock.txt

---

From: Carsten Langgaard <[email-masked]>
Date: Thu, 09 Nov 2000 09:29:30 +0100

> into 2.4 ... correct me if I'm wrong.

The current version in the CVS repository doesn't work yet,.
I have sent Ralf a set of patches that should make it work, but I don't think
he has committed it yet.

--
_    _ ____  ___   Carsten Langgaard   Mailto:[email-masked]
|\  /|||___)(___   MIPS Denmark        Direct: +45 4486 5527
| \/ |||    ____)  Lautrupvang 4B      Switch: +45 4486 5555
  TECHNOLOGIES     2750 Ballerup       Fax...: +45 4486 5556
                   Denmark             http://www.mips.com