[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compiling kernel modules
On 2001.05.04 12:50:43 Johan Adolfsson wrote:
> I don't think you should have the -muclibc= option when compiling kernel
> it's for compiling applications using uC-libc.
I've tried without -muclibc= and it gives exactly the same errors
More interesting is that if I remove the "-O2" switch, I get
about 50 lines of "Error: Bad expression" and "Error: Illegal operands"
instead of 6 with "-O2" or with "-O1".
What is even more interesting is that if I make an assembler output,
with the "-S" switch and otherwise the same switches, gcc-cris doesn't
say anything(except that tmp2 in asm/uaccess.h isn't used) and then if
I do "gcc-cris smem.s -c" it gives me an "smem.o" without saying
If I take the same way around making assembler and compile it for
my PC with my normal gcc, it generates an ok module.
I have gcc-cris version 2.96, and I think it was from cris-1.11.
(How can I check that?)
Now I'm off testing kernel modules with the Etrax.
> ----- Original Message -----
> From: Jonas Aaberg <email@example.com>
> To: <firstname.lastname@example.org>
> Sent: Friday, May 04, 2001 10:40
> Subject: 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: email@example.com
> > 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