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

标签 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

然后,我在 goldfish 目录
export CROSS_COMPILE=arm-eabi- 中使用这些命令进行一些配置 导出 ARCH=arm 导出 SUBARCH=arm make goldfish_defconfig # 配置内核 make -j2 # 构建它

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

制作:arm-eabi-gcc:找不到命令 脚本/kconfig/conf -s arch/arm/Kconfig make:arm-eabi-gcc:找不到命令 CHK 包括/linux/version.h SYMLINK include/asm -> include/asm-arm ... make[1]: [kernel/bounds.s] 错误 127 Makefile:974: 目标 'prepare0' 的配方失败 make: [prepare0] 错误 2


我尝试使用这些命令安装 arm-eabi-gcc:
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa sudo apt-get 更新 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__) ... 主机脚本/mod/modpost

然后我将我的 gcc 版本降级到 gcc 版本 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__) !有人可以帮忙吗?

最佳答案

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

关于android - 如何构建 android 内核 goldfish 2.6.29 并在 qemu 上运行它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45264339/

相关文章:

c - 深度嵌套结构不好吗?

linux - TCP 流量生成器

linux - Linux 下Ada list 运行进程

android - 在 android 7 的通话录音中听不到来电?

java - Android 位置始终为空

c - 'less'程序源码中的不常用函数定义

linux - JasperReports 在 Linux 机器上失败

android - 特定组件类型的主题属性

android - 将 ImageView 调整为 TextView 的高度

无法通过套接字连接到 HTTP 服务 - C