sonyxperiadev / local_manifests

44 stars 75 forks source link

make is failing at art/dex2oat #143

Closed kamsad closed 1 year ago

kamsad commented 1 year ago

Apologies in advance if this isn't the right place for this but I'm sure folks here know more about compiling kernels and resolving issues with it than I do and this is an attempt to install AOSP on my newly purchased Xperia 5 IV (toy).

While trying to compile images, I am running into the following and hoping someone would get me past this (I have 32G RAM, 30G swap and 6 cores. Tried running make with less/more j values, same result):

[ 96% 165415/172005] //art/build/boot:art-bootclasspath-fragment dexpreopt art jars arm64 [common apex31] FAILED: out/soong/pdx224/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-apache-xml.art out/soong/pdx224/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-apache-xml.oat out /soong/pdx224/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-apache-xml.vdex out/soong/pdx224/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-bouncycastle.art out/soong/p dx224/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-bouncycastle.oat out/soong/pdx224/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-bouncycastle.vdex out/soong/pdx224/ dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-core-libart.art out/soong/pdx224/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-core-libart.oat out/soong/pdx224/dex_artja rs/android/apex/art_boot_images/javalib/arm64/boot-core-libart.vdex out/soong/pdx224/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-okhttp.art out/soong/pdx224/dex_artjars/android/ap ex/art_boot_images/javalib/arm64/boot-okhttp.oat out/soong/pdx224/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot-okhttp.vdex out/soong/pdx224/dex_artjars/android/apex/art_boot_images /javalib/arm64/boot.art out/soong/pdx224/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.invocation out/soong/pdx224/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.oat ou t/soong/pdx224/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.vdex out/soong/pdx224/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm64/boot-apache-xml.oat out/soong/pd x224/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm64/boot-bouncycastle.oat out/soong/pdx224/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm64/boot-core-libart.oa t out/soong/pdx224/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm64/boot-okhttp.oat out/soong/pdx224/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm64/boot.oat mkdir -p out/soong/pdx224/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm64 && rm -f out/soong/pdx224/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm64/*.art out/s oong/pdx224/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm64/*.oat out/soong/pdx224/dex_artjars_unstripped/android/apex/art_boot_images/javalib/arm64/*.invocation && rm -f out/so ong/pdx224/dex_artjars/android/apex/art_boot_images/javalib/arm64/*.art out/soong/pdx224/dex_artjars/android/apex/art_boot_images/javalib/arm64/*.oat out/soong/pdx224/dex_artjars/android/apex/art _boot_images/javalib/arm64/*.invocation && ANDROID_LOG_TAGS="*:e" out/host/linux-x86/bin/dex2oatd --avoid-storing-invocation --write-invocation-to=out/soong/pdx224/dex_artjars/android/apex/art_bo ot_images/javalib/arm64/boot.invocation --runtime-arg -Xms64m --runtime-arg -Xmx64m --profile-file=out/soong/pdx224/dex_artjars/boot.prof --dirty-image-objects=frameworks/base/config/dirty-image- objects --base=0x70000000 --preloaded-classes=art/build/boot/preloaded-classes --dex-file=out/soong/pdx224/dex_artjars_input/core-oj.jar --dex-file=out/soong/pdx224/dex_artjars_input/core-libart. jar --dex-file=out/soong/pdx224/dex_artjars_input/okhttp.jar --dex-file=out/soong/pdx224/dex_artjars_input/bouncycastle.jar --dex-file=out/soong/pdx224/dex_artjars_input/apache-xml.jar --dex-loca tion=/apex/com.android.art/javalib/core-oj.jar --dex-location=/apex/com.android.art/javalib/core-libart.jar --dex-location=/apex/com.android.art/javalib/okhttp.jar --dex-location=/apex/com.androi d.art/javalib/bouncycastle.jar --dex-location=/apex/com.android.art/javalib/apache-xml.jar --generate-debug-info --generate-build-id --image-format=lz4hc --oat-symbols=out/soong/pdx224/dex_artjar s_unstripped/android/apex/art_boot_images/javalib/arm64/boot.oat --strip --oat-file=out/soong/pdx224/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.oat --oat-location=out/soong/pdx22 4/dex_artjars/android/apex/art_boot_images/javalib/boot.oat --image=out/soong/pdx224/dex_artjars/android/apex/art_boot_images/javalib/arm64/boot.art --instruction-set=arm64 --android-root=out/emp ty --no-inline-from=core-oj.jar --force-determinism --abort-on-hard-verifier-error --instruction-set-variant=generic --instruction-set-features=default --generate-mini-debug-info || ( echo '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.' ; false ) # hash of input list: cf460054946cd423650600d99a0cde8db79bc565721cf5317d4d52776b603d26 dex2oatd F 06-15 11:23:42 1042903 1042903 mem_map_arena_pool.cc:65] Check failed: map.IsValid() Failed anonymous mmap((nil), 131072, 0x3, 0x22, -1, 0): Cannot allocate memory. See process maps in the log. dex2oatd E 06-15 11:23:42 1042903 1042903 thread-inl.h:170] holding "DexCache lock" at point where thread suspension is expected dex2oatd E 06-15 11:23:42 1042903 1042903 thread-inl.h:170] holding "linear alloc" at point where thread suspension is expected dex2oatd E 06-15 11:23:42 1042903 1042903 mutex-inl.h:141] Lock level violation: holding "DexCache lock" (level DexCacheLock - 46) while locking "mutator lock" (level MutatorLock - 72) dex2oatd E 06-15 11:23:42 1042903 1042903 mutex-inl.h:141] Lock level violation: holding "linear alloc" (level DefaultMutexLevel - 45) while locking "mutator lock" (level MutatorLock - 72) Runtime aborting... All threads:

