linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problems compiling modules outside of tree in 2.6.0test1
@ 2003-07-15  6:46 Carl Thompson
  2003-07-15  8:40 ` Martin Zwickel
  2003-07-15 17:36 ` Randy.Dunlap
  0 siblings, 2 replies; 4+ messages in thread
From: Carl Thompson @ 2003-07-15  6:46 UTC (permalink / raw)
  To: linux-kernel

[This problem still exists in Linux 2.6.0test1]

I am not on the kernel mailing list so please CC with any responses.  I am
new to this kernel / module stuff so if I am doing something obviously
wrong please correct me gently!

Hello,

     I have noticed a problem when compiling kernel modules outside of the
kernel tree for 2.5(.75).  I am compiling a 3rd party network module for
2.5 and it needs to include "linux/netdevice.h" .  This file includes a
bunch of other kernel headers which in turn include more kernel headers.
This eventually gets to "asm/irq.h" and on my architechture (i386) this
file has the line

   #include "irq_vectors.h"

     The problem is that this "irq_vectors.h" file is not found in the same
directory as "irq.h" but in a different directory that is explicitly added
to the include path for the kernel in "arch/i386/Makefile" .   This is just
fine for kernel compiles using the kernel makefiles, but for stuff outside
of the tree it means that "irq_vectors.h" won't be found.  A solution would
be to to duplicate the relevant sections of the kernel's architecture
specific makefile stuff to calculate and add the include path myself, but
this seems unclean and would require me to add more architecture specific
voodoo for each architecture to be supported.

     I believe the proper solution would be for the kernel build system to
create a symbolic link to "irq_vectors.h" in "asm-i386/" just as "asm/"
itself is a symbolic link to "asm-i386/" instead of adding an include path
in the architecture specific makefile that breaks out-of-tree compiles.

Thank you,
Carl Thompson



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

* Re: Problems compiling modules outside of tree in 2.6.0test1
  2003-07-15  6:46 Problems compiling modules outside of tree in 2.6.0test1 Carl Thompson
@ 2003-07-15  8:40 ` Martin Zwickel
  2003-07-15 16:48   ` Carl Thompson
  2003-07-15 17:36 ` Randy.Dunlap
  1 sibling, 1 reply; 4+ messages in thread
From: Martin Zwickel @ 2003-07-15  8:40 UTC (permalink / raw)
  To: Carl Thompson; +Cc: linux-kernel

On Mon, 14 Jul 2003 23:46:27 -0700
Carl Thompson <cet@carlthompson.net> bubbled:

What about:

CFLAGS += -I/usr/include/asm/mach-default/

-- 
MyExcuse:
Someone is broadcasting pygmy packets and the router doesn't know how to deal
with them.

Martin Zwickel <martin.zwickel@technotrend.de>
Research & Development

TechnoTrend AG <http://www.technotrend.de>

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

* Re: Problems compiling modules outside of tree in 2.6.0test1
  2003-07-15  8:40 ` Martin Zwickel
@ 2003-07-15 16:48   ` Carl Thompson
  0 siblings, 0 replies; 4+ messages in thread
From: Carl Thompson @ 2003-07-15 16:48 UTC (permalink / raw)
  To: Martin Zwickel; +Cc: linux-kernel

Quoting Martin Zwickel <martin.zwickel@technotrend.de>:

> On Mon, 14 Jul 2003 23:46:27 -0700
> Carl Thompson <cet@carlthompson.net> bubbled:
>
> What about:
>
> CFLAGS += -I/usr/include/asm/mach-default/

This is what I'm doing now.  But this is architecture specific.  On some
i386 architectures you might want "include/asm/mach-voyager" or
"include/asm/mach-visws" instead.  I don't think I should have to keep
track of architecture specific include paths when the kernel build system
already does that for me.  The correct files should automatically be found
when included by kernel headers, in my opinion.  Or there out to be a
"include/asm/mach-platform" which is handled like "include/asm" as a
symbolic link which is made by the build system.

> Martin Zwickel <martin.zwickel@technotrend.de>

Carl Thompson



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

* Re: Problems compiling modules outside of tree in 2.6.0test1
  2003-07-15  6:46 Problems compiling modules outside of tree in 2.6.0test1 Carl Thompson
  2003-07-15  8:40 ` Martin Zwickel
@ 2003-07-15 17:36 ` Randy.Dunlap
  1 sibling, 0 replies; 4+ messages in thread
From: Randy.Dunlap @ 2003-07-15 17:36 UTC (permalink / raw)
  To: Carl Thompson; +Cc: linux-kernel

On Mon, 14 Jul 2003 23:46:27 -0700 Carl Thompson <cet@carlthompson.net> wrote:

| [This problem still exists in Linux 2.6.0test1]
| 
| I am not on the kernel mailing list so please CC with any responses.  I am
| new to this kernel / module stuff so if I am doing something obviously
| wrong please correct me gently!
| 
| Hello,
| 
|      I have noticed a problem when compiling kernel modules outside of the
| kernel tree for 2.5(.75).  I am compiling a 3rd party network module for
| 2.5 and it needs to include "linux/netdevice.h" .  This file includes a
| bunch of other kernel headers which in turn include more kernel headers.
| This eventually gets to "asm/irq.h" and on my architechture (i386) this
| file has the line
| 
|    #include "irq_vectors.h"
| 
|      The problem is that this "irq_vectors.h" file is not found in the same
| directory as "irq.h" but in a different directory that is explicitly added
| to the include path for the kernel in "arch/i386/Makefile" .   This is just
| fine for kernel compiles using the kernel makefiles, but for stuff outside
| of the tree it means that "irq_vectors.h" won't be found.  A solution would
| be to to duplicate the relevant sections of the kernel's architecture
| specific makefile stuff to calculate and add the include path myself, but
| this seems unclean and would require me to add more architecture specific
| voodoo for each architecture to be supported.
| 
|      I believe the proper solution would be for the kernel build system to
| create a symbolic link to "irq_vectors.h" in "asm-i386/" just as "asm/"
| itself is a symbolic link to "asm-i386/" instead of adding an include path
| in the architecture specific makefile that breaks out-of-tree compiles.

Are you using the expected style of Makefile?
See linux/Documentation/modules.txt and
linux/Documentation/kbuild/makefiles.txt .

For a outside-the-kernel-tree module that I just built, I don't
have this problem.  I modified this external module to printk()
the value of NR_IRQS (from irq_vectors.h) with no problems.

Here is my Makefile:
# makefile for oops_test/dump*.c
# Randy Dunlap, 2003-03-12
# usage:
# cd /path/to/kernel/source && make SUBDIRS=/path/to/source/oops_test/ modules

CONFIG_OOPS_TEST=m

obj-m := dump_test.o

# dump_test-objs := dump_test.o

clean-files := *.o

# fini;



--
~Randy
| http://developer.osdl.org/rddunlap/ | http://www.xenotime.net/linux/ |

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

end of thread, other threads:[~2003-07-15 17:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-15  6:46 Problems compiling modules outside of tree in 2.6.0test1 Carl Thompson
2003-07-15  8:40 ` Martin Zwickel
2003-07-15 16:48   ` Carl Thompson
2003-07-15 17:36 ` Randy.Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).