ubuntu1604编译android5.1(android L)失败error: unsupportedreloc 43等问题
发布日期:2021-06-30 21:58:43 浏览次数:2 分类:技术文章

本文共 2676 字,大约阅读时间需要 8 分钟。

ubuntu1604编译android5.1(android L)失败error: unsupportedreloc 43等问题

 

1.    编译的问题

session_root1

prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6//x86_64-linux/bin/ld:error: out/host/linux-x86/obj32/SHARED_LIBRARIES/libsigchain_intermediates/sigchain_dummy.o:unsupported reloc 43 against global symbol std::cout

prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6//x86_64-linux/bin/ld:error:out/host/linux-x86/obj32/SHARED_LIBRARIES/libsigchain_intermediates/sigchain_dummy.o:unsupported reloc 43 against global symbol __dso_handle

prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6//x86_64-linux/bin/ld:error:out/host/linux-x86/obj32/SHARED_LIBRARIES/libsigchain_intermediates/sigchain_dummy.o:unsupported reloc 43 against global symbol std::ios_base::Init::~Init()

prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6//x86_64-linux/include/c++/4.6/ostream:515:error: unsupported reloc 43

prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6//x86_64-linux/include/c++/4.6/iostream:75:error: unsupported reloc 43

prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6//x86_64-linux/include/c++/4.6/iostream:75:error: unsupported reloc 43

clang: error: linker command failed withexit code 1 (use -v to see invocation)

build/core/host_shared_library_internal.mk:44:recipe for target 'out/host/linux-x86/obj32/lib/libsigchain.so' failed

make: ***[out/host/linux-x86/obj32/lib/libsigchain.so] Error 1

 

2.    解决过程的修改

(1)  修改art/build/Android.common_build.mk文件

ifneq ($(WITHOUT_HOST_CLANG),true)

改为:

ifeq ($(WITHOUT_HOST_CLANG),false)

修改方法:

sudo vi art/build/Android.common_build.mk

/WITHOUT_HOST_CLANG  #搜索该字符的位置

 

编译还是有问题,如下:

prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6//x86_64-linux/bin/ld:error:out/host/linux-x86/obj32/SHARED_LIBRARIES/libnativehelper_intermediates/JNIHelp.o:unsupported reloc 43 against global symbolstd::string::_Rep::_S_empty_rep_storage

libnativehelper/JniInvocation.cpp:165:error: unsupported reloc 43

clang: error: linker command failed withexit code 1 (use -v to see invocation)

build/core/host_shared_library_internal.mk:44:recipe for target 'out/host/linux-x86/obj32/lib/libnativehelper.so' failed

make: *** [out/host/linux-x86/obj32/lib/libnativehelper.so]Error 1

 

从报错信息来看,是在链接 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.

 

(2)  cp /usr/bin/ld.goldprebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/x86_64-linux/bin/ld

(3)  编译后提示make updat-api

执行make update-api后继续编译就正常了。

 

 

参考链接:

Ubuntu 16.04 编译Android6.0系统源码

Ubuntu 16.04 Android 5.1编译环境搭建记录

 

ubuntu16.04 64bit编译android5.1错误

 

Ubuntu16 编译源码出错unsupported reloc 43

 

转载地址:https://loongembedded.blog.csdn.net/article/details/79406726 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:安卓升级固件update.zip解析
下一篇:ubuntu1604安装openjdk-7-jdk提示Package openjdk-7-jdk is notavailable

发表评论

最新留言

不错!
[***.144.177.141]2024年04月16日 13时01分08秒