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 是必然的事情,因此非常期待贵司的解答,谢谢!
网站声明:如果转载,请联系本站管理员。否则一切后果自行承担。
赞同 0
反对 0