Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing dependency when building images for Raspberry Pi 4 #225

Closed
feklee opened this issue Nov 13, 2021 · 7 comments
Closed

Missing dependency when building images for Raspberry Pi 4 #225

feklee opened this issue Nov 13, 2021 · 7 comments

Comments

@feklee
Copy link

feklee commented Nov 13, 2021

On a headless Raspberry Pi 4 with Ubuntu Impish (21.10), I got sway/wayvnc running. Also, I successfully installed and initialized waydroid Hirsute (21.04). Unfortunately, it doesn’t run:

root@raspberrypi:~# waydroid container start 
[gbinder] Service manager /dev/binder has appeared 
[20:29:13] Failed to add service waydroidhardware: -1 
[20:29:34] session manager stopped, stopping container and waiting... 
[gbinder] Service manager /dev/binder has appeared 
[20:32:22] Failed to add service waydroidhardware: -1

And:

felix@raspberrypi:~$ XDG_SESSION_TYPE=wayland waydroid session start 
[20:32:22] Failed to start Clipboard manager service, check logs 
[20:32:22] Failed to add service waydroidusermonitor: -1 
[gbinder] WARNING: Service manager /dev/binder has died

So I was told by @erfanoabdi in a post on Telegram: “for rpi waydroid images need to get rebuilt btw”

He then proceeded:

I don’t really know what I’m doing here, and please correct me if I’m wrong. What I already did on Ubuntu 21.10:

  • First of all I set up a x64 machine with Ubuntu 21.10.

    Initially I wanted to build on the Raspberry Pi. However, the Android build environment does not support aarch64 out of the box, and changing that looks painful, according to some documentation that I found:

  • Set up build environment and configure Git. Repo I installed manually:

    $ mkdir -p ~/.bin
    $ curl https://storage.googleapis.com/git-repo-downloads/repo >~/.bin/repo
    $ chmod a+rx ~/.bin/repo
    $ echo 'PATH="${HOME}/.bin:${PATH}"' >>~/.bashrc
    

    Also, I installed packages listed in Google’s article Establishing a Build Environment:

    $ sudo apt install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 libncurses5 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig
    

    Plus:

    $ sudo apt install python
    $ sudo apt install python3-mako
    $ curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
    $ python2 get-pip.py
    $ echo 'PATH="${HOME}/.local/bin:${PATH}"' >>~/.bashrc
    $ ~/.local/bin/pip install Mako
    
  • Added vir_opt_constant_alu.c to libbroadcom_compiler_files in:

    external/mesa3d/src/broadcom/compiler/meson.build
    

    Not necessary, already in!

  • Restarted the shell, to get to the latest environment.

  • Configured Git.

  • Configured and built:

    $ N=$(($(nproc --all) -1)) # running on all cores crashed the system before
    $ mkdir -p ~/src/waydroid_images
    $ cd ~/src/waydroid_images
    $ repo init -u git://github.com/LineageOS/android.git -b lineage-17.1
    $ wget -O - https://raw.githubusercontent.com/waydroid/android_vendor_waydroid/lineage-17.1/manifest_scripts/generate-manifest.sh | bash
    $ repo sync
    $ . build/envsetup.sh
    $ apply-waydroid-patches
    $ cd hardware/waydroid
    $ git revert baa694d427ea65cccdea253a75e15118ead4add4
    $ cd ../..
    

    Add TARGET_USE_V3D := true and TARGET_USE_V3D_KMSRO := true near top to:

    device/waydroid/waydroid/BoardConfig.mk
    external/mesa3d/src/gallium/drivers/kmsro/Android.mk
    external/mesa3d/src/gallium/Android.common.mk
    external/mesa3d/Android.mk
    

    And near the end here:

    device/waydroid/waydroid/waydroid_arm64/lineage_waydroid_arm64.mk
    

    Then:

    $ lunch lineage_waydroid_arm64-userdebug
    $ make systemimage -j$N
    $ make vendorimage -j$N
    

At the very last step, the linker gives me an error about a missing dependency – see below. Any idea how to fix that?

