1

我使用以下提示成功编译并启动了我自己的内核:

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

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

我用谷歌的方法测试了设置路径,但无法正常工作。我收到了这个错误

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....

我已经设置正确的路径指向这里:

/home/najmi/android/toolchain/linaro-git/android-toolchain-eabi/arm-linux-androideabi/bin
4

1 回答 1

0

显然,正如错误所说

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

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

然后,以相同的顺序尝试以下操作:

$ 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

确保在运行 compile any 之前运行以下代码以清理任何以前的编译。如果你没有编译任何东西。那么无需运行此代码

$ make clean && make mrproper

我以前测试过它的工作。

于 2019-02-26T12:18:31.977 回答