KhaosT/ACVM

Please add documenation for updating QEMU binaries

mooseword opened this issue · 0 comments

I would like to help out by making PRs for keep the QEMU binaries up to date. Could someone help me fill out the steps to provide a guide for contributors?

I have been trying to build QEMU on a macOS M1 machine, and have made some progress. If I make more progress, I will work on putting this together in a nicer way, but here is what I have now:



Building Embedded Binaries

Checking you can apply the patch

git clone https://gitlab.com/qemu-project/qemu.git

Look at the dates or SHAs for the patch you are trying to apply. The patches being the latest patch from alex . In my case this was May 19th, 2021.

git log --after="2021-05-18" --until="2021-05-20"

In my case, I went with 0a6f0c7

git checkout -b myPatchyBranchy
git reset --hard 0a6f0c7
git apply /path/to/your-Apple-Silicon-Support.patch

Building QEMU

Official docs

Dependencies

macOS ? (tested on 11.4 (20F71))

Python 3.9.6

Building glib will fail as previous versions of python report uname as x86_64

3.9.1

Python 3.9.1 (v3.9.1:1e5d33e9b9, Dec  7 2020, 12:10:52) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.uname().machine
'x86_64'

3.9.6

Python 3.9.6 (v3.9.6:db3ff76da1, Jun 28 2021, 11:14:58) 
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.uname().machine
'arm64'

Setup

The combination of the following versions of libraries has been built, but not tested. These should also be built in this order.

additionally, ninja, which we will copy the executable to our bin

I used a custom directory for building out the dependencies, which may not be valid.

export $BDIR=/tmp/qemuBuildDepends


For each of the dependencies listed above (except glib), cd into their directory and run

PATH=$BDIR/bin:$PATH ./configure --prefix=$BDIR
make
make install

a. for pkg-config, add --with-internal-glib --disable-asm-optimizations to the ./configure command
b. for glib

cp your/ninja/executable $BDIR/bin
PATH=$BDIR/bin:$PATH meson _build --prefix=$BDIR
PATH=$BDIR/bin:$PATH ninja -C _build
PATH=$BDIR/bin:$PATH ninja -C _build install

Notes:
gettext takes the longest to build, at a minute or more. all others should be seconds.

cd qemu
PATH=$BDIR/bin:$PATH ./configure --prefix=$BDIR
make

ACVFM

cp qemuRepo/build/qemu-img acvmRepo/ACVM
cp qemuRepo/build/qemu-system-aarch64 acvmRepo/ACVM