MartinX3 commented 1 year ago

Please update the linux kernel of your build machine.

kamsad commented 1 year ago

$ uname -a Linux milnx 6.1.0-9-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.27-1 (2023-05-08) x86_64 GNU/Linux

MartinX3 commented 1 year ago

I said update, not showing me your outdated kernel version.

kamsad commented 1 year ago

lol. Didn't know debian testing would be considered outdated?

isn't the recommendation to do this on an Ubuntu 18? And the Sony Open Device documents seem to be using that version in instructions? I am confused, why is it a kernel version issue?

Can you recommend a linux flavor that should be used (Arch?) to successfully compile this? Has anyone done, can they share their platform into? Including Java revisions etc?

HidingCherry commented 1 year ago

What my autistic friend tries to say - you are probably using a kernel which has a bug causing your issue. Try another kernel version or update your kernel or request your kernel maintainer to update the kernel.

MartinX3 commented 1 year ago

lol. Didn't know debian testing would be considered outdated?

isn't the recommendation to do this on an Ubuntu 18? And the Sony Open Device documents seem to be using that version in instructions? I am confused, why is it a kernel version issue?

Can you recommend a linux flavor that should be used (Arch?) to successfully compile this? Has anyone done, can they share their platform into? Including Java revisions etc?

You use debian while ubuntu is recommended?

Also compare your outdated kernel version with the newest 6.1.x at https://kernel.org

kamsad commented 1 year ago

Thank you @MartinX3 and @Loader009 for helping me through this (certainly not a process to go through for faint-hearted).

Kernel is compiling now under Ubuntu 18. Unfortunately, without ./repo_update.sh (because I get 'no tracking information' git error). Wanting it to complete successfully for platform verification.

MartinX3 commented 1 year ago

@kamsad you're wellcome

Please share your ./repo_update.sh error with us or search it in the bug tracker. :) (I don't get an error, just the new june update won't compile for me)

kamsad commented 1 year ago

compile breaks with file missing error:

56% 98163/173219] //vendor/qcom/opensource/data-ipacfg-mgr/ipacm:ipacm clang++ src/IPACM_Main.cpp
FAILED: out/soong/.intermediates/vendor/qcom/opensource/data-ipacfg-mgr/ipacm/ipacm/android_vendor.33_arm64_armv8-2a/obj/vendor/qcom/opensource/data-ipacfg-mgr/ipacm/src/IPACM
_Main.o
PWD=/proc/self/cwd prebuilts/clang/host/linux-x86/clang-r450784d/bin/clang++ -c -D__ANDROID_VNDK__ -D__ANDROID_VENDOR__  -Werror=implicit-function-declaration -DANDROID -fmess
age-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Wunreachable-code-loop-increment -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -
fdebug-default-version=5 -fno-strict-aliasing -Werror=date-time -Werror=pragma-pack -Werror=pragma-pack-suspicious-include -Werror=string-plus-int -Werror=unreachable-code-loo
p-increment -D__compiler_offsetof=__builtin_offsetof -faddrsig -fcommon -Werror=int-conversion -fexperimental-new-pass-manager -Wno-reserved-id-macro -fcolor-diagnostics -Wno-
sign-compare -Wno-defaulted-function-deleted -Wno-inconsistent-missing-override -Wno-c99-designator -Wno-gnu-designator -Wno-gnu-folding-constant -Wunguarded-availability -D__
ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__ -ffp-contract=off -fdebug-prefix-map=/proc/self/cwd= -ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-
removed-from-clang -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Wer
ror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=format-security -nostdlibinc -fdebug-info-for-profiling -Wno-enum-compare -Wno-enum-com
pare-switch -Wno-null-pointer-arithmetic -Wno-null-dereference -Wno-pointer-compare -Wno-xor-used-as-pow -Wno-final-dtor-non-final-class -Wno-psabi -Wno-null-pointer-subtracti
on -Wno-string-concatenation -march=armv8.2-a  -target aarch64-linux-android33 -DANDROID_STRICT -fPIE -Wsign-promo -Wimplicit-fallthrough -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTA
TIONS -Wno-gnu-include-next -fvisibility-inlines-hidden  -Ivendor/qcom/opensource/data-ipacfg-mgr/ipacm/src -Ivendor/qcom/opensource/data-ipacfg-mgr/ipacm/inc -Ivendor/qcom/op
ensource/data-ipacfg-mgr/ipacm -Ikernel/sony/msm-5.10/common-headers/kernel-headers -Iexternal/libcxxabi/include -Ivendor/qcom/opensource/data-ipacfg-mgr/hal/inc -Ivendor/qcom
/opensource/data-ipacfg-mgr/ipanat/inc -Iexternal/libxml2/include -Iexternal/libnfnetlink/include -Iexternal/libnetfilter_conntrack/include -Isystem/libhidl/base/include -Isys
tem/libhidl/transport/include -Isystem/libfmq/base -Isystem/libhwbinder/include -Isystem/libbase/include -Iexternal/fmtlib/include -Isystem/core/libutils/include -Isystem/unwi
nding/libbacktrace/include -Isystem/core/libcutils/include_outside_system -Isystem/logging/liblog/include_vndk -Isystem/core/libprocessgroup/include -Isystem/core/libsystem/in
clude -Isystem/core/libcutils/include -Iout/soong/.intermediates/system/libhidl/transport/manager/1.0/android.hidl.manager@1.0_genc++_headers/gen -Iout/soong/.intermediates/sy
stem/libhidl/transport/manager/1.1/android.hidl.manager@1.1_genc++_headers/gen -Iout/soong/.intermediates/system/libhidl/transport/manager/1.2/android.hidl.manager@1.2_genc++_
headers/gen -Iout/soong/.intermediates/system/libhidl/transport/base/1.0/android.hidl.base@1.0_genc++_headers/gen -Ihardware/libhardware_legacy/include -Ihardware/libhardware/
include -Isystem/media/audio/include -Ipackages/modules/Bluetooth/system/types -Iout/soong/.intermediates/hardware/interfaces/tetheroffload/config/1.0/android.hardware.tethero
ffload.config@1.0_genc++_headers/gen -Iout/soong/.intermediates/hardware/interfaces/tetheroffload/control/1.0/android.hardware.tetheroffload.control@1.0_genc++_headers/gen -Ie
xternal/libcxx/include -isystem out/soong/.intermediates/bionic/libc/libc/android_vendor.33_arm64_armv8-2a_shared/gen/include -isystem bionic/libc/kernel/uapi/asm-arm64 -isyst
em bionic/libc/kernel/uapi -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -DFEATURE_IPA_ANDROID -DFEATURE_IPACM_RESTART -DFEATURE_IPACM_HAL 
-DDEBUG -Wall -Werror -Wno-error=macro-redefined -DDO_NOT_CHECK_MANUAL_BINDER_INTERFACES -std=gnu++17 -fno-rtti  -Werror=bool-operation -Werror=implicit-int-float-conversion -
Werror=int-in-bool-context -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=string-compare -Werror=xor-used-as-pow -Wno-void-pointer-to-enum-cast -Wno-void-poin
ter-to-int-cast -Wno-pointer-to-int-cast -Werror=fortify-source -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-tautological-type-limi
t-compare -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-sizeof-array-div -Wno-tautological-overlap-compare -Wno-deprecated-copy -Wno-range-loop-construct -Wno
-misleading-indentation -Wno-zero-as-null-pointer-constant -Wno-deprecated-anon-enum-enum-conversion -Wno-string-compare -Wno-pessimizing-move -Wno-non-c-typedef-for-linkage -
Wno-align-mismatch -Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter -Wno-unused-but-set-variable -Wno-unused-but-set-parameter -Wno-bitwise-instead-of-lo
gical -MD -MF out/soong/.intermediates/vendor/qcom/opensource/data-ipacfg-mgr/ipacm/ipacm/android_vendor.33_arm64_armv8-2a/obj/vendor/qcom/opensource/data-ipacfg-mgr/ipacm/src
/IPACM_Main.o.d -o out/soong/.intermediates/vendor/qcom/opensource/data-ipacfg-mgr/ipacm/ipacm/android_vendor.33_arm64_armv8-2a/obj/vendor/qcom/opensource/data-ipacfg-mgr/ipac
m/src/IPACM_Main.o vendor/qcom/opensource/data-ipacfg-mgr/ipacm/src/IPACM_Main.cpp
In file included from vendor/qcom/opensource/data-ipacfg-mgr/ipacm/src/IPACM_Main.cpp:70:
vendor/qcom/opensource/data-ipacfg-mgr/ipacm/inc/IPACM_Netlink.h:55:10: fatal error: 'inaddr.h' file not found
#include <inaddr.h>
         ^~~~~~~~~~
1 error generated.
18:50:39 ninja failed with: exit status 1

#### failed to build some targets (02:39:43 (hh:mm:ss)) ####

And repo_update.sh error:

./repo_update.sh 
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> android-13.0.0_r34
MartinX3 commented 1 year ago

You pulled everything with the repo tool without modifying anything? (I did the same and the repo tool works)

According to google the inaddr.h is part of the windows sdk or wine.

kamsad commented 1 year ago

@MartinX3 I will try doing a repo sync again tonight. Found some google found suggestions to fix repo_update issue but they all talk about 'git' rather than 'repo' so I am unsure which one might work for me.

MartinX3 commented 1 year ago

@kamsad I hope it works now for you as well. :)

There is a repo forall -vc "git reset --hard"

kamsad commented 1 year ago

The following worked and make built successfully:

However...

jerpelea commented 1 year ago

please use the same branch for local_manifest and Android Thanks Alin