public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* missing elfconfig.h
@ 2007-06-08 13:08 Rich Chase
  2007-06-08 20:19 ` Sam Ravnborg
  0 siblings, 1 reply; 11+ messages in thread
From: Rich Chase @ 2007-06-08 13:08 UTC (permalink / raw)
  To: linux-kernel

An Apparent bug:
version 2.6.21.3
missing the file ./scripts/mod/elfconfig.h

I noticed this when trying to compile a 3rd party 
module. Maybe this is intended. Not sure.

I discovered this when I attempted to compile modpost.c 
in the same directory. The following is the output:

#> make modpost
cc     modpost.c   -o modpost
In file included from modpost.c:15:
modpost.h:12:23: error: elfconfig.h: No such file or 
directory
modpost.c: In function ‘handle_modversions’:
modpost.c:436: error: ‘MODULE_SYMBOL_PREFIX’ undeclared 
(first use in this function)
modpost.c:436: error: (Each undeclared identifier is 
reported only once
modpost.c:436: error: for each function it appears in.)
modpost.c:436: error: expected ‘)’ before string 
constant
modpost.c:436: error: too few arguments to 
function ‘memcmp’
modpost.c:438: error: expected ‘)’ before string 
constant
modpost.c:451: error: expected ‘)’ before string 
constant
modpost.c:482: error: expected ‘)’ before string 
constant
modpost.c:482: error: too few arguments to 
function ‘memcmp’
modpost.c:483: error: expected ‘)’ before string 
constant
modpost.c:486: error: expected ‘)’ before string 
constant
modpost.c:488: error: expected ‘)’ before string 
constant
make: *** [modpost] Error 1


Regards,
Rich Chase

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: missing elfconfig.h
  2007-06-08 13:08 missing elfconfig.h Rich Chase
@ 2007-06-08 20:19 ` Sam Ravnborg
  2007-06-09  7:53   ` Jan Engelhardt
  2007-06-09 16:24   ` Rich Chase
  0 siblings, 2 replies; 11+ messages in thread
From: Sam Ravnborg @ 2007-06-08 20:19 UTC (permalink / raw)
  To: Rich Chase; +Cc: linux-kernel

On Fri, Jun 08, 2007 at 09:08:36AM -0400, Rich Chase wrote:
> An Apparent bug:
> version 2.6.21.3
> missing the file ./scripts/mod/elfconfig.h

To build an external module you need to point to a directory
where a fully build kernel is placed.

You could do a full build and then a "make clean",
this would still let you build external modules.

In your case the kernel was not build.
And to build modpost you need to execute "make modules" from
the kernel top-level directory.

> I noticed this when trying to compile a 3rd party 
> module. Maybe this is intended. Not sure.
Anything that is available public?
Could take a quick look at the Makefile +
build instructions.

	Sam

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: missing elfconfig.h
  2007-06-08 20:19 ` Sam Ravnborg
@ 2007-06-09  7:53   ` Jan Engelhardt
  2007-06-09  7:57     ` Robert P. J. Day
                       ` (2 more replies)
  2007-06-09 16:24   ` Rich Chase
  1 sibling, 3 replies; 11+ messages in thread
From: Jan Engelhardt @ 2007-06-09  7:53 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Rich Chase, linux-kernel


On Jun 8 2007 22:19, Sam Ravnborg wrote:
>On Fri, Jun 08, 2007 at 09:08:36AM -0400, Rich Chase wrote:
>> An Apparent bug:
>> version 2.6.21.3
>> missing the file ./scripts/mod/elfconfig.h
>
>To build an external module you need to point to a directory
>where a fully build kernel is placed.
>
>You could do a full build and then a "make clean",
>this would still let you build external modules.

Is not "make prepare" enough?

>In your case the kernel was not build.
>And to build modpost you need to execute "make modules" from
>the kernel top-level directory.

"make scripts" ?

>Anything that is available public?
>Could take a quick look at the Makefile +
>build instructions.

Most likely it is one of the worse Makefile...


	Jan
-- 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: missing elfconfig.h
  2007-06-09  7:53   ` Jan Engelhardt
@ 2007-06-09  7:57     ` Robert P. J. Day
  2007-06-09  8:54       ` Sam Ravnborg
  2007-06-09  7:59     ` Robert P. J. Day
  2007-06-09  8:53     ` Sam Ravnborg
  2 siblings, 1 reply; 11+ messages in thread
From: Robert P. J. Day @ 2007-06-09  7:57 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Sam Ravnborg, Rich Chase, linux-kernel

On Sat, 9 Jun 2007, Jan Engelhardt wrote:

>
> On Jun 8 2007 22:19, Sam Ravnborg wrote:
> >On Fri, Jun 08, 2007 at 09:08:36AM -0400, Rich Chase wrote:
> >> An Apparent bug:
> >> version 2.6.21.3
> >> missing the file ./scripts/mod/elfconfig.h
> >
> >To build an external module you need to point to a directory
> >where a fully build kernel is placed.
> >
> >You could do a full build and then a "make clean",
> >this would still let you build external modules.
>
> Is not "make prepare" enough?

technically, you want to run "make modules_prepare" on the tree, after
doing a configuration.

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: missing elfconfig.h
  2007-06-09  7:53   ` Jan Engelhardt
  2007-06-09  7:57     ` Robert P. J. Day
@ 2007-06-09  7:59     ` Robert P. J. Day
  2007-06-09  8:53     ` Sam Ravnborg
  2 siblings, 0 replies; 11+ messages in thread
From: Robert P. J. Day @ 2007-06-09  7:59 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Sam Ravnborg, Rich Chase, linux-kernel

On Sat, 9 Jun 2007, Jan Engelhardt wrote:

>
> On Jun 8 2007 22:19, Sam Ravnborg wrote:
> >On Fri, Jun 08, 2007 at 09:08:36AM -0400, Rich Chase wrote:
> >> An Apparent bug:
> >> version 2.6.21.3
> >> missing the file ./scripts/mod/elfconfig.h
> >
> >To build an external module you need to point to a directory
> >where a fully build kernel is placed.
> >
> >You could do a full build and then a "make clean",
> >this would still let you build external modules.
>
> Is not "make prepare" enough?
>
> >In your case the kernel was not build.
> >And to build modpost you need to execute "make modules" from
> >the kernel top-level directory.
>
> "make scripts" ?

by the way, technically, you're right since, from the top-level
Makefile:

# Target to prepare building external modules
PHONY += modules_prepare
modules_prepare: prepare scripts

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: missing elfconfig.h
  2007-06-09  7:53   ` Jan Engelhardt
  2007-06-09  7:57     ` Robert P. J. Day
  2007-06-09  7:59     ` Robert P. J. Day
@ 2007-06-09  8:53     ` Sam Ravnborg
  2007-06-09 16:38       ` Rich Chase
  2 siblings, 1 reply; 11+ messages in thread
From: Sam Ravnborg @ 2007-06-09  8:53 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Rich Chase, linux-kernel

On Sat, Jun 09, 2007 at 09:53:22AM +0200, Jan Engelhardt wrote:
> 
> On Jun 8 2007 22:19, Sam Ravnborg wrote:
> >On Fri, Jun 08, 2007 at 09:08:36AM -0400, Rich Chase wrote:
> >> An Apparent bug:
> >> version 2.6.21.3
> >> missing the file ./scripts/mod/elfconfig.h
> >
> >To build an external module you need to point to a directory
> >where a fully build kernel is placed.
> >
> >You could do a full build and then a "make clean",
> >this would still let you build external modules.
> 
> Is not "make prepare" enough?
> 
> >In your case the kernel was not build.
> >And to build modpost you need to execute "make modules" from
> >the kernel top-level directory.
> 
> "make scripts" ?
It depnes on the module. If the module uses MODVERSIONIGN a full
build is needed.
For the naive case make *config; make prepare; make scripts are enough.
But I encourage a full make and then make clean because that works in
all situations.

	Sam

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: missing elfconfig.h
  2007-06-09  7:57     ` Robert P. J. Day
