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

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后继续编译就正常了。

 

 

参考链接:

https://stackoverflow.com/questions/36048358/building-android-from-sources-unsupported-reloc-43

Ubuntu 16.04 编译Android6.0系统源码

http://blog.youkuaiyun.com/ForeverSunshine/article/details/53256365

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

http://blog.youkuaiyun.com/a906754899/article/details/71522173

 

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

http://blog.youkuaiyun.com/u014770862/article/details/52624851

 

Ubuntu16 编译源码出错unsupported reloc 43

https://www.cnblogs.com/blowing-in-the-wind/p/6518076.html

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

loongembedded

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值