Re: Compile LKM with -D__KERNEL__ in UML query

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

 



Thanks Daniel for sharing your Makefile with me. It works
like a charm!

Thanks Seth too. Your tip leads me to more information to
learn :)

Eugene

<quote sender="Daniele Bellucci">
> > But when I compile with:
> > urop-vm:~# gcc -c -O2 lkm.c -DMODULE -D__KERNEL__ -DLINUX
> >
> > it gives me a handful of error messages:
> >
> > In file included from /usr/include/linux/prefetch.h:13,
> >                  from /usr/include/linux/list.h:6,
> > 		 from /usr/include/linux/module.h:12,
> > 		 from lkm.c:2:
> > /usr/include/asm/processor.h:56: error: `CONFIG_X86_L1_CACHE_SHIFT'
> 
> 
> 
> 
> 
> I've got the same problem when try to compile a kernel module inside a UML.
> Try this Makefile:
> 
> CC=gcc
> KERNELDIR=/usr/src/linux-`uname -r`
> ARCHDIR=$(KERNELDIR)/arch/um
> TTDIR=$(ARCHDIR)/kernel/tt
> SKASDIR=$(ARCHDIR)/kernel/skas
> CFLAGS= -DDEBUG -D__KERNEL__ -DMODULE -I$(KERNELDIR)/include -I$(ARCHDIR)/include  -I$(TTDIR)/include -I$(SKASDIR)/include -Wall \
>         -Wunused -Wuninitialized -g -O
> ALL = main.o
> 
> all: $(ALL)
> 
> 
> 
> -------------------------------------------------------------------------------------------------------------------------------------------------------------
> PGP PKEY      http://pgp.mit.edu:11371/pks/lookup?search=belch76@libero.it&op=index
> ICQ#               104896040  
> Netphone/Fax  178.605.7063
> Homepage       http://web.tiscali.it/bellucda
> -------------------------------------------------------------------------------------------------------------------------------------------------------------
> 
> Daniele Bellucci
> 
> 
> 
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
> 

-- 
eMail: eugeneteo@removethisplease.null.cc.uic.edu
gpg pub_key: http://tacheon.cc.uic.edu/~eugeneteo/eugeneteo.asc
main(i){putchar(182623909>>(i-1)*5&31|!!(i<7)<<6)&&main(++i);}

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux