mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Export objs from an external Makefile?
@ 2001-10-11 16:35 Tom Rini
  2001-10-11 23:42 ` Keith Owens
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2001-10-11 16:35 UTC (permalink / raw)
  To: kbuild-devel, linux-kernel

Hey all.  How do you do the 'export-objs' bits in a kernel module that's
outside of the kernel?  Thanks..

-- 
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

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

* Re: Export objs from an external Makefile?
  2001-10-11 16:35 Export objs from an external Makefile? Tom Rini
@ 2001-10-11 23:42 ` Keith Owens
  2001-10-11 23:57   ` Tom Rini
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Owens @ 2001-10-11 23:42 UTC (permalink / raw)
  To: Tom Rini; +Cc: kbuild-devel, linux-kernel

On Thu, 11 Oct 2001 09:35:32 -0700, 
Tom Rini <trini@kernel.crashing.org> wrote:
>Hey all.  How do you do the 'export-objs' bits in a kernel module that's
>outside of the kernel?  Thanks..

Compile with -DMODULE -DEXPORT_SYMTAB.  If the kernel has modversions,
add -DMODVERSIONS -include $(HPATH)/linux/modversions.h.  The safest
way is to compile a module in the kernel that exports the objects then
copy the command, substituting the file names.


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

* Re: Export objs from an external Makefile?
  2001-10-11 23:42 ` Keith Owens
@ 2001-10-11 23:57   ` Tom Rini
  2001-10-12  0:14     ` Keith Owens
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2001-10-11 23:57 UTC (permalink / raw)
  To: Keith Owens; +Cc: kbuild-devel, linux-kernel

On Fri, Oct 12, 2001 at 09:42:05AM +1000, Keith Owens wrote:
> On Thu, 11 Oct 2001 09:35:32 -0700, 
> Tom Rini <trini@kernel.crashing.org> wrote:
> >Hey all.  How do you do the 'export-objs' bits in a kernel module that's
> >outside of the kernel?  Thanks..
> 
> Compile with -DMODULE -DEXPORT_SYMTAB.  If the kernel has modversions,
> add -DMODVERSIONS -include $(HPATH)/linux/modversions.h.  The safest
> way is to compile a module in the kernel that exports the objects then
> copy the command, substituting the file names.

I think I managed to get things right.  I added -DEXPORT_SYMTAB to the
default flags and added:
CFLAGS_EXTRA	+= $(shell if [ -f $(KERNEL_HEADERS)/linux/modversions.h ]; \
			then echo -include \
			$(KERNEL_HEADERS)/linux/modversions.h; fi)
 
Thanks!

-- 
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

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

* Re: Export objs from an external Makefile?
  2001-10-11 23:57   ` Tom Rini
@ 2001-10-12  0:14     ` Keith Owens
  2001-10-12  0:23       ` Tom Rini
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Owens @ 2001-10-12  0:14 UTC (permalink / raw)
  To: Tom Rini; +Cc: kbuild-devel, linux-kernel

On Thu, 11 Oct 2001 16:57:34 -0700, 
Tom Rini <trini@kernel.crashing.org> wrote:
>On Fri, Oct 12, 2001 at 09:42:05AM +1000, Keith Owens wrote:
>> On Thu, 11 Oct 2001 09:35:32 -0700, 
>> Tom Rini <trini@kernel.crashing.org> wrote:
>> >Hey all.  How do you do the 'export-objs' bits in a kernel module that's
>> >outside of the kernel?  Thanks..
>> 
>> Compile with -DMODULE -DEXPORT_SYMTAB.  If the kernel has modversions,
>> add -DMODVERSIONS -include $(HPATH)/linux/modversions.h.  The safest
>> way is to compile a module in the kernel that exports the objects then
>> copy the command, substituting the file names.
>
>I think I managed to get things right.  I added -DEXPORT_SYMTAB to the
>default flags and added:
>CFLAGS_EXTRA	+= $(shell if [ -f $(KERNEL_HEADERS)/linux/modversions.h ]; \
>			then echo -include \
>			$(KERNEL_HEADERS)/linux/modversions.h; fi)

You need -DMODVERSIONS as well.

Testing for the presence of modversions.h will not work in kbuild 2.5,
that file is always created with error messages to catch people who
include it "by hand".  OTOH, kbuild 2.5 has support for compiling
outside the standard kernel tree so who cares :)?


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

* Re: Export objs from an external Makefile?
  2001-10-12  0:14     ` Keith Owens
@ 2001-10-12  0:23       ` Tom Rini
  0 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2001-10-12  0:23 UTC (permalink / raw)
  To: Keith Owens; +Cc: kbuild-devel, linux-kernel

On Fri, Oct 12, 2001 at 10:14:38AM +1000, Keith Owens wrote:
> On Thu, 11 Oct 2001 16:57:34 -0700, 
> Tom Rini <trini@kernel.crashing.org> wrote:
> >On Fri, Oct 12, 2001 at 09:42:05AM +1000, Keith Owens wrote:
> >> On Thu, 11 Oct 2001 09:35:32 -0700, 
> >> Tom Rini <trini@kernel.crashing.org> wrote:
> >> >Hey all.  How do you do the 'export-objs' bits in a kernel module that's
> >> >outside of the kernel?  Thanks..
> >> 
> >> Compile with -DMODULE -DEXPORT_SYMTAB.  If the kernel has modversions,
> >> add -DMODVERSIONS -include $(HPATH)/linux/modversions.h.  The safest
> >> way is to compile a module in the kernel that exports the objects then
> >> copy the command, substituting the file names.
> >
> >I think I managed to get things right.  I added -DEXPORT_SYMTAB to the
> >default flags and added:
> >CFLAGS_EXTRA	+= $(shell if [ -f $(KERNEL_HEADERS)/linux/modversions.h ]; \
> >			then echo -include \
> >			$(KERNEL_HEADERS)/linux/modversions.h; fi)
> 
> You need -DMODVERSIONS as well.

D'oh...

> Testing for the presence of modversions.h will not work in kbuild 2.5,
> that file is always created with error messages to catch people who
> include it "by hand".  OTOH, kbuild 2.5 has support for compiling
> outside the standard kernel tree so who cares :)?

Right.  I'm sure some changes will have to be made for external modules
once 2.5 is underway...

-- 
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

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

end of thread, other threads:[~2001-10-12  0:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-11 16:35 Export objs from an external Makefile? Tom Rini
2001-10-11 23:42 ` Keith Owens
2001-10-11 23:57   ` Tom Rini
2001-10-12  0:14     ` Keith Owens
2001-10-12  0:23       ` Tom Rini

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

all inboxes | Powered by JetHome®