knazarov / homebrew-qemu-virgl

A homebrew tap for qemu with support for 3d accelerated guests
415 stars 68 forks source link

libEGL.dylib wrong architecture #12

Closed sgtcoolguy closed 3 years ago

sgtcoolguy commented 3 years ago

Seems similar to #4

I've tried brew tap --force-auto-update knazarov/qemu-virgl, then brew reinstall -s libangle, but it doesn't seem to help any.

Running qemu-system-aarch64 crashes:

❯ /opt/homebrew/Cellar/qemu-virgl/20210403.1/bin/qemu-system-aarch64 \
         -machine virt,accel=hvf,highmem=off \
         -cpu cortex-a72 -smp 2 -m 4G \
         -device intel-hda -device hda-output \
         -device virtio-gpu-pci \
         -device virtio-keyboard-pci \
         -device virtio-net-pci,netdev=net \
         -device virtio-mouse-pci \
         -display cocoa,gl=es \
         -netdev user,id=net,ipv6=off \
         -drive "if=pflash,format=raw,file=./edk2-aarch64-code.fd,readonly=on" \
         -drive "if=pflash,format=raw,file=./edk2-arm-vars.fd,discard=on" \
         -drive "if=virtio,format=raw,file=./hdd.raw,discard=on" \
         -cdrom ubuntu-20.04.2-live-server-arm64.iso \
         -boot d
Couldn't open libEGL.dylib: dlopen(libEGL.dylib, 5): no suitable image found.  Did find:
    /opt/homebrew/lib/libEGL.dylib: mach-o, but wrong architecture
    /opt/homebrew/Cellar/libangle/20210315.1/lib/libEGL.dylib: mach-o, but wrong architecture
Couldn't open fallback library /opt/homebrew/lib/libEGL.dylib: dlopen(/opt/homebrew/lib/libEGL.dylib, 5): no suitable image found.  Did find:
    /opt/homebrew/lib/libEGL.dylib: mach-o, but wrong architecture
    /opt/homebrew/Cellar/libangle/20210315.1/lib/libEGL.dylib: mach-o, but wrong architecture
[1]    79749 abort      /opt/homebrew/Cellar/qemu-virgl/20210403.1/bin/qemu-system-aarch64 -machine  

Looking at the dylib, it is x86_64:

❯ file /opt/homebrew/Cellar/libangle/20210315.1/lib/libEGL.dylib
/opt/homebrew/Cellar/libangle/20210315.1/lib/libEGL.dylib: Mach-O 64-bit dynamically linked shared library x86_64
sgtcoolguy commented 3 years ago

Seem like the toolchain for libangle is somehow using some x86_64 tooling (python?) under the hood, which I assume is the cause of this?

knazarov commented 3 years ago

@sgtcoolguy yeah, there’s a problem with the Formula. There should be a branch for arm that passes an additional parameter to the build script.

knazarov commented 3 years ago

You don’t need to reinstall libangle, only libepoxy-angle and qemu. Leave libangle as it is from the binary bottle for now, until I fix it

bjeurissen commented 3 years ago

I am facing the same issue. Is there an easy workaround for now?

knazarov commented 3 years ago

@bjeurissen @sgtcoolguy I’ve prepared the changeset here: https://github.com/knazarov/homebrew-qemu-virgl/pull/13

Unfortunately I can’t check that it works without a laptop (should have it in 2 days). If you could verify that the change works, I’ll merge it.

knazarov commented 3 years ago

Fixed by #13