本文只是为了记录一次诡异的Android10编译错误,解决方法让人哭笑不得,降级Host的内核版本到5.19就好了。
环境配置:Ubuntu 22.04 Kernel 6.2.0-26
编译Docker: Ubuntu 18.04
Fatal signal 6 (SIGABRT), code -6 (SI_TKILL)
OS: Linux 6.2.0-26-generic (x86_64)
Cmdline: out/soong/host/linux-x86/bin/dex2oatd --avoid-storing-invocation --write-invocation-to=out/soong/gk6525v100/dex_bootjars/system/framework/arm/boot.invocation --runtime-arg -Xms64m --runtime-arg -Xmx64m --compiler-filter=speed-profile --profile-file=out/soong/gk6525v100/dex_bootjars/boot.prof --dirty-image-objects=frameworks/base/config/dirty-image-objects --dex-file=out/soong/gk6525v100/dex_bootjars_input/core-oj.jar --dex-file=out/soong/gk6525v100/dex_bootjars_input/core-libart.jar --dex-file=out/soong/gk6525v100/dex_bootjars_input/okhttp.jar --dex-file=out/soong/gk6525v100/dex_bootjars_input/bouncycastle.jar --dex-file=out/soong/gk6525v100/dex_bootjars_input/apache-xml.jar --dex-file=out/soong/gk6525v100/dex_bootjars_input/framework.jar --dex-file=out/soong/gk6525v100/dex_bootjars_input/ext.jar --dex-file=out/soong/gk6525v100/dex_bootjars_input/telephony-common.jar --dex-file=out/soong/gk6525v100/dex_bootjars_input/voip-common.jar --dex-file=out/soong/gk6525v100/dex_bootjars_input/ims-common.jar --dex-file=out/soong/gk6525v100/dex_bootjars_input/android.test.base.jar --dex-location=/apex/com.android.runtime/javalib/core-oj.jar --dex-location=/apex/com.android.runtime/javalib/core-libart.jar --dex-location=/apex/com.android.runtime/javalib/okhttp.jar --dex-location=/apex/com.android.runtime/javalib/bouncycastle.jar --dex-location=/apex/com.android.runtime/javalib/apache-xml.jar --dex-location=/system/framework/framework.jar --dex-location=/system/framework/ext.jar --dex-location=/system/framework/telephony-common.jar --dex-location=/system/framework/voip-common.jar --dex-location=/system/framework/ims-common.jar --dex-location=/system/framework/android.test.base.jar --generate-debug-info --generate-build-id --oat-symbols=out/soong/gk6525v100/dex_bootjars_unstripped/system/framework/arm/boot.oat --strip --oat-file=out/soong/gk6525v100/dex_bootjars/system/framework/arm/boot.oat --oat-location=out/soong/gk6525v100/dex_bootjars/system/framework/boot.oat --image=out/soong/gk6525v100/dex_bootjars/system/framework/arm/boot.art --base=0x70000000 --instruction-set=arm --instruction-set-variant=cortex-a73 --instruction-set-features=default --android-root=out/empty --no-inline-from=core-oj.jar --abort-on-hard-verifier-error --generate-mini-debug-info
最后报告的错误是
Fault message: Check failed: map.IsValid() Failed anonymous mmap((nil), 131072, 0x3, 0x22, -1, 0): Cannot allocate memory. See process maps in the log.
Aborted (core dumped)
ERROR: Dex2oat failed to compile a boot image.It is likely that the boot classpath is inconsistent.Rebuild with ART_BOOT_IMAGE_EXTRA_ARGS="--runtime-arg -verbose:verifier" to see verification errors.