[ 99% 28364/28454] target SharedLib: gallium_dri (out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so)
FAILED: out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so
/bin/bash -c "prebuilts/clang/host/linux-x86/clang-r353983c1/bin/clang++ -nostdlib -Wl,-soname,gallium_dri.so -Wl,--gc-sections -shared out/soong/.intermediates/bionic/libc/crtbegin_so/android_arm64_armv8-a_vendor/crtbegin_so.o out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/target.o -Wl,--whole-archive  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_amd_common_intermediates/libmesa_amd_common.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_amdgpu_addrlib_intermediates/libmesa_amdgpu_addrlib.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_galliumvl_intermediates/libmesa_galliumvl.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_d3d12_intermediates/libmesa_pipe_d3d12.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_etnaviv_intermediates/libmesa_pipe_etnaviv.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_freedreno_intermediates/libmesa_pipe_freedreno.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_kmsro_intermediates/libmesa_pipe_kmsro.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_lima_intermediates/libmesa_pipe_lima.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_llvmpipe_intermediates/libmesa_pipe_llvmpipe.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_nouveau_intermediates/libmesa_pipe_nouveau.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_panfrost_intermediates/libmesa_pipe_panfrost.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_r300_intermediates/libmesa_pipe_r300.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_r600_intermediates/libmesa_pipe_r600.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_radeonsi_intermediates/libmesa_pipe_radeonsi.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_softpipe_intermediates/libmesa_pipe_softpipe.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_svga_intermediates/libmesa_pipe_svga.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_v3d_intermediates/libmesa_pipe_v3d.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_virgl_intermediates/libmesa_pipe_virgl.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_winsys_amdgpu_intermediates/libmesa_winsys_amdgpu.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_winsys_etnaviv_intermediates/libmesa_winsys_etnaviv.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_winsys_freedreno_intermediates/libmesa_winsys_freedreno.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_winsys_kmsro_intermediates/libmesa_winsys_kmsro.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_winsys_lima_intermediates/libmesa_winsys_lima.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_winsys_nouveau_intermediates/libmesa_winsys_nouveau.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_winsys_panfrost_intermediates/libmesa_winsys_panfrost.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_winsys_radeon_intermediates/libmesa_winsys_radeon.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_winsys_svga_intermediates/libmesa_winsys_svga.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_winsys_sw_dri_intermediates/libmesa_winsys_sw_dri.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_winsys_sw_kms_dri_intermediates/libmesa_winsys_sw_kms_dri.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_winsys_v3d_intermediates/libmesa_winsys_v3d.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_winsys_virgl_intermediates/libmesa_winsys_virgl.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_winsys_virgl_common_intermediates/libmesa_winsys_virgl_common.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_winsys_virgl_vtest_intermediates/libmesa_winsys_virgl_vtest.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_st_dri_intermediates/libmesa_st_dri.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_st_mesa_intermediates/libmesa_st_mesa.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_glsl_intermediates/libmesa_glsl.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_compiler_intermediates/libmesa_compiler.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_nir_intermediates/libmesa_nir.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_dri_common_intermediates/libmesa_dri_common.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_megadriver_stub_intermediates/libmesa_megadriver_stub.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_loader_intermediates/libmesa_pipe_loader.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_util_intermediates/libmesa_util.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_loader_intermediates/libmesa_loader.a -Wl,--no-whole-archive   out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libexpat.vendor_intermediates/libexpat.vendor.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libetnaviv_drm_intermediates/libetnaviv_drm.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libfreedreno_common_intermediates/libfreedreno_common.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libfreedreno_drm_intermediates/libfreedreno_drm.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libfreedreno_ir2_intermediates/libfreedreno_ir2.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libfreedreno_ir3_intermediates/libfreedreno_ir3.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libfreedreno_perfcntrs_intermediates/libfreedreno_perfcntrs.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_gallium_intermediates/libmesa_gallium.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libpanfrost_lib_intermediates/libpanfrost_lib.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libpanfrost_bifrost_intermediates/libpanfrost_bifrost.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libpanfrost_bifrost_disasm_intermediates/libpanfrost_bifrost_disasm.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libpanfrost_midgard_intermediates/libpanfrost_midgard.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libpanfrost_midgard_disasm_intermediates/libpanfrost_midgard_disasm.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libpanfrost_shared_intermediates/libpanfrost_shared.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libpanfrost_util_intermediates/libpanfrost_util.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_broadcom_common_intermediates/libmesa_broadcom_common.a  out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libclang_rt.ubsan_minimal-aarch64-android.vendor_intermediates/libclang_rt.ubsan_minimal-aarch64-android.vendor.a   prebuilts/clang/host/linux-x86/clang-r353983c1/lib64/clang/9.0.3/lib/linux//libclang_rt.builtins-aarch64-android.a out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libatomic_intermediates/libatomic.a out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libgcc_intermediates/libgcc.a -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--build-id=md5 -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined-version -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_stripped.a -fuse-ld=lld -Wl,--hash-style=gnu -Wl,--icf=safe -Wl,-z,max-page-size=4096    -target aarch64-linux-android -Bprebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin -Wl,--version-script=external/mesa3d/src/gallium/targets/dri/dri.sym -Wl,--undefined-version -Wl,-execute-only -Wl,--exclude-libs,libclang_rt.ubsan_minimal-aarch64-android.a -Wl,--no-undefined  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/libglapi_intermediates/libglapi.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/libz.vendor_intermediates/libz.vendor.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/liblog.vendor_intermediates/liblog.vendor.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/libsync.vendor_intermediates/libsync.vendor.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/libhardware.vendor_intermediates/libhardware.vendor.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/libcutils.vendor_intermediates/libcutils.vendor.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/libLLVM90.vendor_intermediates/libLLVM90.vendor.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/libdrm.vendor_intermediates/libdrm.vendor.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/libdrm_amdgpu_intermediates/libdrm_amdgpu.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/libdrm_nouveau_intermediates/libdrm_nouveau.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/libdrm_radeon_intermediates/libdrm_radeon.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/liblog.vendor_intermediates/liblog.vendor.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/libsync.vendor_intermediates/libsync.vendor.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/liblog.vendor_intermediates/liblog.vendor.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/libdrm.vendor_intermediates/libdrm.vendor.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/libc++.vendor_intermediates/libc++.vendor.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/libc.vendor_intermediates/libc.vendor.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/libm.vendor_intermediates/libm.vendor.so  out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/libdl.vendor_intermediates/libdl.vendor.so -o out/target/product/waydroid_arm64/obj/SHARED_LIBRARIES/gallium_dri_intermediates/LINKED/gallium_dri.so out/soong/.intermediates/bionic/libc/crtend_so/android_arm64_armv8-a_vendor/obj/bionic/libc/arch-common/bionic/crtend_so.o"
ld.lld: error: undefined symbol: vir_opt_constant_alu
>>> referenced by vir.c:1801 (external/mesa3d/src/broadcom/compiler/vir.c:1801)
>>>               vir.o:(vir_optimize) in archive out/target/product/waydroid_arm64/obj/STATIC_LIBRARIES/libmesa_pipe_v3d_intermediates/libmesa_pipe_v3d.a
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
07:47:53 ninja failed with: exit status 1

