如何构建android内核金鱼2.6.29并在qemu上运行它?

时间:2017-07-23 11:02:49

标签: android c linux gcc android-kernel

我使用以下命令下载android内核源代码:
git clone https://android.googlesource.com/kernel/goldfish.git git checkout -t origin/android-goldfish-2.6.29 -b goldfish

然后,我在金鱼目录中export CROSS_COMPILE=arm-eabi- export ARCH=arm export SUBARCH=arm make goldfish_defconfig # configure the kernel make -j2 # build it

对这些命令进行了一些讨论

但之后我在终端上收到了这些文字:

make: arm-eabi-gcc: Command not found scripts/kconfig/conf -s arch/arm/Kconfig make: arm-eabi-gcc: Command not found CHK include/linux/version.h SYMLINK include/asm -> include/asm-arm ... make[1]: [kernel/bounds.s] Error 127 Makefile:974: recipe for target 'prepare0' failed make: [prepare0] Error 2


我尝试用这些命令安装arm-eabi-gcc:
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa sudo apt-get update sudo apt-get install gcc-arm-embedded 但没有任何变化,并再次出现make: arm-eabi-gcc: Command not found错误。

有人知道如何解决这个问题吗? (我在我的ubuntu 17.04上做这件事)

现在我使用arm-none-eabi-gcc我使用make -j2命令后出现此错误: scripts/kconfig/conf -s arch/arm/Kconfig ... include/linux/compiler-gcc.h:86:30: fatal error: linux/compiler-gcc6.h: No such file or directory #include gcc_header(__GNUC__) ... HOSTLD scripts/mod/modpost

然后我将我的gcc版本降级为gcc version 4.7.4 (Ubuntu/Linaro 4.7.4-3ubuntu12) 但仍然出现错误include/linux/compiler-gcc.h:86:30: fatal error: linux/compiler-gcc6.h: No such file or directory #include gcc_header(__GNUC__)!有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

gcc-arm-ebedded包中的编译器二进制文件名为arm-none-eabi-gcc,因此您应设置CROSS_COMPILE=arm-none-eabi-