Impossible de comstackr LKM pour Android

J’ai Ubuntu 12.04 comme evironment de compilation.

J’ai aussi le code source du kernel mod Cyanogen (obtenu de Github: https://github.com/CyanogenMod/cm-kernel )

J’utilise toolchain à partir d’Android NDK r5c (pour Linux)

J’ai le code suivant:

#include  #include  #include  asmlinkage ssize_t (*orig_open)(const char *pathname, int flags); asmlinkage ssize_t hooked_open(const char *pathname, int flags) { printk(KERN_INFO "SYS_OPEN: %s\n", pathname); return orig_open(pathname, flags); } void **sys_call_table; static int __init root_start(void) { sys_call_table= (void *) 0x0030084; orig_open = sys_call_table[__NR_open]; sys_call_table[__NR_open] = hooked_open; return 0; } static void __exit root_stop(void) { sys_call_table[__NR_open] = &orig_open; } module_init(root_start); module_exit(root_stop); 

C’est mon Makefile :

 obj-m += root.o all: make -C CyanogenMod-cm-kernel-2a32a61/ M=$(PWD) ARCH=arm CROSS_COMPILE=arm-eabi- modules 

Mes démarches pour comstackr dans Terminal :

 export PATH=$PATH:/home/hongnhat/lkm/android-ndk-r5c/toolchains/arm-eabi-4.4.0/prebuilt/linux-x86/bin cd CyanogenMod-cm-kernel-2a32a61 make oldconfig && make prepare cd .. make 

Le résultat est:

 make -C CyanogenMod-cm-kernel-2a32a61/ M=/home/hongnhat/lkm ARCH=arm CROSS_COMPILE=arm-eabi- modules make[1]: Entering directory `/home/hongnhat/lkm/CyanogenMod-cm-kernel-2a32a61' WARNING: Symbol version dump /home/hongnhat/lkm/CyanogenMod-cm-kernel-2a32a61/Module.symvers is missing; modules will have no dependencies and modversions. CC [M] /home/hongnhat/lkm/root.o as: unrecognized option '-EL' make[2]: *** [/home/hongnhat/lkm/root.o] Error 1 make[1]: *** [_module_/home/hongnhat/lkm] Error 2 make[1]: Leaving directory `/home/hongnhat/lkm/CyanogenMod-cm-kernel-2a32a61' make: *** [all] Error 2 

Je ne sais pas pourquoi cela renvoie l’ erreur non reconnue «-EL» . Aidez-moi, s’il vous plaît, à résoudre le problème. Je me suis tiré les cheveux en essayant, j’ai essayé d’utiliser une version différente de gcc (4.4.0, 4.4.3, 4.6), mais sans aucune utilisation.

Essayez de le comstackr avec GCC de Sourcery Mentor. Je l’ai déjà essayé pour comstackr le kernel Linux pour Android. Peut-être que ça aide.