title: Cross compiling a kernel module: invalid module format
body: <p>I'm trying to cross compile a helloworld kernel module with specifications:</p>
  
  <ul>
  <li>host: intel x86 32 bit, linux-3.0.0</li>
  <li>target: ARM machine (Parrot AR.Drone), linux-2.6.27.47</li>
  </ul>
  
  <p>I'm using the makefile:</p>
  
  <pre><code>PWD := $(shell pwd)
  obj-m := test.o
  all:
      $(MAKE) -C /path/to/kernel M=$(PWD) CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm  modules
  </code></pre>
  
  <p>Where <code>arm-none-linux-gnueabi-</code> is the prefix of the arm toolchain.</p>
  
  <p>As kernel, I tried using a clone from <code>git://github.com/CyanogenMod/cm-kernel.git</code> as kernel. This is a 2.6 kernel fork. Using this kernel, compilation was successfull. When trying to insert the module, it gives the error:</p>
  
  <pre><code>invalid module format
  </code></pre>
  
  <p>Which, sadly, says very little.</p>