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://www.jb51.cc/article/p-zdsakhpj-bde.html

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

http://blog.csdn.net/a906754899/article/details/71522173

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

http://blog.csdn.net/u014770862/article/details/52624851

Ubuntu16 编译源码出错unsupported reloc 43

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

相关文章

1.安装过程出现0x00000000指令引用的0x00000000内存该内存不能为written 如果你安装的是inux系统 需要在...
写在全面:如果根据以下教程涉及到只读文件需要更改文件权限才能需修改文件内容,参考我的另一篇博客:...
写在前面:以下步骤中需要在终端输入命令,电脑端查看博客的朋友可以直接复制粘贴到终端,手机端查看的...
ubuntu16.04和18.04更换国内源 写在前面:安装好ubuntu双系统后,默认的软件更新源是国外的,在国内使用...
ubuntu双系统启动时卡死解决办法(在ubuntu16.04和18.04测试无误) 问题描述: 在安装完ubuntu双系统后...
又来造轮子了。。。。。。。。。。。。。。。。 今天使用w3af向文件中写入的时候,发现没有write权限,...