#### failed to build some targets (24:28 (mm:ss)) ####
@feklee feklee changed the title How to build the images on and for a Raspberry Pi 4? Missing dependency when building images for Raspberry Pi 4 Nov 15, 2021
@mattkerrison
Copy link

Would love to know the answer to this as well, trying to get it working on a Raspberry Pi too.

@feklee
Copy link
Author

feklee commented Dec 5, 2021

The solution should be in one of the makefiles, but which one?

@FallenChromium
Copy link

Coming from https://github.com/remote-android/redroid-doc, as I've tried to launch Android apps on Raspberry Pi OS that way. It is super slow for me for some reason, but what I've managed to understand is that it actually uses Broadcom V3D driver, which means redroid's image builds it successfully. Where exactly I\anyone else should take a look to compare both makefiles, to check what might be wrong?

@vricosti
Copy link

vricosti commented Feb 23, 2022

Sorry to hijack this thread but I was trying to use anbox on my raspberry pi 4B 8Gb and I was answering someone who was stuck when compiling anbox but at the end it didn't work eitheir for me (https://forums.raspberrypi.com/viewtopic.php?p=1977269#p1977269) . Someone suggested me to have a look at waydroid so my questions are:

  1. Can I use raspbian OS 64 bits or do I need to use a Ubuntu flavor ? (I don't even find if wayland is supported on raspbian)
  2. Is anbox anbandoned and will this one live a bit more and why is it better than anbox ?

@tigercoding56
Copy link

The solution should be in one of the makefiles, but which one?

probably one which builds the android image for waydroid i would guess ?

@aleasto
Copy link
Member

aleasto commented Nov 19, 2022

Should be working now (please note that Impish is now EOL and as such not supported anymore)

@aleasto aleasto closed this as completed Nov 19, 2022
@nolansingroy
Copy link

builds the android image for waydroid i would guess ?

did you get this working - I am trying to do pi 4 64 bit os with waydroid but I am struggle to get it installed - any help would be very grateful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants