[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiling kernel modules




Hi!

I've manage to compile insmod and I would like to try if it works.
(I had to do some guesses to make it compile, so I don't know if
it works or not.)

When I try to compile a kernel module that works on my PC
with linux 2.4.3, it won't compile. (I've got an Etrax 100LX)

If I compile like this:
gcc  -O2 -Wall -DMODULE -D__KERNEL__ -DNORMAL -DLINUX smem.c -c
For my PC, it says nothing and it works, but if I do

gcc_cris -c -O2 -Wall -I/opt/Etrax/linux/include 
-muclibc=/opt/Etrax/devboard_lx/eroot -DMODULE -D__KERNEL__ -mlinux
-DCRISMMU smem.c 

I get this:

In file included from smem.c:5:
/opt/Etrax/linux/include/asm/uaccess.h: In function `strnlen_user':
/opt/Etrax/linux/include/asm/uaccess.h:1019: warning: unused variable
`tmp2'
/tmp/ccAK5n2G.s: Assembler messages:
/tmp/ccAK5n2G.s:90: Error: Bad expression
/tmp/ccAK5n2G.s:90: Error: Illegal operands
/tmp/ccAK5n2G.s:91: Error: Illegal operands
/tmp/ccAK5n2G.s:92: Error: Bad expression
/tmp/ccAK5n2G.s:92: Error: Illegal operands
/tmp/ccAK5n2G.s:93: Error: Illegal operands
make: *** [etrax] Error 1

To me, it looks like it runs the wrong "as". I've tried to set
an enviroment var AS=as-cris, but it doesn't help.

Anyone has an idea of what is wrong?

Regards,
 Jonas

-- 
Jonas Aaberg               Email: aberg@xxxxxxx.ch
Supercomputing Systems AG  Web:   http://www.scs.ch
Technoparkstrasse 1        Phone: +41 (0) 1 445 16 00
CH-8005 Zuerich            Fax:   +41 (0) 1 445 16 10