Ubuntu18.04编译低版本Android注意事项

Ubuntu18.04编译低版本Android注意事项,第1张

Ubuntu18.04编译低版本Android注意事项 一、前言

Ubuntu18.04或者Ubuntu16.04编译AOSP源码时(Android5.0、Android6.0等版本),会报unsupported reloc 42、unsupported reloc 43等错误。在Ubuntu14.04上能够编译过。

二、修改方法 1. LC_ALL设置

在/etc/profile或者~/.bashrc中添加:

export LC_ALL=C
2. unsupported reloc 42错误
vim art/build/Android.common_build.mk

# Host.
ART_HOST_CLANG := false
ifneq ($(WITHOUT_HOST_CLANG),true)
  # By default, host builds use clang for better warnings.
  ART_HOST_CLANG := true
endif

改为

# Host.
ART_HOST_CLANG := false
ifeq ($(WITHOUT_HOST_CLANG),false)
  # By default, host builds use clang for better warnings.
  ART_HOST_CLANG := true
endif
3. unsupported reloc 43错误

注意,Android5.0和Android6.0不同,根据实际情况复制。

cp /usr/bin/ld.gold prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/x86_64-linux/bin/ld
三、其它

Android5.0和6.0不同,根据实际情况配置。

1. Android5.0情况

在Android5.0的编译中,修改过第二章节中的1、3部分。

2. Android6.0情况

在Android6.0的编译中,修改过第二章节中的1、2、3部分,并且第三部分的路径不同。
第三部分的路径:

prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8/x86_64-linux/bin/
prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/bin/

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5685620.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存