V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
woochun
V2EX  ›  Android

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

  •  
  •   woochun · 2016-03-19 09:24:29 +08:00 · 9088 次点击
    这是一个创建于 2961 天前的主题,其中的信息可能已经有所发展或是发生改变。
    系统: 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 的问题,谢了装装了卸,实在不知道如何解决。
    有没有遇到过类似问题,求指教。
    5 条回复    2016-03-20 15:05:54 +08:00
    pagxir
        1
    pagxir  
       2016-03-19 11:43:11 +08:00 via Android
    不是 bison 问题,是你系统的 32 位环境没安装好。
    woochun
        2
    woochun  
    OP
       2016-03-19 14:51:14 +08:00
    @pagxir 可以再详细点吗?一般要如何安装 32 位环境
    pagxir
        3
    pagxir  
       2016-03-19 15:48:05 +08:00 via Android
    只能提供解决思路,就是把这个文件成功执行起 prebuilts/misc/linux-x86/bison/bison 。太详细的话,手机没法打字。
    woochun
        4
    woochun  
    OP
       2016-03-19 16:28:50 +08:00
    @pagxir 用 dpkg --print-foreign-architectures 检查没提示 i386 ,然后 sudo dpkg --add-architecture i386 启用但是还是不行。
    wuhx
        5
    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 位的程序
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1059 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 18:28 · PVG 02:28 · LAX 11:28 · JFK 14:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.