与Linaro Toolchain交叉编译Android(Mako)内核 [英] Cross Compile Android (Mako) Kernel with Linaro Toolchain

查看:345
本文介绍了与Linaro Toolchain交叉编译Android(Mako)内核的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过以下提示成功编译并引导了自己的内核:

i successfully compiled and boot my own kernel with this tips:

http://astro.temple.edu /~tue68607/project/articles/customized-android-aospsystem-nexus4.html

所以现在我想使用Linaro工具链.

so now I wanted to use Linaro toolchain.

我使用Google的方法测试了设置路径,但无法正常工作.我遇到了这个错误

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

推荐答案

很明显,错误提示

arm-linux-androideabi-gcc: No such file or directory

这意味着您使用的当前NDK版本不支持gcc.因此,请尝试使用较早版本的android NDK(我建议使用包含gcc的15c版本). https://developer.android.com/ndk/downloads/older_releases.html

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.

这篇关于与Linaro Toolchain交叉编译Android(Mako)内核的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