@ 2007-06-09  8:54       ` Sam Ravnborg
  0 siblings, 0 replies; 11+ messages in thread
From: Sam Ravnborg @ 2007-06-09  8:54 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: Jan Engelhardt, Rich Chase, linux-kernel

On Sat, Jun 09, 2007 at 03:57:30AM -0400, Robert P. J. Day wrote:
> On Sat, 9 Jun 2007, Jan Engelhardt wrote:
> 
> >
> > On Jun 8 2007 22:19, Sam Ravnborg wrote:
> > >On Fri, Jun 08, 2007 at 09:08:36AM -0400, Rich Chase wrote:
> > >> An Apparent bug:
> > >> version 2.6.21.3
> > >> missing the file ./scripts/mod/elfconfig.h
> > >
> > >To build an external module you need to point to a directory
> > >where a fully build kernel is placed.
> > >
> > >You could do a full build and then a "make clean",
> > >this would still let you build external modules.
> >
> > Is not "make prepare" enough?
> 
> technically, you want to run "make modules_prepare" on the tree, after
> doing a configuration.

Yep - had forgotten about that target.
Was you btw. planning to write up a kbuild HOWTO one day?

It would be nice to point to some kind of docs for such questions.

	Sam

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: missing elfconfig.h
  2007-06-08 20:19 ` Sam Ravnborg
  2007-06-09  7:53   ` Jan Engelhardt
@ 2007-06-09 16:24   ` Rich Chase
  2007-06-09 20:57     ` Sam Ravnborg
  1 sibling, 1 reply; 11+ messages in thread
From: Rich Chase @ 2007-06-09 16:24 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sam Ravnborg

Sam,
Thanks for the feedback. I need more ideas. See 
responses to your ideas below.

> On Fri, Jun 08, 2007 at 09:08:36AM -0400, Rich Chase 
wrote:
> > An Apparent bug:
> > version 2.6.21.3
> > missing the file ./scripts/mod/elfconfig.h
>
> To build an external module you need to point to a
> directory where a fully build kernel is placed.
>
> You could do a full build and then a "make clean",
> this would still let you build external modules.
>
> In your case the kernel was not build.
> And to build modpost you need to execute "make
> modules" from the kernel top-level directory.
>

Actually, yes, the kernel was fully built, and I had 
booted into it. I had not performed any "make 
mrproper", or anything like that, either. I didn't 
even "make clean".


> > I noticed this when trying to compile a 3rd party
> > module. Maybe this is intended. Not sure.
>
> Anything that is available public?
> Could take a quick look at the Makefile +
> build instructions.
>

Yes, I was attempting to compile gspcav1, a webcam 
driver. It can be found at:
  http://mxhaard.free.fr/download.html

Again, Thanks.
Rich


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: missing elfconfig.h
@ 2007-06-09 16:34 Rich Chase
  0 siblings, 0 replies; 11+ messages in thread
From: Rich Chase @ 2007-06-09 16:34 UTC (permalink / raw)
  To: linux-kernel

Jan,

> >In your case the kernel was not build.
> >And to build modpost you need to execute "make
> > modules" from the kernel top-level directory.
>
> "make scripts" ?

Wouldn't this do the same as going into the ".scripts/"
directory and doing make?

My problem is that the script 'modpost' requires the
include file, elfconfig.h, because it is included in
modpost.c.

> Most likely it is one of the worse Makefile...

Entirely possible. Maybe the module shouldn't need the
modpost script anymore? That would explain why my
kernel built and runs fine without successful compile
of the script. But then why is the source for the
script still in the kernel tree?

Thanks,
Rich

-------------------------------------------------------

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: missing elfconfig.h
  2007-06-09  8:53     ` Sam Ravnborg
@ 2007-06-09 16:38       ` Rich Chase
  0 siblings, 0 replies; 11+ messages in thread
From: Rich Chase @ 2007-06-09 16:38 UTC (permalink / raw)
  To: linux-kernel

As mentioned,

> It depnes on the module. If the module uses
> MODVERSIONIGN a full build is needed.

This is what I did. However, the include file is 
missing. Do sourcefiles (other than config.h) get 
created at compile time?

Thanks,
Rich

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: missing elfconfig.h
  2007-06-09 16:24   ` Rich Chase
@ 2007-06-09 20:57     ` Sam Ravnborg
  0 siblings, 0 replies; 11+ messages in thread
From: Sam Ravnborg @ 2007-06-09 20:57 UTC (permalink / raw)
  To: Rich Chase; +Cc: linux-kernel

On Sat, Jun 09, 2007 at 12:24:14PM -0400, Rich Chase wrote:
> Sam,
> Thanks for the feedback. I need more ideas. See 
> responses to your ideas below.
> 
> 
> Yes, I was attempting to compile gspcav1, a webcam 
> driver. It can be found at:
>   http://mxhaard.free.fr/download.html

>From the Makefile:

KERNEL_VERSION = `uname -r`
KERNELDIR := /lib/modules/$(KERNEL_VERSION)/build
PWD  := $(shell pwd)
MODULE_INSTALLDIR = /lib/modules/$(KERNEL_VERSION)/kernel/drivers/usb/media/
MODULE_INSTALLDIR2 = /lib/modules/$(KERNEL_VERSION)/kernel/drivers/media/video/

default:
        $(MAKE) -C $(KERNELDIR) SUBDIRS=$(PWD) CC=$(CC) modules


So you need to check:
1) That your running kernel is indeed installed as /lib/modules/`uname -r`
2) That /lib/modules/`uname -r`/build are a proper symlink to
your kernel source including the build files.

Try to do: ls /lib/modules/`uname -r`/build/scripts

If this is OK then add V=1 to make invocation liek this:
        $(MAKE) -C $(KERNELDIR) SUBDIRS=$(PWD) CC=$(CC) V=1 modules

and send the full output.

	Sam

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-06-09 20:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-08 13:08 missing elfconfig.h Rich Chase
2007-06-08 20:19 ` Sam Ravnborg
2007-06-09  7:53   ` Jan Engelhardt
2007-06-09  7:57     ` Robert P. J. Day
2007-06-09  8:54       ` Sam Ravnborg
2007-06-09  7:59     ` Robert P. J. Day
2007-06-09  8:53     ` Sam Ravnborg
2007-06-09 16:38       ` Rich Chase
2007-06-09 16:24   ` Rich Chase
2007-06-09 20:57     ` Sam Ravnborg
  -- strict thread matches above, loose matches on Subject: below --
2007-06-09 16:34 Rich Chase

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox