ubuntu16.04 编译Android5.1报错


花痴等于睫毛膏
花痴等于睫毛膏 2022-10-08 10:42:55 47843
分类专栏: 资讯
hi kylin team,
    我使用 ubuntu16.04 构建 android 编译环境后编译 android5.1 时出现如下报错。请向开发团队反馈看能否给出解决方案,谢谢!

当我使用 ubuntu16.04 构建 Android 编译环境后, 编译报错. 报错信息如下:
/home/.../proj/.../anroidsrcroot/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/../lib/gcc/x86_64-linux/4.6/../../../../x86_64-linux/bin/ld: error: out/host/linux-x86/obj32/STATIC_LIBRARIES/libcompiler_rt_intermediates/libcompiler_rt.a(eprintf.o): unsupported reloc 43 against global symbol stderr
external/compiler-rt/lib/builtins/eprintf.c:32: error: unsupported reloc 43
collect2: ld returned 1 exit status
host C++: libnativehelper_32 <= libnativehelper/JNIHelp.cpp
make: *** [out/host/linux-x86/obj32/lib/libcompiler_rt.so] Error 1
make: *** 正在等待未完成的任务....

请问如何解决该报错? 我确认编译环境安装 OK, 下面是 ubuntu16.04 上安装工具的版本信息:
root@... :~ sudo apt-get install git gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dri:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 dpkg-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
bison is already the newest version (2:3.0.4.dfsg-1).
build-essential is already the newest version (12.1ubuntu2).
curl is already the newest version (7.47.0-1ubuntu2).
dpkg-dev is already the newest version (1.18.4ubuntu1).
flex is already the newest version (2.6.0-11).
g++-multilib is already the newest version (4:5.3.1-1ubuntu1).
git is already the newest version (1:2.7.4-0ubuntu1).
gnupg is already the newest version (1.4.20-1ubuntu3).
libc6-dev is already the newest version (2.23-0ubuntu3).
libgl1-mesa-dev is already the newest version (11.2.0-1ubuntu2).
libxml2-utils is already the newest version (2.9.3+dfsg1-1).
x11proto-core-dev is already the newest version (7.0.28-2ubuntu1).
xsltproc is already the newest version (1.1.28-2.1).
zip is already the newest version (3.0-11).
libgl1-mesa-dri:i386 is already the newest version (11.2.0-1ubuntu2).
libncurses5-dev:i386 is already the newest version (6.0+20160213-1ubuntu1).
libreadline6-dev:i386 is already the newest version (6.3-8ubuntu2).
libx11-dev:i386 is already the newest version (2:1.6.3-1ubuntu2).
zlib1g-dev:i386 is already the newest version (1:1.2.8.dfsg-2ubuntu4).
gperf is already the newest version (3.0.4-2).
python-markdown is already the newest version (2.6.6-1).
tofrodos is already the newest version (1.7.13+ds-2ubuntu1).
mingw32 is already the newest version (4.2.1.dfsg-2ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

宿主机环境 binutils 版本信息:
root@...:~ apt-get install binutils
Reading package lists... Done
Building dependency tree
Reading state information... Done
binutils is already the newest version (2.26-8ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
root@...:~ objdump -v
GNU objdump (GNU Binutils for Ubuntu) 2.26
Copyright (C) 2015 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.

宿主机环境 gcc 版本信息:
root@...:~ gcc --version
gcc (Ubuntu 5.3.1-14ubuntu2) 5.3.1 20160413
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

从报错信息来看,是在链接 host 程序时出错。链接 host 程序时用的工具链是放在 codebase 中的,即 prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/../lib/gcc/x86_64-linux/4.6/../../../../x86_64-linux/bin/ld.
1. 搞不明白,既然工具链在 codebase 中,也就不应该依赖宿主机 gcc 和 binutils, 就算我宿主机 gcc 和 binutils 版本较高,也不应该报此错误?
2. 请问如何解决此错误?降级宿主机 binutils 版本吗?
3. 在 ubuntu16.04 上编译贵司代码时,我还曾遇见另一个错误由 make 报出,即 ***recipe commence before first target, 查看 make 版本是 4.1, 后来重新覆盖安装 make 3.81 解决。

长期来看编译环境迁移到 ubuntu16.04 LTS 是必然的事情,因此非常期待贵司的解答,谢谢!

网站声明:如果转载,请联系本站管理员。否则一切后果自行承担。

本文链接:https://www.xckfsq.com/news/show.html?id=17357
赞同 0
评论 0 条
花痴等于睫毛膏L0
粉丝 0 发表 17 + 关注 私信
上周热门
如何使用 StarRocks 管理和优化数据湖中的数据?  2947
【软件正版化】软件正版化工作要点  2867
统信UOS试玩黑神话:悟空  2828
信刻光盘安全隔离与信息交换系统  2723
镜舟科技与中启乘数科技达成战略合作,共筑数据服务新生态  1256
grub引导程序无法找到指定设备和分区  1221
华为全联接大会2024丨软通动力分论坛精彩议程抢先看!  164
点击报名 | 京东2025校招进校行程预告  163
2024海洋能源产业融合发展论坛暨博览会同期活动-海洋能源与数字化智能化论坛成功举办  162
华为纯血鸿蒙正式版9月底见!但Mate 70的内情还得接着挖...  157
本周热议
我的信创开放社区兼职赚钱历程 40
今天你签到了吗? 27
如何玩转信创开放社区—从小白进阶到专家 15
信创开放社区邀请他人注册的具体步骤如下 15
方德桌面操作系统 14
用抖音玩法闯信创开放社区——用平台宣传企业产品服务 13
我有15积分有什么用? 13
如何让你先人一步获得悬赏问题信息?(创作者必看) 12
2024中国信创产业发展大会暨中国信息科技创新与应用博览会 9
中央国家机关政府采购中心:应当将CPU、操作系统符合安全可靠测评要求纳入采购需求 8

加入交流群

请使用微信扫一扫!