Re: Loadable Module Compilation Options

Russell King - ARM Linux <[email protected]>
Newsgroups gmane.linux.ports.arm.general
Message-ID <[email protected]>
On Wed, Dec 02, 2009 at 04:23:08PM -0000, David Wooff wrote:
> Hello,
> how do I establish what build options I need to compile a driver module
> for my ARM processor?
>  
> I currently have a working kernel (2.6.30) running on an Atmel
> AT91SAM9G20-EK and I'm able to compile a simple application in Eclipse
> simply by pointing the compiler and linker commands to the appropriate
> cross-compiler path with some very basic compiler options.  I can also
> download to the target and run.
>  
> However, when I come to try to build a simple loadable driver module
> (does nothing but print a kernel message), I get all sorts of build
> errors.  I believe I'm missing a lot of options - things like __KERNEL__
> and __LINUX_ARM_ARCH__ etc.  There is a makefile in
> ~/linux-2.6.30/arch/arm but it's geared towards building the kernel (I
> think) and it is extremely hard to pick out exactly what I need.

There is an interface from the kernel makefiles for building external
modules.  See Documentation/kbuild/modules.txt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.