从源代码构建 Android:不支持的 reloc 43 [英] Building Android from sources: unsupported reloc 43

查看:36
本文介绍了从源代码构建 Android:不支持的 reloc 43的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我编译 Android 5.1.1 时,我收到了很多这样的错误:

When I'm compiling Android 5.1.1, I get dozens of errors like this:

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

并且 make 过程最终失败:

and the make process finally fails:

clang: error: linker command failed with exit 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

我尝试过使用和不使用 clang 以及不同版本的 clang 来构建源代码.但是在较新的分支上,clang 是必需的,没有它就无法启动.

I've tried building sources with and without clang, and with different versions of clang. But on newer branches, clang is a requirement and make doesn't start without it.

可能有什么问题?

推荐答案

应该应用这个补丁来让事情正常运行 https://android-review.googlesource.com/#/c/223100/

One should apply this patch to get the things working https://android-review.googlesource.com/#/c/223100/

使用一些编辑器在您的 android 源代码目录中打开 build/core/clang/HOST_x86_common.mk 文件,添加这些行,如本 链接

Open build/core/clang/HOST_x86_common.mk file in your android source code directory with some editor add these lines, as mentioned in this link

对于 Android Lollipop 或任何更早版本,请确保在应用此补丁时保留 -no-integrated-as.确保行的延续是正确的( 在每一行的末尾,除了最后一行).

For Android Lollipop or any earlier version, make sure to keep -no-integrated-as while applying this patch. Make sure the line continuations are proper( at the end of each line except the last line).

但是,-no-integrated-as 在 Marshmallow 中被删除了.

But, -no-integrated-as is removed in Marshmallow.

这篇关于从源代码构建 Android:不支持的 reloc 43的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