问题
i successfully compiled and boot my own kernel with this tips:
http://astro.temple.edu/~tue68607/project/articles/customized-android-aospsystem-nexus4.html
so now I wanted to use Linaro toolchain.
I tested setting path with the Google's method but can't work. I got this error
najmi@raden-aufa-qistina:~/android/kernel/msm$ export ARCH=arm
najmi@raden-aufa-qistina:~/android/kernel/msm$ export SUBARCH=arm
najmi@raden-aufa-qistina:~/android/kernel/msm$ export CROSS_COMPILE=arm-linux-androideabi-
najmi@raden-aufa-qistina:~/android/kernel/msm$ make mako_defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
warning: (ARCH_MSM_KRAITMP && ARCH_MSM_CORTEX_A5) selects HAVE_HW_BRKPT_RESERVED_RW_ACCESS which has unmet direct dependencies (HAVE_HW_BREAKPOINT)
warning: (ARCH_MSM_KRAITMP && ARCH_MSM_CORTEX_A5) selects HAVE_HW_BRKPT_RESERVED_RW_ACCESS which has unmet direct dependencies (HAVE_HW_BREAKPOINT)
#
# configuration written to .config
#
najmi@raden-aufa-qistina:~/android/kernel/msm$ make -j8
scripts/kconfig/conf --silentoldconfig Kconfig
warning: (ARCH_MSM_KRAITMP && ARCH_MSM_CORTEX_A5) selects HAVE_HW_BRKPT_RESERVED_RW_ACCESS which has unmet direct dependencies (HAVE_HW_BREAKPOINT)
warning: (ARCH_MSM_KRAITMP && ARCH_MSM_CORTEX_A5) selects HAVE_HW_BRKPT_RESERVED_RW_ACCESS which has unmet direct dependencies (HAVE_HW_BREAKPOINT)
CHK include/linux/version.h
HOSTCC scripts/conmakehash
HOSTCC scripts/kallsyms
HOSTCC scripts/bin2c
CC scripts/mod/empty.o
HOSTCC scripts/mod/mk_elfconfig
arm-linux-androideabi-gcc: No such file or directory
Is your PATH set correctly?
make[2]: *** [scripts/mod/empty.o] Error 2
make[2]: *** Waiting for unfinished jobs....
HOSTCC scripts/selinux/genheaders/genheaders
HOSTCC scripts/selinux/mdp/mdp
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
I already set the path correct to point here:
/home/najmi/android/toolchain/linaro-git/android-toolchain-eabi/arm-linux-androideabi/bin
回答1:
Obviously, as the error said
arm-linux-androideabi-gcc: No such file or directory
This means that the current version of NDK that your are using dose not conatin gcc. So,try an older version of android NDK(I suggest version 15c which contains gcc). https://developer.android.com/ndk/downloads/older_releases.html
Then, try the following in the same order :
$ export ARCH=arm
$ export CROSS_COMPILE=<your path >/android-ndk-r15c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
$ make mako_defconfig
$ make -j4
make sure to run the following code to clean any previous compilation before running compile anything. if you didn't compile anything. then no need to run this code
$ make clean && make mrproper
I've tested before and its work.
来源:https://stackoverflow.com/questions/20186572/cross-compile-android-mako-kernel-with-linaro-toolchain