curl -LO https://github.com/qemu/qemu/raw/v8.0.4/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin
git submodule init
git submodule update --recursive
sudo apt install -y pkg-config ninja-build libglib2.0 libpixman-1-dev
gcc-11 を使うとなぜかエラーになったので、ホストの version 9 の gcc を使うとできた。 おそらく、vmware/open-vm-tools#509 のせい。
cd qemu
git checkout v8.0.4
git submodule init
git submodule --recursive
./configure --target-list=riscv32-softmmu
make -j $(nproc)