podman run -d -it --name local-ubuntu-dev -v /home/$USER:/home/$USER ubuntu podman exec -it local-ubuntu-dev /bin/bash ```shell # --userns=keep-id -e WAYLAND_DISPLAY podman run -d -it --userns=keep-id -e USER --net=host \ -e DISPLAY -e XDG_RUNTIME_DIR -e XAUTHORITY -v /tmp/.X11-unix:/tmp/.X11-unix -v $XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR -v "$HOME/.Xauthority:/home/ubuntu/.Xauthority:ro" -p 6000:6000 \ -e PULSE_SERVER=unix:/run/user/$(id -u)/pulse/native --device /dev/snd:/dev/snd -v /run/user/$(id -u)/pulse:/run/user/$(id -u)/pulse \ -v /home/$USER:/home/$USER --name nb_qemu-build-install localhost/nb_qemu-build-install podman exec -it nb_qemu-build-install /bin/bash cd /home/chiu/android_project/atl_test_apks ATL_DIRECT_EGL=1 ANDROID_APP_DATA_DIR=. android-translation-layer sample_unity_app.apk ANDROID_APP_DATA_DIR=. android-translation-layer demo_app.apk NB_QEMU_SYSROOT=/usr/local/share/libnb-qemu-guest/ ATL_DIRECT_EGL=1 ANDROID_APP_DATA_DIR=. LD_LIBRARY_PATH=/usr/local/lib/art/ \ android-translation-layer com.rovio.angrybirds_8.0.3-22680302_minAPI16\(armeabi-v7a\,x86\)\(nodpi\)_apkmirror.com.apk \ -X '-Xforce-nb-testing' -X '-XX:NativeBridge=/usr/local/lib64/libnb-qemu.so' podman stop -t 1 nb_qemu-build-install && podman rm nb_qemu-build-install podman commit nb_qemu-build-install # wcp -r /usr/local/lib/x86_64-linux-gnu/java/dex/android_translation_layer /usr/local/lib/java/dex/ ``` #### `podman commit local-ubuntu-dev android_translation_layer-dependencies` ```bash sudo apt install -y build-essential libasound2-dev libavcodec-dev libcap-dev libdrm-dev libglib2.0-dev libgtk-4-dev libgudev-1.0-dev libopenxr-dev libportal-dev libsqlite3-dev libwebkitgtk-6.0-dev libvulkan-dev libavformat-dev libavutil-dev libswscale-dev libavfilter-dev libavdevice-dev libpostproc-dev ``` ``` git clone https://github.com/wolfSSL/wolfssl.git cd wolfssl git checkout v5.8.2-stable autoreconf -i ./configure --enable-shared --disable-opensslall --disable-opensslextra --enable-aescbc-length-checks --enable-curve25519 --enable-ed25519 --enable-ed25519-stream --enable-oldtls --enable-base64encode --enable-tlsx --enable-scrypt --disable-examples --enable-crl --with-rsa --enable-certs --enable-sessioncerts --enable-encrypted-keys --enable-cert-gen --enable-cert-ext --enable-clr-monitor --enable-jni make -j12 sudo make install git clone https://github.com/libunwind/libunwind.git cd libunwind autoreconf -i # Needed only for building from git. Depends on libtool. ./configure --prefix=/usr/local make -j12 sudo make install git clone https://gitlab.com/android_translation_layer/bionic_translation.git cd bionic_translation meson setup builddir cd builddir meson configure -Dlibdir=lib meson compile sudo meson install git clone https://gitlab.com/android_translation_layer/art_standalone.git cd art_standalone make -j12 ____LIBDIR=lib sudo make ____LIBDIR=lib install git clone https://gitlab.com/android_translation_layer/libopensles-standalone.git cd libopensles-standalone meson setup builddir cd builddir meson configure -Dlibdir=lib meson compile sudo meson install git clone https://gitlab.com/android_translation_layer/android_translation_layer.git cd android_translation_layer meson setup builddir cd builddir meson configure -Dlibdir=lib meson compile sudo meson install ``` #### `podman commit local-ubuntu-dev wolfssl-build-install` ```bash sudo apt install -y autoconf libtool git clone https://github.com/wolfSSL/wolfssl.git cd wolfssl git checkout v5.8.2-stable autoreconf -i ./configure --enable-shared --disable-opensslall --disable-opensslextra --enable-aescbc-length-checks --enable-curve25519 --enable-ed25519 --enable-ed25519-stream --enable-oldtls --enable-base64encode --enable-tlsx --enable-scrypt --disable-examples --enable-crl --enable-jni --enable-sessioncerts make -j12 sudo make install ``` #### `podman commit local-ubuntu-dev libunwind-build-install` ```bash git clone https://github.com/libunwind/libunwind.git cd libunwind autoreconf -i # Needed only for building from git. Depends on libtool. ./configure --prefix=/usr/local make -j12 sudo make install ``` Output: ``` libtool: install: /usr/bin/install -c .libs/test-proc-info /usr/local/libexec/libunwind/test-proc-info libtool: install: /usr/bin/install -c test-static-link /usr/local/libexec/libunwind/test-static-link libtool: install: /usr/bin/install -c .libs/test-strerror /usr/local/libexec/libunwind/test-strerror libtool: install: /usr/bin/install -c .libs/Gtest-bt /usr/local/libexec/libunwind/Gtest-bt libtool: install: /usr/bin/install -c .libs/Ltest-bt /usr/local/libexec/libunwind/Ltest-bt libtool: install: /usr/bin/install -c .libs/Gtest-init /usr/local/libexec/libunwind/Gtest-init libtool: install: /usr/bin/install -c .libs/Ltest-init /usr/local/libexec/libunwind/Ltest-init libtool: install: /usr/bin/install -c .libs/Gtest-concurrent /usr/local/libexec/libunwind/Gtest-concurrent libtool: install: /usr/bin/install -c .libs/Ltest-concurrent /usr/local/libexec/libunwind/Ltest-concurrent libtool: install: /usr/bin/install -c .libs/Gtest-sig-context /usr/local/libexec/libunwind/Gtest-sig-context libtool: install: /usr/bin/install -c .libs/Ltest-sig-context /usr/local/libexec/libunwind/Ltest-sig-context libtool: install: /usr/bin/install -c .libs/Gtest-trace /usr/local/libexec/libunwind/Gtest-trace libtool: install: /usr/bin/install -c .libs/Ltest-trace /usr/local/libexec/libunwind/Ltest-trace libtool: install: /usr/bin/install -c .libs/test-async-sig /usr/local/libexec/libunwind/test-async-sig libtool: install: /usr/bin/install -c .libs/test-flush-cache /usr/local/libexec/libunwind/test-flush-cache libtool: install: /usr/bin/install -c .libs/test-init-remote /usr/local/libexec/libunwind/test-init-remote libtool: install: /usr/bin/install -c .libs/test-mem /usr/local/libexec/libunwind/test-mem libtool: install: /usr/bin/install -c .libs/test-reg-state /usr/local/libexec/libunwind/test-reg-state libtool: install: /usr/bin/install -c .libs/Ltest-varargs /usr/local/libexec/libunwind/Ltest-varargs libtool: install: /usr/bin/install -c .libs/Ltest-nomalloc /usr/local/libexec/libunwind/Ltest-nomalloc libtool: install: /usr/bin/install -c .libs/Ltest-nocalloc /usr/local/libexec/libunwind/Ltest-nocalloc libtool: install: /usr/bin/install -c .libs/Lrs-race /usr/local/libexec/libunwind/Lrs-race libtool: install: /usr/bin/install -c .libs/Ltest-init-local-signal /usr/local/libexec/libunwind/Ltest-init-local-signal libtool: install: /usr/bin/install -c .libs/Gtest-exc /usr/local/libexec/libunwind/Gtest-exc libtool: install: /usr/bin/install -c .libs/Ltest-exc /usr/local/libexec/libunwind/Ltest-exc libtool: install: /usr/bin/install -c .libs/Gtest-resume-sig /usr/local/libexec/libunwind/Gtest-resume-sig libtool: install: /usr/bin/install -c .libs/Ltest-resume-sig /usr/local/libexec/libunwind/Ltest-resume-sig libtool: install: /usr/bin/install -c .libs/Gtest-resume-sig-rt /usr/local/libexec/libunwind/Gtest-resume-sig-rt libtool: install: /usr/bin/install -c .libs/Ltest-resume-sig-rt /usr/local/libexec/libunwind/Ltest-resume-sig-rt libtool: install: /usr/bin/install -c .libs/test-ptrace /usr/local/libexec/libunwind/test-ptrace libtool: install: /usr/bin/install -c .libs/test-setjmp /usr/local/libexec/libunwind/test-setjmp libtool: install: /usr/bin/install -c .libs/Gx64-test-dwarf-expressions /usr/local/libexec/libunwind/Gx64-test-dwarf-expressions libtool: install: /usr/bin/install -c .libs/Lx64-test-dwarf-expressions /usr/local/libexec/libunwind/Lx64-test-dwarf-expressions libtool: install: /usr/bin/install -c .libs/x64-unwind-badjmp-signal-frame /usr/local/libexec/libunwind/x64-unwind-badjmp-signal-frame libtool: install: /usr/bin/install -c forker /usr/local/libexec/libunwind/forker libtool: install: /usr/bin/install -c .libs/Gperf-simple /usr/local/libexec/libunwind/Gperf-simple libtool: install: /usr/bin/install -c .libs/Lperf-simple /usr/local/libexec/libunwind/Lperf-simple libtool: install: /usr/bin/install -c .libs/Gperf-trace /usr/local/libexec/libunwind/Gperf-trace libtool: install: /usr/bin/install -c .libs/Lperf-trace /usr/local/libexec/libunwind/Lperf-trace libtool: install: /usr/bin/install -c mapper /usr/local/libexec/libunwind/mapper libtool: install: /usr/bin/install -c test-ptrace-misc /usr/local/libexec/libunwind/test-ptrace-misc libtool: install: /usr/bin/install -c crasher /usr/local/libexec/libunwind/crasher libtool: install: /usr/bin/install -c .libs/test-coredump-unwind /usr/local/libexec/libunwind/test-coredump-unwind ``` #### `podman commit local-ubuntu-dev bionic_translation-build-install` ```bash # https://gitlab.com/android_translation_layer/bionic_translation/-/blob/master/.gitlab-ci.yml#L58 sudo apt install -y meson cmake pkg-config libegl-dev libelf-dev libbsd-dev bubblewrap tzdata git clone https://gitlab.com/android_translation_layer/bionic_translation.git cd bionic_translation meson setup builddir cd builddir meson configure -Dlibdir=lib meson compile sudo meson install ``` Output: ``` Installing libdl_bio.so.0.0.1 to /usr/local/lib Installing libpthread_bio.so.0 to /usr/local/lib Installing libc_bio.so.0 to /usr/local/lib Installing libstdc++_bio.so.0 to /usr/local/lib Installing /home/chiu/android_project/bionic_translation/cfg.d/bionic_translation.cfg to /usr/local/share/bionic_translation/cfg.d Installing symlink pointing to libdl_bio.so.0.0.1 to /usr/local/lib/libdl_bio.so.0 Installing symlink pointing to libdl_bio.so.0 to /usr/local/lib/libdl_bio.so Installing symlink pointing to libpthread_bio.so.0 to /usr/local/lib/libpthread_bio.so Installing symlink pointing to libc_bio.so.0 to /usr/local/lib/libc_bio.so Installing symlink pointing to libstdc++_bio.so.0 to /usr/local/lib/libstdc++_bio.so ``` ``` rm /usr/local/lib/libdl_bio.* rm /usr/local/lib/libpthread_bio.* rm /usr/local/lib/libc_bio.* rm /usr/local/lib/libstdc++_bio.* ``` #### `podman commit local-ubuntu-dev art_standalone-build-install` ```bash sudo apt install -y default-jdk python-is-python3 meson libegl-dev pkg-config libbsd-dev libelf-dev valgrind libicu-dev libssl-dev libexpat1-dev zip liblz4-dev liblzma-dev libcap-dev git clone https://gitlab.com/android_translation_layer/art_standalone.git cd art_standalone make -j12 ____LIBDIR=lib sudo make ____LIBDIR=lib install ``` Output: ``` install -Dt /usr/local/lib/java/dex/art/natives/ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libjavacore.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libnativehelper.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libopenjdk.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libopenjdkjvm.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libwolfssljni.so install -Dt /usr/local/lib/art/ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libandroidfw.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libart.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libart-compiler.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libart-dexlayout.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libartbase.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libartpalette.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libbacktrace.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libbase.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libcutils.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libdexfile.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/liblog.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libnativebridge.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libprofile.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libsigchain.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libunwind.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libutils.so \ /home/chiu/android_project/art_standalone//out/host/linux-x86/lib64/libziparchive.so test -f /home/chiu/android_project/art_standalone//out/host/linux-x86/bin/dalvikvm && install -Dt /usr/local/bin /home/chiu/android_project/art_standalone//out/host/linux-x86/bin/dalvikvm || true test -f /home/chiu/android_project/art_standalone//out/host/linux-x86/bin/dalvikvm64 && install -Dt /usr/local/bin /home/chiu/android_project/art_standalone//out/host/linux-x86/bin/dalvikvm64 || true install -Dt /usr/local/bin /home/chiu/android_project/art_standalone//out/host/linux-x86/bin/dex2oat install -Dt /usr/local/bin /home/chiu/android_project/art_standalone//out/host/linux-x86/bin/dx install -Dt /usr/local/lib/java/dex/art/ /home/chiu/android_project/art_standalone//out/host/linux-x86/framework/apachehttp-hostdex.jar \ /home/chiu/android_project/art_standalone//out/host/linux-x86/framework/apache-xml-hostdex.jar \ /home/chiu/android_project/art_standalone//out/host/linux-x86/framework/bouncycastle-hostdex.jar \ /home/chiu/android_project/art_standalone//out/host/linux-x86/framework/core-junit-hostdex.jar \ /home/chiu/android_project/art_standalone//out/host/linux-x86/framework/core-libart-hostdex.jar \ /home/chiu/android_project/art_standalone//out/host/linux-x86/framework/core-oj-hostdex.jar \ /home/chiu/android_project/art_standalone//out/host/linux-x86/framework/hamcrest-hostdex.jar \ /home/chiu/android_project/art_standalone//out/host/linux-x86/framework/junit-runner-hostdex.jar \ /home/chiu/android_project/art_standalone//out/host/linux-x86/framework/okhttp-hostdex.jar \ /home/chiu/android_project/art_standalone//out/host/linux-x86/framework/wolfssljni-hostdex.jar install -D /home/chiu/android_project/art_standalone//out/host/common/obj/JAVA_LIBRARIES/core-all-hostdex_intermediates/classes.jar /usr/local/lib/java/core-all_classes.jar install -D /home/chiu/android_project/art_standalone//out/host/common/obj/JAVA_LIBRARIES/core-junit-hostdex_intermediates/classes.jar /usr/local/lib/java/core-junit_classes.jar install -D /home/chiu/android_project/art_standalone//out/host/common/obj/JAVA_LIBRARIES/junit-runner-hostdex_intermediates/classes.jar /usr/local/lib/java/junit-runner_classes.jar install -Dt /usr/local/lib/java/ /home/chiu/android_project/art_standalone//out/host/linux-x86/framework/dx.jar install -Dt /usr/local/include/androidfw /home/chiu/android_project/art_standalone//libandroidfw/include/androidfw/androidfw_c_api.h # install pkg-config file mkdir -p /usr/local/lib/pkgconfig install -m644 art-standalone.pc /usr/local/lib/pkgconfig/ ``` #### `podman commit local-ubuntu-dev libopensles_standalone-build-install` ```bash sudo apt install -y meson cmake libsdl2-dev libsndfile1-dev git clone https://gitlab.com/android_translation_layer/libopensles-standalone.git cd libopensles-standalone meson setup builddir cd builddir meson configure -Dlibdir=lib meson compile sudo meson install ``` Output: ``` Installing libOpenSLES.so.1.0.1 to /usr/local/lib Installing symlink pointing to libOpenSLES.so.1.0.1 to /usr/local/lib/libOpenSLES.so.1 Installing symlink pointing to libOpenSLES.so.1 to /usr/local/lib/libOpenSLES.so ``` #### `podman commit local-ubuntu-dev android_translation_layer-build-install` ```bash sudo apt install -y ant git clone https://gitlab.com/android_translation_layer/android_translation_layer.git cd android_translation_layer meson setup builddir cd builddir meson configure -Dlibdir=lib meson compile sudo meson install ``` Output: ``` Installing libandroid.so.0 to /usr/local/lib Installing libtranslation_layer_main.so to /usr/local/lib/java/dex/android_translation_layer/natives Installing android-translation-layer to /usr/local/bin Installing api-impl.jar to /usr/local/lib/java/dex/android_translation_layer File 'test_runner.jar' not found, skipping Installing res/framework-res/framework-res.apk to /usr/local/lib/java/dex/android_translation_layer Installing /home/chiu/android_project/android_translation_layer/res/fonts.xml to /usr/local/share/atl Installing symlink pointing to libandroid.so.0 to /usr/local/lib/libandroid.so ``` --- #### `podman commit local-ubuntu-dev qemu-build-install` ```bash git clone https://gitlab.com/android_translation_layer/qemu-based-native-bridge/nb-qemu.git # clone qemu submodule (unles you used --recurse-submodules) git submodule update --init --recursive # compile qemu fork cd qemu mkdir _build && cd _build make clean ../configure --disable-werror --target-list="aarch64-linux-user aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu lm32-softmmu moxie-softmmu microblazeel-softmmu mips64el-softmmu m68k-softmmu ppc-softmmu riscv64-softmmu sparc-softmmu" --disable-system ../configure --disable-werror --target-list="aarch64-linux-user" --disable-system # compile the various native bridge parts make -j12 ATL_INC=/home/chiu/android_project/android_translation_layer/src/ sudo make -j12 install ``` Output: ``` install -d -m 0755 "/usr/local/share/qemu" install -d -m 0755 "/usr/local/include" BUNZIP2 pc-bios/edk2-aarch64-code.fd.bz2 BUNZIP2 pc-bios/edk2-arm-code.fd.bz2 BUNZIP2 pc-bios/edk2-arm-vars.fd.bz2 BUNZIP2 pc-bios/edk2-i386-code.fd.bz2 BUNZIP2 pc-bios/edk2-i386-secure-code.fd.bz2 BUNZIP2 pc-bios/edk2-i386-vars.fd.bz2 BUNZIP2 pc-bios/edk2-x86_64-code.fd.bz2 BUNZIP2 pc-bios/edk2-x86_64-secure-code.fd.bz2 set -e; for x in bios.bin bios-256k.bin bios-microvm.bin sgabios.bin vgabios.bin vgabios-cirrus.bin vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin vgabios-virtio.bin vgabios-ramfb.bin vgabios-bochs-display.bin vgabios-ati.bin openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom efi-pcnet.rom efi-rtl8139.rom efi-virtio.rom efi-e1000e.rom efi-vmxnet3.rom qemu-nsis.bmp bamboo.dtb canyonlands.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin s390-ccw.img s390-netboot.img slof.bin skiboot.lid palcode-clipper u-boot.e500 u-boot-sam460-20100605.bin qemu_vga.ndrv edk2-licenses.txt hppa-firmware.img opensbi-riscv32-sifive_u-fw_jump.bin opensbi-riscv32-virt-fw_jump.bin opensbi-riscv64-sifive_u-fw_jump.bin opensbi-riscv64-virt-fw_jump.bin; do \ install -c -m 0644 /home/chiu/android_project/nb-qemu/qemu/pc-bios/$x "/usr/local/share/qemu"; \ done set -e; for x in pc-bios/edk2-aarch64-code.fd pc-bios/edk2-arm-code.fd pc-bios/edk2-arm-vars.fd pc-bios/edk2-i386-code.fd pc-bios/edk2-i386-secure-code.fd pc-bios/edk2-i386-vars.fd pc-bios/edk2-x86_64-code.fd pc-bios/edk2-x86_64-secure-code.fd; do \ install -c -m 0644 $x "/usr/local/share/qemu"; \ done install -d -m 0755 "/usr/local/share/qemu/firmware" set -e; tmpf=$(mktemp); trap 'rm -f -- "$tmpf"' EXIT; \ for x in 50-edk2-i386-secure.json 50-edk2-x86_64-secure.json 60-edk2-aarch64.json 60-edk2-arm.json 60-edk2-i386.json 60-edk2-x86_64.json; do \ sed -e 's,@DATADIR@,/usr/local/share/qemu,' \ "/home/chiu/android_project/nb-qemu/qemu/pc-bios/descriptors/$x" > "$tmpf"; \ install -c -m 0644 "$tmpf" \ "/usr/local/share/qemu/firmware/$x"; \ done for s in 16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512; do \ mkdir -p "/usr/local/share/icons/hicolor/${s}/apps"; \ install -c -m 0644 /home/chiu/android_project/nb-qemu/qemu/ui/icons/qemu_${s}.png \ "/usr/local/share/icons/hicolor/${s}/apps/qemu.png"; \ done; \ mkdir -p "/usr/local/share/icons/hicolor/32x32/apps"; \ install -c -m 0644 /home/chiu/android_project/nb-qemu/qemu/ui/icons/qemu_32x32.bmp \ "/usr/local/share/icons/hicolor/32x32/apps/qemu.bmp"; \ mkdir -p "/usr/local/share/icons/hicolor/scalable/apps"; \ install -c -m 0644 /home/chiu/android_project/nb-qemu/qemu/ui/icons/qemu.svg \ "/usr/local/share/icons/hicolor/scalable/apps/qemu.svg" mkdir -p "/usr/local/share/applications" install -c -m 0644 /home/chiu/android_project/nb-qemu/qemu/ui/qemu.desktop \ "/usr/local/share/applications/qemu.desktop" install -d -m 0755 "/usr/local/share/qemu/keymaps" set -e; for x in da en-gb et fr fr-ch is lt no pt-br sv ar de en-us fi fr-be hr it lv nl pl ru th de-ch es fo fr-ca hu ja mk pt sl tr bepo cz; do \ install -c -m 0644 /home/chiu/android_project/nb-qemu/qemu/pc-bios/keymaps/$x "/usr/local/share/qemu/keymaps"; \ done install -c -m 0644 /home/chiu/android_project/nb-qemu/qemu/_build/trace-events-all "/usr/local/share/qemu/trace-events-all" ``` #### `podman commit local-ubuntu-dev nb_qemu-build-install` ```bash sudo apt install clang lld libgnutls28-dev libglib2.0-dev libcapstone-dev gcc-powerpc64-linux-gnu gcc-powerpc64le-linux-gnu gcc-arm-linux-gnueabi gcc-aarch64-linux-gnu cd nb-qemu # cd ../.. rm -r /usr/local/lib64/libnb-qemu-thunks/ rm -r /usr/local//share/libnb-qemu-guest/ make -j8 default ATL_INC=/home/chiu/android_project/android_translation_layer/src/ LIBDIR=lib make install ``` Output: ``` install -Dt /usr/local//lib64/ /home/chiu/android_project/nb-qemu//builddir/libnb-qemu/libnb-qemu.so install -Dt /usr/local//lib64/libnb-qemu-thunks/ /home/chiu/android_project/nb-qemu//builddir/libnb-qemu/libnb-qemu-android.so \ /home/chiu/android_project/nb-qemu//builddir/libnb-qemu/libnb-qemu-EGL.so \ /home/chiu/android_project/nb-qemu//builddir/libnb-qemu/libnb-qemu-GLESv1_CM.so \ /home/chiu/android_project/nb-qemu//builddir/libnb-qemu/libnb-qemu-GLESv2.so \ /home/chiu/android_project/nb-qemu//builddir/libnb-qemu/libnb-qemu-OpenSLES.so # install -Dt /usr/local//share/libnb-qemu-guest/ /home/chiu/android_project/nb-qemu//builddir/bionic/libc.so \ /home/chiu/android_project/nb-qemu//libnb-qemu-guest/bionic/prebuilts/libdl.so \ /home/chiu/android_project/nb-qemu//libnb-qemu-guest/bionic/prebuilts/libm.so \ /home/chiu/android_project/nb-qemu//libnb-qemu-guest/bionic/prebuilts/linker64 \ /home/chiu/android_project/nb-qemu//builddir/libnb-qemu-guest/libandroid.so \ /home/chiu/android_project/nb-qemu//builddir/libnb-qemu-guest/libEGL.so \ /home/chiu/android_project/nb-qemu//builddir/libnb-qemu-guest/libGLESv2.so \ /home/chiu/android_project/nb-qemu//builddir/libnb-qemu-guest/liblog.so \ /home/chiu/android_project/nb-qemu//builddir/libnb-qemu-guest/libnb-qemu-guest.so \ /home/chiu/android_project/nb-qemu//builddir/libnb-qemu-guest/libOpenSLES.so \ /home/chiu/android_project/nb-qemu//builddir/libnb-qemu-guest/libstdc++.so # ln -s libGLESv2.so /usr/local//share/libnb-qemu-guest//libGLESv3.so ``` ### Apk run command ```bash NB_QEMU_SYSROOT=/usr/local/share/libnb-qemu-guest/ ATL_DIRECT_EGL=1 ANDROID_APP_DATA_DIR=/home/chiu/android_project/atl_test_apks/ LD_LIBRARY_PATH=/usr/local/lib/art/ android-translation-layer /home/chiu/android_project/atl_test_apks/ -X '-XX:NativeBridge=/usr/local/lib64/libnb-qemu.so' NB_QEMU_SYSROOT=/usr/local/share/libnb-qemu-guest/ ATL_DIRECT_EGL=1 GDK_DEBUG=gl-egl ANDROID_APP_DATA_DIR=/home/chiu/android_project/atl_test_apks/ LD_LIBRARY_PATH=/usr/local/lib/art/ android-translation-layer /home/chiu/android_project/atl_test_apks/com.imangi.templerun_1.16.0-48_minAPI16\(arm64-v8a\)\(nodpi\)_apkmirror.com.apk -X '-XX:NativeBridge=/usr/local/lib64/libnb-qemu.so' -X '-Xusejit:false' NB_QEMU_SYSROOT=/usr/local/share/libnb-qemu-guest/ ATL_DIRECT_EGL=1 ANDROID_APP_DATA_DIR=/home/chiu/android_project/atl_test_apks/ LD_LIBRARY_PATH=/usr/local/lib/art/ android-translation-layer /home/chiu/android_project/atl_test_apks/com.rovio.angrybirds_6.0.6-12200606_minAPI9\(armeabi\,armeabi-v7a\)\(nodpi\)_apkmirror.com.apk -X '-XX:NativeBridge=/usr/local/lib64/libnb-qemu.so' NB_QEMU_SYSROOT=/usr/local/share/libnb-qemu-guest/ ATL_DIRECT_EGL=1 ANDROID_APP_DATA_DIR=/home/chiu/android_project/atl_test_apks/ LD_LIBRARY_PATH=/usr/local/lib/art/ android-translation-layer /home/chiu/android_project/atl_test_apks/com.rovio.angrybirds_8.0.3-22680302_minAPI16\(armeabi-v7a\,x86\)\(nodpi\)_apkmirror.com.apk -X '-XX:NativeBridge=/usr/local/lib64/libnb-qemu.so' NB_QEMU_SYSROOT=/usr/local/share/libnb-qemu-guest/ ATL_DIRECT_EGL=1 ANDROID_APP_DATA_DIR=/home/chiu/android_project/atl_test_apks/ LD_LIBRARY_PATH=/usr/local/lib/art/ android-translation-layer /home/chiu/android_project/atl_test_apks/com.rovio.baba_2.36.1-2360002_minAPI16\(arm64-v8a\,armeabi-v7a\,x86\)\(nodpi\)_apkmirror.com.apk -X '-XX:NativeBridge=/usr/local/lib64/libnb-qemu.so' NB_QEMU_SYSROOT=/usr/local/share/libnb-qemu-guest/ ATL_DIRECT_EGL=1 ANDROID_APP_DATA_DIR=/home/chiu/android_project/atl_test_apks/ LD_LIBRARY_PATH=/usr/local/lib/art/ android-translation-layer /home/chiu/android_project/atl_test_apks/com.os.airforce_11.58-1160_minAPI21_x86_64_nodpi.apk -X '-XX:NativeBridge=/usr/local/lib64/libnb-qemu.so' ATL_DIRECT_EGL=1 ANDROID_APP_DATA_DIR=/home/chiu/android_project/atl_test_apks/ android-translation-layer /home/chiu/android_project/atl_test_apks/sample_unity_app.apk # -X '-Xforce-nb-testing' ``` ### dex2oat compile error ``` LD_LIBRARY_PATH=/usr/local/lib/art/ dex2oat --dex-file="/home/chiu/android_project/atl_test_apks/com.imangi.templerun_1.16.0-48_minAPI16(arm64-v8a)(nodpi)_apkmirror.com.apk_/files/audience_network.dex" --oat-file="/root/.cache/art/x86_64/home@chiu@android_project@atl_test_apks@com.imangi.templerun_1.16.0-48_minAPI16(arm64-v8a)(nodpi)_apkmirror.com.apk_@files@audience_network.dex" --instruction-set=x86_64 --instruction-set-features=-ssse3,-sse4.1,-sse4.2,-avx,-avx2,-popcnt --host --boot-image=/usr/local/lib/art/../java/dex/art/oat/boot.art LD_LIBRARY_PATH=/usr/local/lib/art/ gdb --args dex2oat \ --dex-file="/home/chiu/android_project/atl_test_apks/com.imangi.templerun_1.16.0-48_minAPI16(arm64-v8a)(nodpi)_apkmirror.com.apk_/files/audience_network.dex" \ --oat-file="/root/.cache/art/x86_64/home@chiu@android_project@atl_test_apks@com.imangi.templerun_1.16.0-48_minAPI16(arm64-v8a)(nodpi)_apkmirror.com.apk_@files@audience_network.dex" \ --instruction-set=x86_64 \ --instruction-set-features=-ssse3,-sse4.1,-sse4.2,-avx,-avx2,-popcnt \ --host \ --boot-image=/usr/local/lib/art/../java/dex/art/oat/boot.art ``` # 錯誤紀錄 ## System ```bash wavjaby@LAPTOP-IDM185VR:~/android_project/android_translation_layer$ cat /etc/os-release PRETTY_NAME="Ubuntu 24.04.3 LTS" NAME="Ubuntu" VERSION_ID="24.04" VERSION="24.04.3 LTS (Noble Numbat)" VERSION_CODENAME=noble ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=noble LOGO=ubuntu-logo wavjaby@LAPTOP-IDM185VR:~/android_project/android_translation_layer$ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 39 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Vendor ID: GenuineIntel Model name: 12th Gen Intel(R) Core(TM) i5-12500H CPU family: 6 Model: 154 Thread(s) per core: 2 Core(s) per socket: 8 Socket(s): 1 Stepping: 3 BogoMIPS: 6220.82 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_sin gle ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xget bv1 xsaves avx_vnni umip waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize flush_l1d arch_capabilities Caches (sum of all): L1d: 384 KiB (8 instances) L1i: 256 KiB (8 instances) L2: 10 MiB (8 instances) L3: 18 MiB (1 instance) Vulnerabilities: Gather data sampling: Not affected Itlb multihit: Not affected L1tf: Not affected Mds: Not affected Meltdown: Not affected Mmio stale data: Not affected Reg file data sampling: Vulnerable: No microcode Retbleed: Mitigation; Enhanced IBRS Spec rstack overflow: Not affected Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S Srbds: Not affected Tsx async abort: Not affected wavjaby@LAPTOP-IDM185VR:~/android_project/android_translation_layer$ uname -r 5.15.167.4-microsoft-standard-WSL2 ``` ## Issue 1 (10/31 再次討論) build lib dir wrong ```bash wavjaby@LAPTOP-IDM185VR:/$ ls /usr/local/lib libc_bio.so libpthread_bio.so.0 libunwind-coredump.so.0 libunwind-ptrace.so libunwind-setjmp.so.0 libunwind-x86_64.so.8.2.0 libwolfssl.la x86_64-linux-gnu libc_bio.so.0 libstdc++_bio.so libunwind-coredump.so.0.0.0 libunwind-ptrace.so.0 libunwind-setjmp.so.0.0.0 libunwind.a libwolfssl.so libdl_bio.so libstdc++_bio.so.0 libunwind-generic.a libunwind-ptrace.so.0.0.0 libunwind-x86_64.a libunwind.la libwolfssl.so.44 libdl_bio.so.0 libunwind-coredump.a libunwind-generic.so libunwind-setjmp.a libunwind-x86_64.la libunwind.so libwolfssl.so.44.0.0 libdl_bio.so.0.0.1 libunwind-coredump.la libunwind-ptrace.a libunwind-setjmp.la libunwind-x86_64.so libunwind.so.8 pkgconfig libpthread_bio.so libunwind-coredump.so libunwind-ptrace.la libunwind-setjmp.so libunwind-x86_64.so.8 libunwind.so.8.2.0 python3.12 wavjaby@LAPTOP-IDM185VR:/$ ls /usr/local/lib/x86_64-linux-gnu/ art java libOpenSLES.so libOpenSLES.so.1 libOpenSLES.so.1.0.1 libandroid.so libandroid.so.0 pkgconfig wavjaby@LAPTOP-IDM185VR:/$ android-translation-layer android-translation-layer: error while loading shared libraries: libandroid.so.0: cannot open shared object file: No such file or directory ``` Cause by atl install script: ```bash wavjaby@LAPTOP-IDM185VR:~/android_project/android_translation_layer/builddir$ sudo meson install Dropping privileges to 'wavjaby' before running ninja... ninja: Entering directory `/home/wavjaby/android_project/android_translation_layer/builddir' ninja: no work to do. Installing libandroid.so.0 to /usr/local/lib/x86_64-linux-gnu Installing libtranslation_layer_main.so to /usr/local/lib/x86_64-linux-gnu/java/dex/android_translation_layer/natives Installing android-translation-layer to /usr/local/bin Installing api-impl.jar to /usr/local/lib/x86_64-linux-gnu/java/dex/android_translation_layer File 'test_runner.jar' not found, skipping Installing res/framework-res/framework-res.apk to /usr/local/lib/x86_64-linux-gnu/java/dex/android_translation_layer Installing /home/wavjaby/android_project/android_translation_layer/res/fonts.xml to /usr/local/share/atl Installing symlink pointing to libandroid.so.0 to /usr/local/lib/x86_64-linux-gnu/libandroid.so ``` Change build libdir config: `meson configure -Dlibdir=lib` ```bash wavjaby@LAPTOP-IDM185VR:~/android_project/android_translation_layer/builddir$ sudo meson install Dropping privileges to 'wavjaby' before running ninja... ninja: Entering directory `/home/wavjaby/android_project/android_translation_layer/builddir' [0/1] Regenerating build files. The Meson build system Version: 1.3.2 Source dir: /home/wavjaby/android_project/android_translation_layer Build dir: /home/wavjaby/android_project/android_translation_layer/builddir Build type: native build Project name: android_translation_layer Project version: undefined C compiler for the host machine: cc (gcc 13.3.0 "cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0") C linker for the host machine: cc ld.bfd 2.42 Java compiler for the host machine: javac (unknown 21.0.8) Host machine cpu family: x86_64 Host machine cpu: x86_64 Dependency art-standalone found: YES 0.0.0 (cached) Library dl_bio found: YES Library c_bio found: YES Found pkg-config: YES (/usr/bin/pkg-config) 1.8.1 Dependency glib-2.0 found: YES 2.80.0 (cached) Program /usr/bin/glib-genmarshal found: YES (/usr/bin/glib-genmarshal) Dependency gio-2.0 found: YES 2.80.0 (cached) Program /usr/bin/gdbus-codegen found: YES (/usr/bin/gdbus-codegen) Dependency gio-2.0 found: YES 2.80.0 (cached) Program /usr/bin/gdbus-codegen found: YES (/usr/bin/gdbus-codegen) Dependency gio-2.0 found: YES 2.80.0 (cached) Program /usr/bin/gdbus-codegen found: YES (/usr/bin/gdbus-codegen) Dependency gio-2.0 found: YES 2.80.0 (cached) Program /usr/bin/gdbus-codegen found: YES (/usr/bin/gdbus-codegen) Found CMake: /usr/bin/cmake (3.28.3) Run-time dependency gtk4-layer-shell-0 found: NO (tried pkgconfig and cmake) Dependency gtk4 found: YES 4.14.5 (cached) Dependency jni found: YES 21.0.8 (cached) Dependency vulkan found: YES 1.3.275 (cached) Dependency openxr found: YES 1.0 (cached) Dependency wayland-protocols found: YES 1.38 (cached) Program wayland-scanner found: YES (/usr/bin/wayland-scanner) Dependency gtk4 found: YES 4.14.5 (cached) Dependency gl found: YES 1.2 (cached) Dependency egl found: YES 1.5 (cached) Dependency wayland-client found: YES 1.22.0 (cached) Dependency jni found: YES 21.0.8 (cached) Dependency libportal found: YES 0.7.1 (cached) Dependency sqlite3 found: YES 3.45.1 (cached) Dependency libavcodec found: YES 60.31.102 (cached) Dependency libdrm found: YES 2.4.122 (cached) Dependency gudev-1.0 found: YES 238 (cached) Dependency libswscale found: YES 7.5.100 (cached) Dependency webkitgtk-6.0 found: YES 2.48.7 (cached) Dependency gio-2.0 found: YES 2.80.0 (cached) Program /usr/bin/glib-compile-resources found: YES (/usr/bin/glib-compile-resources) Dependency gtk4 found: YES 4.14.5 (cached) Dependency jni found: YES 21.0.8 (cached) Dependency dl found: YES unknown (cached) Dependency libportal found: YES 0.7.1 (cached) Dependency fontconfig found: YES 2.15.0 (cached) Program ant found: NO Program ant found: NO Program aapt found: NO Build targets in project: 24 android_translation_layer undefined User defined options libdir: lib Found ninja-1.11.1 at /usr/bin/ninja Cleaning... 0 files. [3/3] Linking target android-translation-layer Installing libandroid.so.0 to /usr/local/lib Installing libtranslation_layer_main.so to /usr/local/lib/java/dex/android_translation_layer/natives Installing android-translation-layer to /usr/local/bin Installing api-impl.jar to /usr/local/lib/java/dex/android_translation_layer File 'test_runner.jar' not found, skipping Installing res/framework-res/framework-res.apk to /usr/local/lib/java/dex/android_translation_layer Installing /home/wavjaby/android_project/android_translation_layer/res/fonts.xml to /usr/local/share/atl Installing symlink pointing to libandroid.so.0 to /usr/local/lib/libandroid.so ``` Alread have ld config in ubuntu container ``` wavjaby@LAPTOP-IDM185VR:~/android_project$ podman run -d -it --userns=keep-id -e USER --net=host \ -e DISPLAY -e XDG_RUNTIME_DIR -e WAYLAND_DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR -p 6000:6000 \ -v /home/$USER:/home/$USER --name ubuntu ubuntu Port mappings have been discarded as one of the Host, Container, Pod, and None network modes are in use 6d106f874830f05de812d2456c1f631eda8c4f50364bb470eb9593943aa17fb1 wavjaby@LAPTOP-IDM185VR:~/android_project$ podman exec -it ubuntu /bin/bash wavjaby@LAPTOP-IDM185VR:/$ ls /etc/ld.so.conf.d/ libc.conf x86_64-linux-gnu.conf wavjaby@LAPTOP-IDM185VR:/$ cat /etc/ld.so.conf.d/x86_64-linux-gnu.conf # Multiarch support /usr/local/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu wavjaby@LAPTOP-IDM185VR:~/android_project$ echo "$(ld --verbose | grep SEARCH_DIR | grep -oE "/usr/lib([^\"]*)" || echo /usr/lib)" | head -n 1 | cut -c 6- lib/x86_64-linux-gnu ``` ------ # 六大罪!!! ## Issue 1-2(連帶於 1-1 一起解決 PR could be solved) art-standalone.pc not update when change `____LIBDIR` in make command ```bash wavjaby@LAPTOP-IDM185VR:~/android_project/art_standalone$ make ============================================ PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=6.0.1 TARGET_PRODUCT=full TARGET_BUILD_VARIANT=eng TARGET_BUILD_TYPE=release TARGET_BUILD_APPS= TARGET_ARCH=arm TARGET_ARCH_VARIANT=armv7-a TARGET_CPU_VARIANT=generic TARGET_2ND_ARCH= TARGET_2ND_ARCH_VARIANT= TARGET_2ND_CPU_VARIANT= HOST_ARCH=x86_64 HOST_OS=linux HOST_OS_EXTRA=Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.39 HOST_BUILD_TYPE=release BUILD_ID=MOB30M OUT_DIR=out ============================================ BUILD_LOGS ... wavjaby@LAPTOP-IDM185VR:~/android_project/art_standalone$ cat art-standalone.pc prefix=/usr/local exec_prefix=${prefix} libdir=${prefix}/lib/x86_64-linux-gnu includedir=${prefix}/include Name: art-standalone Description: Android ART runtime (standalone build, minimal ATL deps) Version: 0.0.0 Libs: -L${libdir}/art -lart -lnativebridge -landroidfw Cflags: -I${includedir} -I${includedir}/androidfw wavjaby@LAPTOP-IDM185VR:~/android_project/art_standalone$ make ____LIBDIR=lib ============================================ PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=6.0.1 TARGET_PRODUCT=full TARGET_BUILD_VARIANT=eng TARGET_BUILD_TYPE=release TARGET_BUILD_APPS= TARGET_ARCH=arm TARGET_ARCH_VARIANT=armv7-a TARGET_CPU_VARIANT=generic TARGET_2ND_ARCH= TARGET_2ND_ARCH_VARIANT= TARGET_2ND_CPU_VARIANT= HOST_ARCH=x86_64 HOST_OS=linux HOST_OS_EXTRA=Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.39 HOST_BUILD_TYPE=release BUILD_ID=MOB30M OUT_DIR=out ============================================ BUILD_LOGS ... wavjaby@LAPTOP-IDM185VR:~/android_project/art_standalone$ cat art-standalone.pc prefix=/usr/local exec_prefix=${prefix} libdir=${prefix}/lib/x86_64-linux-gnu includedir=${prefix}/include Name: art-standalone Description: Android ART runtime (standalone build, minimal ATL deps) Version: 0.0.0 Libs: -L${libdir}/art -lart -lnativebridge -landroidfw Cflags: -I${includedir} -I${includedir}/androidfw ``` `libdir` in art-standalone.pc does not update after `____LIBDIR` set to `lib`. art_standalone should add `.PHONY` to update art-standalone.pc ```diff diff --git a/Makefile b/Makefile index 3383a64b..0d4474c4 100644 --- a/Makefile +++ b/Makefile @@ -52,4 +52,6 @@ WITHOUT_CLANG := true WITHOUT_LIBCOMPILER_RT := true +.PHONY: art-standalone.pc + default: ____art_all ``` Then the issue solved ```bash wavjaby@LAPTOP-IDM185VR:~/android_project/art_standalone$ sudo make ____LIBDIR=lib ============================================ PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=6.0.1 TARGET_PRODUCT=full TARGET_BUILD_VARIANT=eng TARGET_BUILD_TYPE=release TARGET_BUILD_APPS= TARGET_ARCH=arm TARGET_ARCH_VARIANT=armv7-a TARGET_CPU_VARIANT=generic TARGET_2ND_ARCH= TARGET_2ND_ARCH_VARIANT= TARGET_2ND_CPU_VARIANT= HOST_ARCH=x86_64 HOST_OS=linux HOST_OS_EXTRA=Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.39 HOST_BUILD_TYPE=release BUILD_ID=MOB30M OUT_DIR=out ============================================ BUILD_LOGS... wavjaby@LAPTOP-IDM185VR:~/android_project/art_standalone$ cat art-standalone.pc prefix=/usr/local exec_prefix=${prefix} libdir=${prefix}/lib includedir=${prefix}/include Name: art-standalone Description: Android ART runtime (standalone build, minimal ATL deps) Version: 0.0.0 Libs: -L${libdir}/art -lart -lnativebridge -landroidfw Cflags: -I${includedir} -I${includedir}/androidfw ``` ### 解決方法 ``` bash echo "/usr/local/lib/art" | sudo tee /etc/ld.so.conf.d/art.conf sudo ldconfig ``` 可以以此檢查 ```bash ldconfig -p | grep libart ``` ## Issue 2(solve [PR 105] (https://gitlab.com/android_translation_layer/android_translation_layer/-/merge_requests/189/diffs?commit_id=63b47466b80b69f0bf79b6c50e7a32e930e32ebd )) [CookieManager.java#ValueCallback](https://gitlab.com/android_translation_layer/android_translation_layer/-/commit/fa3292dcb58f4c82122110cc6267ebcf36885890#533edf1e780267578e95fa392c5d2f79c1e7b260_0_5) [WebView.java#evaluateJavascript](https://gitlab.com/android_translation_layer/android_translation_layer/-/commit/e58d8d206536125bb6058ae3b52eb3e09ab483fd#51c927a2ea036e720560efcbc7e592d356a8f892_99_99) ValueCallback is in CookieManager.java and not set to public(even outside the class), causeing class not found ```bash wavjaby@LAPTOP-IDM185VR:~/android_project/android_translation_layer/builddir$ meson compile INFO: autodetecting backend as ninja INFO: calculating backend command to run: /usr/bin/ninja [4/6] Compiling Java object ../src/api-impl/android/webkit/WebView.java FAILED: src/api-impl/hax.jar.p/android/webkit/WebView.class javac -g -bootclasspath /usr/local/lib/x86_64-linux-gnu/java/core-all_classes.jar:/usr/local/lib/x86_64-linux-gnu/java/core-junit_classes.jar:/usr/local/lib/x86_64-linux-gnu/java/junit-runner_classes.jar -source 1.8 -target 1.8 -encoding UTF-8 -Xlint:-deprecation -h /home/wavjaby/android_project/android_translation_layer/src/api-impl-jni/generated_headers -d src/api-impl/hax.jar.p -s src/api-impl/hax.jar.p -sourcepath /home/wavjaby/android_project/android_translation_layer/src/api-impl:/home/wavjaby/android_project/android_translation_layer/builddir/src/api-impl:/home/wavjaby/android_project/android_translation_layer/builddir ../src/api-impl/android/webkit/WebView.java warning: [options] source value 8 is obsolete and will be removed in a future release warning: [options] target value 8 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. ../src/api-impl/android/webkit/WebView.java:99: error: cannot find symbol public void evaluateJavascript(String script, ValueCallback resultCallback) {} ^ symbol: class ValueCallback location: class WebView Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error 3 warnings ninja: build stopped: subcommand failed. ``` By adding files ```diff wavjaby@LAPTOP-IDM185VR:~/android_project/android_translation_layer$ git diff -U2 diff --git a/src/api-impl/android/webkit/CookieManager.java b/src/api-impl/android/webkit/CookieManager.java index 1e418efe..42c2effa 100644 --- a/src/api-impl/android/webkit/CookieManager.java +++ b/src/api-impl/android/webkit/CookieManager.java @@ -3,6 +3,4 @@ package android.webkit; import android.content.Context; -class ValueCallback {} - public class CookieManager { diff --git a/src/api-impl/android/webkit/ValueCallback.java b/src/api-impl/android/webkit/ValueCallback.java new file mode 100644 index 00000000..fa1e99db --- /dev/null +++ b/src/api-impl/android/webkit/ValueCallback.java @@ -0,0 +1,3 @@ +package android.webkit; + +public class ValueCallback {} ``` Solve the issue ```bash wavjaby@LAPTOP-IDM185VR:~/android_project/android_translation_layer/builddir$ meson compile INFO: autodetecting backend as ninja INFO: calculating backend command to run: /usr/bin/ninja [1/4] Compiling Java object ../src/api-impl/android/webkit/CookieManager.java warning: [options] source value 8 is obsolete and will be removed in a future release warning: [options] target value 8 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 3 warnings [2/4] Compiling Java object ../src/api-impl/android/webkit/WebView.java warning: [options] source value 8 is obsolete and will be removed in a future release warning: [options] target value 8 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 3 warnings [4/4] Generating api-impl.jar with a custom command Result compacted from 5629.1KiB to 2831.3KiB to save 2797.8KiB Merged dex #1 (750 defs/1865.2KiB) Merged dex #2 (1405 defs/2720.3KiB) Result is 1405 defs/2831.3KiB. Took 0.4s ``` ## ISSUE 3 ```bash -------------------------------- Running: sudo make ____LIBDIR=lib install -------------------------------- ============================================ cc: error: unrecognized command-line option ‘-std=gnu23’; did you mean ‘-std=gnu2x’? [10/40] Compiling C object libopensles/libopensles_util.a.p/OpenSLESUT.c.o ninja: build stopped: subcommand failed. ``` should be modified with libopensles/meason_builds https://gitlab.com/android_translation_layer/libopensles-standalone/-/blob/known_working_desktop_build/meson.build?ref_type=heads#L49 ``` '-Wno-unused-parameter', '-std=gnu2x' ``` ### Issue: [Build]: Build fails with `-std=gnu23` on GCC 13 and earlier version #### Description While building the **libOpenSLES-standalone** on Ubuntu 24.04 as part of the ATL build process, the compilation fails with the following error: ```bash sudo make ____LIBDIR=lib install cc: error: unrecognized command-line option ‘-std=gnu23’; did you mean ‘-std=gnu2x’? ``` Ubuntu 24.04 ships with **GCC 13**, which does not yet support `-std=gnu23`. Replacing the flag with `-std=gnu2x` resolves the build error: ```diff - '-std=gnu23' + '-std=gnu2x', ``` Reference: [meson.build](https://gitlab.com/android_translation_layer/libopensles-standalone/-/blob/known_working_desktop_build/meson.build) --- #### Root Cause `-std=gnu23` is only supported in **GCC 14+**. On GCC 13 and earlier, the equivalent flag is **`-std=gnu2x`**, which still enables the C23 features supported by the compiler. Since many users are building on LTS distributions (like Ubuntu 24.04), this flag breaks builds on a common configuration. --- #### Proposal Update the Meson build to use the more compatible `-std=gnu2x`, or alternatively consider adopting Meson's `c_std=gnu2x` default option for better portability. Happy to send a PR if this change is acceptable ## ISSUE 4 libunwind version art will not compile on ubuntu 24, using default libunwind version is 1.6.2 ```bash sudo apt install libunwind-dev ``` art compile error ``` host SharedLib: libart (out/host/linux-x86/obj/lib/libart.so) Host Jar: core-all-hostdex (out/host/common/obj/JAVA_LIBRARIES/core-all-hostdex_intermediates/javalib.jar) host Java: core-oj-hostdex (out/host/common/obj/JAVA_LIBRARIES/core-oj-hostdex_intermediates/classes) warning: [options] source value 8 is obsolete and will be removed in a future release warning: [options] target value 8 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. Install: out/host/linux-x86/lib64/libart.so host SharedLib: libart-compiler (out/host/linux-x86/obj/lib/libart-compiler.so) host SharedLib: libopenjdkjvm (out/host/linux-x86/obj/lib/libopenjdkjvm.so) host SharedLib: libopenjdk (out/host/linux-x86/obj/lib/libopenjdk.so) Install: out/host/linux-x86/lib64/libopenjdkjvm.so Install: out/host/linux-x86/lib64/libopenjdk.so Install: out/host/linux-x86/lib64/libart-compiler.so host StaticLib: libart-dex2oat (out/host/linux-x86/obj/STATIC_LIBRARIES/libart-dex2oat_intermediates/libart-dex2oat.a) host Executable: dex2oat (out/host/linux-x86/obj/EXECUTABLES/dex2oat_intermediates/dex2oat) /usr/bin/ld: /usr/local/lib/libdl_bio.so.0: undefined reference to `unw_set_iterate_phdr_function' collect2: error: ld returned 1 exit status make: *** [build/core/host_executable_internal.mk:34: out/host/linux-x86/obj/EXECUTABLES/dex2oat_intermediates/dex2oat] Error 1 make: *** Waiting for unfinished jobs.... Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 3 warnings ``` The version of default libunwind is 1.6.2 ```bash wavjaby@LAPTOP-IDM185VR:~/android_project$ apt search libunwind-dev Sorting... Done Full Text Search... Done android-libunwind-dev/noble 10.0.0+r36-4 amd64 libunwind for Android - Development files libunwind-dev/noble-updates,now 1.6.2-3build1.1 amd64 [installed] library to determine the call-chain of a program - development wavjaby@LAPTOP-IDM185VR:~/android_project$ pkg-config --modversion libunwind 1.6.2 ``` The unw_set_iterate_phdr_function is add after [libunwind 1.8 release](https://github.com/libunwind/libunwind/releases/tag/v1.8.0) ### issue message: [Build] fails on Ubuntu 24.04 (libunwind 1.6.2) with undefined reference to `unw_set_iterate_phdr_function` #### Problem Description When attempting to build the art-standalone project on a standard Ubuntu 24.04 system, the compilation fails. And the error message are below. ``` host Executable: dex2oat (out/host/linux-x86/obj/EXECUTABLES/dex2oat_intermediates/dex2oat) /usr/bin/ld: /usr/local/lib/libdl_bio.so.0: undefined reference to `unw_set_iterate_phdr_function' collect2: error: ld returned 1 exit status make: *** [build/core/host_executable_internal.mk:34: out/host/linux-x86/obj/EXECUTABLES/dex2oat_intermediates/dex2oat] Error 1 ``` #### insight The reason is that although we follow the build.md ```bach sudo apt install libasound2-dev libavcodec-dev libcap-dev libdrm-dev libglib2.0-dev libgtk-4-dev libgudev-1.0-dev libopenxr-dev libportal-dev libsqlite3-dev libwebkitgtk-6.0-dev ``` the version of libunwind provided by the default Ubuntu 24.04 repositories is too old. Ubuntu 24.04 ships with libunwind version 1.6.2. And the symbol `unw_set_iterate_phdr_function` was added in 1.8.0 version. Thus, I think we can add this info into the to let people can know this prerequisite ## ISSUE 5 找出少的套件幫他們加上去比對 CI 內容以及蛇哥 install_dependentcy.sh ## ISSUE 6 (optional) 要問一下為什麼不使用 ant 編譯 java, 因為編譯時間可以大幅降低,如果有說法我們可以在 install 文件加上 install ant 套件 ### issue message ## ISSUE art on RPI ```bash jkchiu@jkchiu-desktop:~/android_project$ nm -D -C /usr/local/lib/libunwind-aarch64.so | grep _Uaarch64_set_iterate_phdr_function 0000000000004a90 T _Uaarch64_set_iterate_phdr_function ``` ## ISSUE 7 WolfSSLKeyX509.getPrivateKey Crash error ```bash EGL::: native_window->egl_window: 281471421646736 EGL::: eglGetError: 12288 EGL::: ret: 0xffff2c6f90a0 __system_property_find: >ro.revision< not handled yet XRUN. __system_property_find: >ro.revision< not handled yet __system_property_find: >ro.revision< not handled yeE/CRASH (422003): Build fingerprint: 'unknown' E/CRASH (422003): Revision: 'unknown' E/CRASH (422003): ABI: 'arm64' E/CRASH (422003): Timestamp: 2025-11-03 21:14:10.050217375+0800 E/CRASH (422003): pid: 422003, tid: 422248, name: Google consent >>> android-translation-layer <<< E/CRASH (422003): uid: 1000 E/CRASH (422003): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr -------- E/CRASH (422003): Cause: null pointer dereference E/CRASH (422003): x0 0000000000000000 x1 0000000000000000 x2 0000000000000000 x3 0000000000000000 E/CRASH (422003): x4 0000000012c274c0 x5 00000000134cc329 x6 000000001385b6a0 x7 0000ffff5c1c44ec E/CRASH (422003): x8 0000000060f1a118 x9 0000000060f70000 x10 0000000060f75fc0 x11 000000000000004f E/CRASH (422003): x12 00000000b44e36a4 x13 0000000000000000 x14 0000000000000001 x15 00000000000045c9 E/CRASH (422003): x16 0000000000000000 x17 000000000004e1aa x18 00000000174ff44c x19 0000ffff2eaa9840 E/CRASH (422003): x20 0000000000000000 x21 0000000000000000 x22 0000000000000000 x23 0000000012fc0de0 E/CRASH (422003): x24 00000000134cc318 x25 000000006114d630 x26 0000000013625948 x27 0000000060f49900 E/CRASH (422003): x28 0000000000000001 x29 00000000000001bb E/CRASH (422003): lr 0000000063413488 sp 0000ffff5c1c4590 pc 000000006341349c pst 0000000020001000 E/CRASH (422003): E/CRASH (422003): backtrace: E/CRASH (422003): #00 pc 000000000003449c /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-wolfssljni-hostdex.oat (java.security.PrivateKey com.wolfssl.provider.jsse.WolfSSLKeyX509.getPrivateKey(java.lang.String)+252) E/CRASH (422003): #01 pc 0000000000020418 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-wolfssljni-hostdex.oat (void com.wolfssl.provider.jsse.WolfSSLContext.LoadClientKeyAndCertChain()+664) E/CRASH (422003): #02 pc 0000000000021794 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-wolfssljni-hostdex.oat (void com.wolfssl.provider.jsse.WolfSSLContext.createCtx()+1380) E/CRASH (422003): #03 pc 00000000000226d8 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-wolfssljni-hostdex.oat (void com.wolfssl.provider.jsse.WolfSSLContext.engineInit(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], java.security.SecureRandom)+632) E/CRASH (422003): #04 pc 0000000000022980 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-wolfssljni-hostdex.oat (void com.wolfssl.provider.jsse.WolfSSLContext$DEFAULT_Context.<init>()+224) E/CRASH (422003): #05 pc 00000000000421ec /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-wolfssljni-hostdex.oat (void com.wolfssl.provider.jsse.WolfSSLSocketFactory.initDefaultContext()+172) E/CRASH (422003): #06 pc 0000000000043294 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-wolfssljni-hostdex.oat (java.net.Socket com.wolfssl.provider.jsse.WolfSSLSocketFactory.createSocket(java.net.Socket, java.lang.String, int, boolean)+468) E/CRASH (422003): #07 pc 000000000003b2b0 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-okhttp-hostdex.oat (void com.android.okhttp.Connection.connectTls(int, int, com.android.okhttp.Request, com.android.okhttp.internal.ConnectionSpecSelector)+336) E/CRASH (422003): #08 pc 000000000003adb8 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-okhttp-hostdex.oat (void com.android.okhttp.Connection.connectSocket(int, int, int, com.android.okhttp.Request, com.android.okhttp.internal.ConnectionSpecSelector)+216) E/CRASH (422003): #09 pc 000000000003cfa4 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-okhttp-hostdex.oat (void com.android.okhttp.Connection.connect(int, int, int, com.android.okhttp.Request, java.util.List, boolean)+836) E/CRASH (422003): #10 pc 000000000003d324 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-okhttp-hostdex.oat (void com.android.okhttp.Connection.connectAndSetOwner(com.android.okhttp.OkHttpClient, java.lang.Object, com.android.okhttp.Request)+228) E/CRASH (422003): #11 pc 0000000000052d8c /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-okhttp-hostdex.oat (void com.android.okhttp.OkHttpClient$1.connectAndSetOwner(com.android.okhttp.OkHttpClient, com.android.okhttp.Connection, com.android.okhttp.internal.http.HttpEngine, com.android.okhttp.Request)+76) E/CRASH (422003): #12 pc 000000000008ba34 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-okhttp-hostdex.oat (void com.android.okhttp.internal.http.HttpEngine.connect()+484) E/CRASH (422003): #13 pc 00000000000905a0 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-okhttp-hostdex.oat (void com.android.okhttp.internal.http.HttpEngine.sendRequest()+720) E/CRASH (422003): #14 pc 0000000000099030 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-okhttp-hostdex.oat (boolean com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(boolean)+208) E/CRASH (422003): #15 pc 000000000009b838 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-okhttp-hostdex.oat (java.io.OutputStream com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream()+72) E/CRASH (422003): #16 pc 000000000009def4 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot-okhttp-hostdex.oat (java.io.OutputStream com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream()+52) E/CRASH (422003): #17 pc 0000000002d05a34 /home/jkchiu/.cache/art/arm64/home@jkchiu@android_project@atl_test_apks@com.imangi.templerun_1.27.0-82_minAPI22(arm64-v8a,armeabi-v7a)(nodpi)_apkmirror.com.apk@classes.dex (com.google.android.gms.internal.consent_sdk.zzck com.google.android.gms.internal.consent_sdk.zzu.zzd(com.google.android.gms.internal.consent_sdk.zzci)+564) E/CRASH (422003): #18 pc 0000000002d07278 /home/jkchiu/.cache/art/arm64/home@jkchiu@android_project@atl_test_apks@com.imangi.templerun_1.27.0-82_minAPI22(arm64-v8a,armeabi-v7a)(nodpi)_apkmirror.com.apk@classes.dex (void com.google.android.gms.internal.consent_sdk.zzu.zzb(android.app.Activity, com.google.android.ump.ConsentRequestParameters, com.google.android.ump.ConsentInformation$OnConsentInfoUpdateSuccessListener, com.google.android.ump.ConsentInformation$OnConsentInfoUpdateFailureListener)+408) E/CRASH (422003): #19 pc 0000000002d056cc /home/jkchiu/.cache/art/arm64/home@jkchiu@android_project@atl_test_apks@com.imangi.templerun_1.27.0-82_minAPI22(arm64-v8a,armeabi-v7a)(nodpi)_apkmirror.com.apk@classes.dex (void com.google.android.gms.internal.consent_sdk.zzq.run()+92) E/CRASH (422003): #20 pc 00000000007e0354 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot.oat (void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker)+996) E/CRASH (422003): #21 pc 00000000007ed128 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot.oat (void java.util.concurrent.ThreadPoolExecutor$Worker.run()+56) E/CRASH (422003): #22 pc 0000000000289460 /home/jkchiu/.cache/art/arm64/usr@local@lib@aarch64-linux-gnu@art@..@java@dex@art@oat@boot.oat (void java.lang.Thread.run()+64) E/CRASH (422003): #23 pc 000000000014ab50 /usr/local/lib/aarch64-linux-gnu/art/libart.so (art_quick_invoke_stub+544) (BuildId: 4dbf5fe734995afdea43ffbc146f85f4dd5389b3) E/CRASH (422003): #24 pc 000000000017675c /usr/local/lib/aarch64-linux-gnu/art/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+220) (BuildId: 4dbf5fe734995afdea43ffbc146f85f4dd5389b3) E/CRASH (422003): #25 pc 00000000005172b4 /usr/local/lib/aarch64-linux-gnu/art/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+304) (BuildId: 4dbf5fe734995afdea43ffbc146f85f4dd5389b3) E/CRASH (422003): #26 pc 000000000055e84c /usr/local/lib/aarch64-linux-gnu/art/libart.so (art::Thread::CreateCallback(void*)+780) (BuildId: 4dbf5fe734995afdea43ffbc146f85f4dd5389b3) E/CRASH (422003): #27 pc 0000000000085958 /usr/lib/aarch64-linux-gnu/libc.so.6 (BuildId: d6c205bda1b6e91815f8fef45bdf56bc2239c37e) E/CRASH (422003): #28 pc 00000000000ebb08 /usr/lib/aarch64-linux-gnu/libc.so.6 (BuildId: d6c205bda1b6e91815f8fef45bdf56bc2239c37e) E/CRASH (422003): Forwarding signal 11 ```