编译Android 11出现错误

Which version of system do you use? Khadas official images, self built images, or others?

`vim4, Android11,自己编译image

Please describe your issue below:

`VIM4 Download Android Source Code [Khadas Docs]
根据官方教程下载了安卓源码,代码sync success
然后依次编译了uboot 和 kernel,并且编译通过
但是编译安卓就出错了。
我还有一个疑惑


图片红线部分字面意思是vim4不能同时编译kernel 和Android
我有两种理解:
1.指vim4 不能同一时刻并行编译kernel和Android
2.指vim4 编译了kerne通过l后,那就不能编译通过Android,或者编译了Android通过后,就不能编译通过kernel(这是目前的我碰到的现象)
希望帮助我看一下这个问题,谢谢

Post a console log of your issue below:

[ 54% 29120/53574] //vendor/amlogic/common/external/libzvbi_src:libzvbi link libzvbi.so
FAILED: out/soong/.intermediates/vendor/amlogic/common/external/libzvbi_src/libzvbi/android_vendor.30_arm64_ar
mv8-a_shared/unstripped/libzvbi.so
prebuilts/clang/host/linux-x86/clang-r383902b1/bin/clang++ out/soong/.intermediates/bionic/libc/crtbegin_so/an
droid_vendor.30_arm64_armv8-a/crtbegin_so.o @out/soong/.intermediates/vendor/amlogic/common/external/libzvbi_s
rc/libzvbi/android_vendor.30_arm64_armv8-a_shared/unstripped/libzvbi.so.rsp -Wl,--whole-archive  out/soong/.in
termediates/vendor/amlogic/common/external/libzvbi_src/libzvbi_static/android_vendor.30_arm64_armv8-a_static/l
ibzvbi_static.a -Wl,--no-whole-archive  vendor/amlogic/common/prebuilt/icu/lib64/libicui18n_product.a vendor/a
mlogic/common/prebuilt/icu/lib64/libicuuc_stubdata_product.a out/soong/.intermediates/vendor/amlogic/common/ex
ternal/dvb/am_adp/libam_adp_static/android_vendor.30_arm64_armv8-a_static/libam_adp_static.a out/soong/.interm
ediates/external/libcxxabi/libc++demangle/android_vendor.30_arm64_armv8-a_static/libc++demangle.a prebuilts/cl
ang/host/linux-x86/clang-r383902b1/lib64/clang/11.0.2/lib/linux/libclang_rt.builtins-aarch64-android.a prebuil
ts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/lib64/libatomic.a out/soong/.intermed
iates/system/core/liblog/liblog.llndk/android_vendor.30_arm64_armv8-a_shared/liblog.so out/soong/.intermediate
s/external/libcxx/libc++/android_vendor.30_arm64_armv8-a_shared/libc++.so out/soong/.intermediates/bionic/libc
/libc.llndk/android_vendor.30_arm64_armv8-a_shared/libc.so out/soong/.intermediates/bionic/libm/libm.llndk/and
roid_vendor.30_arm64_armv8-a_shared/libm.so out/soong/.intermediates/bionic/libdl/libdl.llndk/android_vendor.3
0_arm64_armv8-a_shared/libdl.so out/soong/.intermediates/bionic/libc/crtend_so/android_vendor.30_arm64_armv8-a
/obj/bionic/libc/arch-common/bionic/crtend_so.o -o out/soong/.intermediates/vendor/amlogic/common/external/lib
zvbi_src/libzvbi/android_vendor.30_arm64_armv8-a_shared/unstripped/libzvbi.so -target aarch64-linux-android30 
-Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin -Wl,-z,noexecstack -Wl,-
z,relro -Wl,-z,now -Wl,--build-id=md5 -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined-versio
n -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_stripped.a -Wl,--exclude-libs,libunwind_llvm.a -fuse-l
d=lld -Wl,--pack-dyn-relocs=android+relr -Wl,--use-android-relr-tags -Wl,--no-undefined -Wl,--hash-style=gnu -
Wl,-z,separate-code -Wl,--icf=safe -Wl,-z,max-page-size=4096  -Wl,--exclude-libs=libclang_rt.builtins-aarch64-
android.a  -nostdlib -Wl,--gc-sections -shared -Wl,-soname,libzvbi.so  
ld.lld: error: vendor/amlogic/common/prebuilt/icu/lib64/libicuuc_stubdata_product.a:1: unknown directive: vers
ion
>>> version https://git-lfs.github.com/spec/v1
>>> ^
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
[ 54% 29125/53574] depmod out/target/product/kvim4/obj/PACKAGING/depmod_VENDOR_intermediates
depmod: WARNING: could not open modules.order at /home/jojo/work/sdk/amlogic/vim4/out/target/product/kvim4/obj
/PACKAGING/depmod_VENDOR_intermediates/lib/modules/0.0: No such file or directory
depmod: WARNING: could not open modules.builtin at /home/jojo/work/sdk/amlogic/vim4/out/target/product/kvim4/o
bj/PACKAGING/depmod_VENDOR_intermediates/lib/modules/0.0: No such file or directory
10:19:30 ninja failed with: exit status 1

#### failed to build some targets (04:04 (mm:ss)) ####


就是字面意思。即不像VIM3那样,当编译android时,会同时把linux kernel代码一起去编译。

执行下面命令看看:

vim4/vendor/amlogic/common$ git lfs ls-files
0a889e1698 * external/SkiaPort/libskia.a
c2a9b64923 * external/SkiaPort/libwebp-decode.a
4d037cd1c8 * external/SkiaPort/libwebp-encode.a
2301fabd73 * prebuilt/icu/lib/libicui18n_product.a
e91eeb4728 * prebuilt/icu/lib/libicuuc_product.a
bbc36f02a8 * prebuilt/icu/lib/libicuuc_stubdata_product.a
e91eeb4728 * prebuilt/icu/lib/libicuuc_vendor.a
747212d86a * prebuilt/icu/lib64/libicui18n_product.a
9594e713d4 * prebuilt/icu/lib64/libicuuc_product.a
e243dda230 * prebuilt/icu/lib64/libicuuc_stubdata_product.a
9594e713d4 * prebuilt/icu/lib64/libicuuc_vendor.a
vim4/vendor/amlogic/common$
vim4/vendor/amlogic/common$ git lfs version
git-lfs/2.3.4 (GitHub; linux amd64; go 1.9.1; git d2f6752f)

解决了,猜测是repo sync不完整的问题,虽然每次都显示成功了,但是代码还是不完整。我repo sync了十多次然后再编译就通过了。
还有个小建议:vim4的sdk源码稳定版也许可以搞一份百度云下载,这样可以避免代码不完整问题

1 Like