qemu-system-ppc in Homebrew on macOS has mouse warps and ghost clicks
Host environment
- Operating system: macOS Monterey 21G115
- OS/kernel version: Darwin celeste.local 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64 x86_64
- Architecture: x86_64
- QEMU flavor: qemu-system-ppc
- QEMU version: 7.1.0
- QEMU command line:
qemu-system-ppc -L pc-bios -boot c -M mac99 -m 512 -prom-env 'auto-boot?=true' -prom-env 'vga-ndrv?=true' -drive file="/path/to/OS9.img",format=raw,media=disk -netdev user,id=network01 -device sungem,netdev=network01 -device VGA,edid=on -device usb-kbd -device usb-mouse -g 1024x768x
Emulated/Virtualized environment
- Operating system: Mac OS 9.0.4
- OS/kernel version: N/A
- Architecture: PowerPC
Description of problem
The QEMU version in Homebrew (Intel macOS host, PowerPC Mac OS 9 guest) has random warping of the mouse cursor as well as ghost clicks which begin as soon as the operating system finishes loading. Video demonstration: https://youtu.be/DjXO0hwHArk
Notably, the exact same version of the QEMU source code with the same build arguments built outside of the Homebrew environment does not have this issue. I copied the following arguments from the QEMU Homebrew formula, and tried building QEMU on the command line:
../configure --prefix=/Users/josh/Desktop/qemu-homebrew-build --cc=clang --host-cc=clang --disable-bsd-user --disable-guest-agent --enable-capstone --enable-curses --enable-libssh --enable-slirp --enable-vde --enable-virtfs --enable-zstd --extra-cflags=-DNCURSES_WIDECHAR=1 --disable-sdl --smbd=/usr/local/sbin/samba-dot-org-smbd --disable-gtk --enable-cocoa --target-list=ppc-softmmu
This creates a qemu-system-ppc
binary which is 15MB in size and works perfectly. By contrast, the exact same build commands within the Homebrew build process create a binary which is 10MB in size (!!!) and has this mouse warping and ghost clicks issue. This occurs whether QEMU was installed with brew install qemu
or brew install --build-from-source qemu
. Providing the --HEAD
argument also makes no difference. The list of linked libraries (via otool -L qemu-system-ppc
) is the same between the two versions.
The only way I can reproduce this issue outside of Homebrew is to dump the Homebrew environmental variables (with env
) to a file and then set up those same environmental variables with the source
command, after which the resulting qemu-system-ppc
binary is now 10MB in size like the Homebrew version, and has the mouse issue like the Homebrew version. I'll attach the file with the Homebrew environmental variables. It seems that the issue must lie somewhere in there, but I'm really pushing the limits of my abilities, so I could definitely use some ideas and/or insights.
Steps to reproduce
- Install QEMU via
brew install qemu
- Start QEMU with an image of Mac OS 9
- After the boot process completes, the issue manifests