Building kernel module for Android
android, linux-kernel
Solution
Try setting up `CONFIG_CPU_V7=y` in your kernel `.config` file
Problem
I need to add the FTDI USB module to the Android kernel (Android 2.3.1, Linux 2.6.32), so I got the 2.6.32 kernel and tried to build the module: ``` make modules ARCH=arm CROSS_COMPILE=arm-none-eabi- ``` But when I tried to do 'insmod ftdi_sio.ko', the error message was ``` insmod: init_module 'ftdi_sio.ko' failed (Exec format error) ``` In dmesg's output I found this ``` ftdi_sio: version magic '2.6.32.27 preempt mod_unload ARMv5 ' should be '2.6.32.27 preempt mod_unload ARMv7 ' ``` I tried to add 'armv7-a' flag (as I read in Android NDK docs) ``` make modules ARCH=arm CROSS_COMPILE=arm-linux-androideabi- CFLAGS='-march=armv7-a -mfloat-abi=softfp' ``` Also, I tried following cross-compilers: arm-none-eabi-, arm-eabi-, arm-linux-android-eabi- Every time result was the same - ARMv5 in the version magic. How can I build the module for ARMv7?