* Can't build external module against 2.6.0-test6 kernel
@ 2003-10-09 11:22 Mark Hounschell
2003-10-09 11:40 ` Muli Ben-Yehuda
2003-10-09 15:23 ` Sam Ravnborg
0 siblings, 2 replies; 6+ messages in thread
From: Mark Hounschell @ 2003-10-09 11:22 UTC (permalink / raw)
To: linux-kernel
I'm trying to build a driver external to the kernel. I'm running 2.6.0-test6
kernel.
It appears to me (I'm probably wrong) that there is a kernel include file issue.
gcc -c rtom.c -D__KERNEL__ -DMODULE -DDEBUG -DDEBUG_LEVEL=6
-I/lib/modules/2.6.0-test6/build/include -I../include/linux/sys
-I../include/linux -I../include -O -o rtom
In file included from /lib/modules/2.6.0-test6/build/include/asm/smp.h:18,
from /lib/modules/2.6.0-test6/build/include/linux/smp.h:17,
from /lib/modules/2.6.0-test6/build/include/linux/sched.h:23,
from /lib/modules/2.6.0-test6/build/include/linux/module.h:10,
from rtom.c:2:
/lib/modules/2.6.0-test6/build/include/asm/mpspec.h:6:25: mach_mpspec.h: No such
file or directory
In file included from /lib/modules/2.6.0-test6/build/include/asm/smp.h:18,
from /lib/modules/2.6.0-test6/build/include/linux/smp.h:17,
from /lib/modules/2.6.0-test6/build/include/linux/sched.h:23,
from /lib/modules/2.6.0-test6/build/include/linux/module.h:10,
from rtom.c:2:
/lib/modules/2.6.0-test6/build/include/asm/mpspec.h:8: error `MAX_MP_BUSSES'
undeclared here
(not in a function)
.
.
harley:/usr/src/linux-2.6.0-test6 # find ./ -name mach_mpspec.h
./include/asm-i386/mach-default/mach_mpspec.h
./include/asm-i386/mach-es7000/mach_mpspec.h
./include/asm-i386/mach-generic/mach_mpspec.h
./include/asm-i386/mach-summit/mach_mpspec.h
./include/asm-i386/mach-numaq/mach_mpspec.h
./include/asm-i386/mach-bigsmp/mach_mpspec.h
In the 'include/asm/mpspec.h' file:
#ifndef __ASM_MPSPEC_H
#define __ASM_MPSPEC_H
#include <linux/cpumask.h>
#include <asm/mpspec_def.h>
#include <mach_mpspec.h> <-----------------------------------------------
extern int mp_bus_id_to_type [MAX_MP_BUSSES];
It seems like something is amiss here. Isn't the include statment incorrect
above?
Thanks
Mark
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Can't build external module against 2.6.0-test6 kernel
2003-10-09 11:22 Can't build external module against 2.6.0-test6 kernel Mark Hounschell
@ 2003-10-09 11:40 ` Muli Ben-Yehuda
2003-10-09 15:23 ` Sam Ravnborg
1 sibling, 0 replies; 6+ messages in thread
From: Muli Ben-Yehuda @ 2003-10-09 11:40 UTC (permalink / raw)
To: Mark Hounschell; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 927 bytes --]
On Thu, Oct 09, 2003 at 07:22:07AM -0400, Mark Hounschell wrote:
> I'm trying to build a driver external to the kernel. I'm running 2.6.0-test6
> kernel.
> It appears to me (I'm probably wrong) that there is a kernel include
> file issue.
>
> gcc -c rtom.c -D__KERNEL__ -DMODULE -DDEBUG -DDEBUG_LEVEL=6
> -I/lib/modules/2.6.0-test6/build/include -I../include/linux/sys
> -I../include/linux -I../include -O -o rtom
This compilation command line dos not look like it came from the kerel
build system? If indeed you're using your own build system, please use
the kernel's build system to compile external modules. See
Documentation/kbuild/* for details, as well as lwn.net's "Compling
External Modules" article - http://lwn.net/Articles/21823/. I'm
guessing that you do not have something set up properly that the
kernel's build system would've set up for you.
--
Muli Ben-Yehuda
http://www.mulix.org
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can't build external module against 2.6.0-test6 kernel
2003-10-09 11:22 Can't build external module against 2.6.0-test6 kernel Mark Hounschell
2003-10-09 11:40 ` Muli Ben-Yehuda
@ 2003-10-09 15:23 ` Sam Ravnborg
2003-10-14 11:28 ` Mark Hounschell
1 sibling, 1 reply; 6+ messages in thread
From: Sam Ravnborg @ 2003-10-09 15:23 UTC (permalink / raw)
To: Mark Hounschell; +Cc: linux-kernel
On Thu, Oct 09, 2003 at 07:22:07AM -0400, Mark Hounschell wrote:
> I'm trying to build a driver external to the kernel. I'm running 2.6.0-test6
> kernel.
> It appears to me (I'm probably wrong) that there is a kernel include file issue.
Please follow Documentation/kbuild/modules.txt when building
external modules.
Please come back if you continue to have problems.
Sam
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can't build external module against 2.6.0-test6 kernel
2003-10-09 15:23 ` Sam Ravnborg
@ 2003-10-14 11:28 ` Mark Hounschell
2003-10-14 17:44 ` Sam Ravnborg
0 siblings, 1 reply; 6+ messages in thread
From: Mark Hounschell @ 2003-10-14 11:28 UTC (permalink / raw)
To: linux-kernel; +Cc: dmarkh
Sam Ravnborg wrote:
>
> On Thu, Oct 09, 2003 at 07:22:07AM -0400, Mark Hounschell wrote:
> > I'm trying to build a driver external to the kernel. I'm running 2.6.0-test6
> > kernel.
> > It appears to me (I'm probably wrong) that there is a kernel include file issue.
> Please follow Documentation/kbuild/modules.txt when building
> external modules.
>
> Please come back if you continue to have problems.
>
> Sam
Ok, I can now build it but I have to hardcode _my_ include directories in the
Makefile like:
/home/markh/work2/pcirtom_tst/driver/Makefile:
EXTRA_CFLAGS = -I/home/markh/work2/pcirtom_tst/include/linux/sys
-I/home/markh/work2/pcirtom_tst/include/linux
-I/home/markh/work2/pcirtom_tst/include
ifneq ($(KERNELRELEASE),)
obj-m += rtom.o
else
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
endif
My driver tree looks like
driver/
include/
diags/
samples/
library/
I've also tried setting the EXTRA_CFLAGS var in the top makefile but it doesn't
seem to get passed down when the driver is compiled?? I've also tried creating a
link in the driver directory pointing back to the include dir and adjusting the
paths in the EXTRA_CFLAGS to
-Iinclude/linux/sys -Iinclude/linux -Iinclude to no avail.
Thanks
Mark
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Can't build external module against 2.6.0-test6 kernel
2003-10-14 11:28 ` Mark Hounschell
@ 2003-10-14 17:44 ` Sam Ravnborg
2003-10-14 18:31 ` Mark Hounschell
0 siblings, 1 reply; 6+ messages in thread
From: Sam Ravnborg @ 2003-10-14 17:44 UTC (permalink / raw)
To: Mark Hounschell; +Cc: linux-kernel, dmarkh
On Tue, Oct 14, 2003 at 07:28:37AM -0400, Mark Hounschell wrote:
> Ok, I can now build it but I have to hardcode _my_ include directories in the
> Makefile like:
>
> /home/markh/work2/pcirtom_tst/driver/Makefile:
>
> EXTRA_CFLAGS = -I/home/markh/work2/pcirtom_tst/include/linux/sys
> -I/home/markh/work2/pcirtom_tst/include/linux
> -I/home/markh/work2/pcirtom_tst/include
Use:
EXTRA_CFLAGS := -I$(src)/include/linux/sys
EXTRA_CFLAGS += -I$(src)/include/linux
EXTRA_CFLAGS += -I$(src)/include
[Sidenote - you should only need the second line. Files in include/sys
should be included as:
#include <sys/file.h>
And there should be no .h files in the linux directory].
> ifneq ($(KERNELRELEASE),)
> obj-m += rtom.o
> else
> KDIR := /lib/modules/$(shell uname -r)/build
> PWD := $(shell pwd)
> default:
> $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
> endif
>
> My driver tree looks like
>
> driver/
> include/
> diags/
> samples/
> library/
>
> I've also tried setting the EXTRA_CFLAGS var in the top makefile but it
> doesn't seem to get passed down when the driver is compiled??
EXTRA_CFLAGS are only relevant for the current kbuild Makefile - so
it does not make sense to add it to the top-level Makefile.
Sam
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can't build external module against 2.6.0-test6 kernel
2003-10-14 17:44 ` Sam Ravnborg
@ 2003-10-14 18:31 ` Mark Hounschell
0 siblings, 0 replies; 6+ messages in thread
From: Mark Hounschell @ 2003-10-14 18:31 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linux-kernel, dmarkh
Sam Ravnborg wrote:
>
> On Tue, Oct 14, 2003 at 07:28:37AM -0400, Mark Hounschell wrote:
> > Ok, I can now build it but I have to hardcode _my_ include directories in the
> > Makefile like:
> >
> > /home/markh/work2/pcirtom_tst/driver/Makefile:
> >
> > EXTRA_CFLAGS = -I/home/markh/work2/pcirtom_tst/include/linux/sys
> > -I/home/markh/work2/pcirtom_tst/include/linux
> > -I/home/markh/work2/pcirtom_tst/include
> Use:
> EXTRA_CFLAGS := -I$(src)/include/linux/sys
> EXTRA_CFLAGS += -I$(src)/include/linux
> EXTRA_CFLAGS += -I$(src)/include
>
> [Sidenote - you should only need the second line. Files in include/sys
> should be included as:
> #include <sys/file.h>
>
> And there should be no .h files in the linux directory].
>
> > ifneq ($(KERNELRELEASE),)
> > obj-m += rtom.o
> > else
> > KDIR := /lib/modules/$(shell uname -r)/build
> > PWD := $(shell pwd)
> > default:
> > $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
> > endif
> >
> > My driver tree looks like
> >
> > driver/
> > include/
> > diags/
> > samples/
> > library/
> >
> > I've also tried setting the EXTRA_CFLAGS var in the top makefile but it
> > doesn't seem to get passed down when the driver is compiled??
> EXTRA_CFLAGS are only relevant for the current kbuild Makefile - so
> it does not make sense to add it to the top-level Makefile.
>
> Sam
Thanks, defining the EXTRA-CFLAGS how and where you indicated did the trick.
Is there also now special tricks for getting a library that goes with the driver
to work? None of my IOCTLS are making it into the driver.
Ragards
Mark
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-10-14 18:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-09 11:22 Can't build external module against 2.6.0-test6 kernel Mark Hounschell
2003-10-09 11:40 ` Muli Ben-Yehuda
2003-10-09 15:23 ` Sam Ravnborg
2003-10-14 11:28 ` Mark Hounschell
2003-10-14 17:44 ` Sam Ravnborg
2003-10-14 18:31 ` Mark Hounschell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox