编译 android rom 时错误: bison: cannot execute binary file: Exec format error

2016-03-19 09:24:29 +08:00
 woochun
系统: Ubuntu 14.04 x86_64

已安装组件:
bison build-essential curl flex git gnupg gperf libesd0-dev libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-7-jdk openjdk-7-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev maven

编译出现错误:
/bin/bash: prebuilts/misc/linux-x86/bison/bison: cannot execute binary file: Exec format error
make: *** [/root/cm/out/host/linux-x86/obj/EXECUTABLES/checkpolicy_intermediates/policy_parse.cpp] Error 126

看起来是 bison 的问题,谢了装装了卸,实在不知道如何解决。
有没有遇到过类似问题,求指教。
9354 次点击
所在节点    Android
5 条回复
pagxir
2016-03-19 11:43:11 +08:00
不是 bison 问题,是你系统的 32 位环境没安装好。
woochun
2016-03-19 14:51:14 +08:00
@pagxir 可以再详细点吗?一般要如何安装 32 位环境
pagxir
2016-03-19 15:48:05 +08:00
只能提供解决思路,就是把这个文件成功执行起 prebuilts/misc/linux-x86/bison/bison 。太详细的话,手机没法打字。
woochun
2016-03-19 16:28:50 +08:00
@pagxir 用 dpkg --print-foreign-architectures 检查没提示 i386 ,然后 sudo dpkg --add-architecture i386 启用但是还是不行。
wuhx
2016-03-20 15:05:54 +08:00
@woochun
apt-get install gcc-multilib

然后随便写个 helloworld.c
gcc -m32 helloworld.c -o hello
用 file hello 看一下是不是 32 位的程序

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/264656

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX