Open mooseword opened 3 years ago
Ok I have made progress, mostly thanks to upgrading to Python 3.9.6. If I make more progress, I will work on putting this together in a nicer way.
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
macOS ? (tested on 11.4 (20F71))
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'
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
cp qemuRepo/build/qemu-img acvmRepo/ACVM
cp qemuRepo/build/qemu-system-aarch64 acvmRepo/ACVM
I would like to help out by making PRs for keep the QEMU binaries up to date. I have been trying to no avail to build QEMU on a macOS M1 machine. Could someone help me fill out the steps to provide a guide for contributors?
Here is what I have been trying:
However, I have not been able to build QEMU. I must admit this is may be due to me trying to avoid using Homebrew to install the additional build requirements. I have been able to compile everything myself except for
glib
. But if Homebrew is what it takes, then I will go for it.The error I always hit when trying to build
glib
is when it tries to use its ownlibffi
subproject itself, instead of using thelibffi
I built: