Skip to content

Instantly share code, notes, and snippets.

@akihikodaki
Last active June 13, 2024 11:44
Show Gist options
  • Save akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5 to your computer and use it in GitHub Desktop.
Save akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5 to your computer and use it in GitHub Desktop.
Linux Desktop on Apple Silicon in Practice

Linux Desktop on Apple Silicon in Practice

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon.

Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?

  • Two native ports exist.
  • QEMU can run code on CPU natively. But what about GPU? Unfortunately, QEMU is also not optimized so much for macOS.

As I needed Linux desktop right now, I decided to hack QEMU. The most difficult challenge is obviously accelerated graphics, but there is Virgil 3D; a bridge to expose host OpenGL to the guest. https://virgil3d.github.io

It unfortunately didn't work on macOS host. So I just made it work. That's it. Here is a video demonstrating OpenGL on Linux on Apple Silicon/M1:

https://www.youtube.com/watch?v=k0bVlVQU2JQ&list=PLesZxBYUPr3wdU3sONUv4Q7UDOg1Dn_Ue&index=4

Modifications

QEMU

ui/cocoa

  • Added OpenGL support.
  • Enforced pixel by pixel display.
  • Added cursor composition.
  • Improved key mappings (e.g. Japanese IME keys, 2021-06-17)

hw/block

  • File locking on macOS is fixed. (2021-07-07, Add file.locking=on to drive to prevent drive breakage in case you concurrently launch the same virtual machine by mistake.)

coreaudio

  • Fix device change (2022-02-26)

Virgil 3D renderer

Improved OpenGL ES support.

Do It Yourself

@knazarov's Homebre Formulae

It is independently maintained so may be a bit older, but you may still find it useful.

https://github.com/knazarov/homebrew-qemu-virgl

Setup

1. Open a terminal.

2. Install GLib, Meson, Pixman, pkg-config and spice-protocol with Homebrew.

brew install glib meson pixman pkg-config spice-protocol

3. Make a empty directory and change the working directory to it.

4.

curl -L https://gist.github.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5/raw/0a71a44d97f2d8e5199b529b00b2d00721f32f59/run.sh | bash -

5.

bin/qemu-img create var/virtio.raw 64G

It doesn't consume the physical space until it has data, so you can make the image very large. However, you will see odd behavior if you try to write data more than the physical disk allows.

6.

curl -LO https://download.fedoraproject.org/pub/alt/releases/39/respins/Silverblue/aarch64/Fedora-Silverblue-ostree-aarch64-39-1.5-respin.iso

8.

./run -cdrom Fedora-Silverblue-ostree-aarch64-39-1.5-respin.iso

Proceed the installation process, and now you can run Fedora by executing ./run.

Note: you won't get keyboard to work before Linux boots because TianoCore, the UEFI firmware does not support virtio-keyboard used in this configuration.

Updating

Just download the latest run.sh and execute it in your workspace directory.

Choosing OpenGL profile

Edit run.

  • gl=off will disable Virgil 3D GPU. Most stable but laggy.
  • gl=core will enable OpenGL.framework. Unstable.
  • gl=es will enable ANGLE. Stable and fast.

Upstreaming

Upstreaming is in progress. Hopefully the features I implemented will work just by running brew install qemu in the future.

Some insights

QEMU

This QEMU modification is not secure. The graphics acceleration code lives in the same process with everything else of the virtual machine and it is huge; the graphics stack involves LLVM for shader compilation, and a simple bug in the stack can lead to complete takeover of the guest.

vhost-user-gpu provides graphics acceleration isolation, but it needs modifications to run outside Linux because:

  • historically, vhost-user is a re-implementation of Linux kernel's vhost interface, and it relies on kernel headers for interface definitions and
  • vhost-user uses eventfd which is only available on Linux.

It shouldn't be difficult, but I'm satisfied even without process isolation so I don't. The graphics acceleration process would be still shared and it would remain possible that one graphical process exploit leads to disclosure of the entire graphics output anyway.

Linux desktop on Apple Silicon/M1 in general

As I described here, such a virtualization software is practical and efficient approach to run Linux desktop. The performance overhead is also acceptable for daily use, and it even provides better integration of Linux and macOS. For example, you can switch macOS and Linux with three-finger gesture on trackpad. You can use VirtFS.

However, there are complexities that such a virtualization adds. It basically means sharing one hardware with two systems, so you have to allocate the resource properly or it ends up with bad user experience. The allocation problem happens everywhere (HID like keyboard, computing resource like CPU, power management, etc.). This approach is efficient but not the best.

In long term, native Linux port is the best option. Asahi Linux is promising and you may find it favorable than my modified QEMU for your use case even today.

Apple Silicon で実践Linuxデスクトップ

M1 MacBook Airを買いました. これは私が持ってる一番速いコンピュータで, 私は長年の GNOME/GNU/Linux ユーザーでもあります. ここから, Apple Silicon でLinux デスクトップ環境が必要であるという明らかな結論が導かれます.

幸いにも, Linux は Apple Silicon で既に動作します. しかし 実用性 はどうでしょうか?

  • 2つのネイティブの移植があります.
    • Corellium. これは古くなっています. https://corellium.com/blog/linux-m1
    • Asahi Linux. 大幅に改善されており, 場合によっては実用的と言えます. しかし, 今のところグラフィックスアクセラレーションなどが欠けています. https://asahilinux.org
  • QEMU は CPU上でコードをネイティブ動作させることが可能です. しかし GPU についてはどうでしょう? また, 残念ながら, QEMU は macOS 向けにあまり最適化されていません.

私は Linux デスクトップが直ちに必要だったので, QEMU をハックすることにしました. 最大の困難は当然グラフィックスアクセラレーションですが, このために用いることができる, Virgil 3D という, ホストの OpenGL をゲストに見せるブリッジが存在します. https://virgil3d.github.io

残念ながらこれは macOS ホスト上で動きませんでした. そういうわけで 動くようにしました. 以上! 以下は Apple Silicon/M1 上での OpenGL を実演する動画です.

https://www.youtube.com/watch?v=k0bVlVQU2JQ&list=PLesZxBYUPr3wdU3sONUv4Q7UDOg1Dn_Ue&index=4

改変

QEMU

ui/cocoa

  • OpenGL サポートを追加.
  • Pixel by pixel 表示を実装.
  • カーソルの合成を追加.
  • キーマッピングを改善 (日本語 IME キーなど, 2021-06-17)

hw/block

  • macOS でのファイルロッキングを修正. (2021-07-07, 間違って同じ仮想マシンを 並行に起動してしまった場合にディスクが壊れるのを防ぐためには drivefile.locking=on を追加してください.)

hvf

  • 最新の Linux のために AArch64 ID レジスタを修正 (@agraf, 2022-02-07)

coreaudio

  • デバイスの変更処理を修正 (2022-02-26)

Virgil 3D renderer

OpenGL ES サポートを改善

Do It Yourself

@knazarov の Homebrew formulae

独自に保守されているため少し古いかもしれませんが, 便利かもしれません.

https://github.com/knazarov/homebrew-qemu-virgl

セットアップ

1. ターミナルを開く.

2. GLib, Meson, Pixman, pkg-config, そして spice-protocol を Homebrew でインストールする.

brew install glib meson pixman pkg-config spice-protocol

3. 空のディレクトリを作って working directory をそれに変更する.

4.

curl -L https://gist.github.com/akihikodaki/87df4149e7ca87f18dc56807ec5a1bc5/raw/0a71a44d97f2d8e5199b529b00b2d00721f32f59/run.sh | bash -

5.

bin/qemu-img create var/virtio.raw 64G

データが記録されるまで物理領域を消費しないため, イメージをかなり大きくできます. ただし, 物理ディスクが許容する以上のデータを書き込むとおかしな挙動が現れます.

6.

curl -LO https://download.fedoraproject.org/pub/alt/releases/39/respins/Silverblue/aarch64/Fedora-Silverblue-ostree-aarch64-39-1.5-respin.iso

8.

./run -cdrom Fedora-Silverblue-ostree-aarch64-39-1.5-respin.iso

インストールプロセスを進めてください. ./run を実行することで Fedora を起動できるようになるはずです.

注: Linux が起動するまでキーボードは利用できません。これは、この構成で利用している virtio-keyboard に UEFI ファームウェアの TianoCore が対応していないためです。

更新

単に最新の run.sh をダウンロードしてワークスペースディレクトリで実行して ください.

OpenGL プロファイルを選択する

run を編集してください.

  • gl=off は Virgil 3D GPU を無効にします. 安定していますがラグいです.
  • gl=core は OpenGL.framework を有効にします. 不安定です.
  • gl=es は ANGLE を有効にします. 安定していて速いです.

アップストリーミング

アップストリーミングが進行中です. 願わくば将来は私が実装した機能が brew install qemu とするだけで動作するようになるはずです.

考察

QEMU

この QEMU の改変は セキュアではありません . グラフィックスアクセラレーションのコードが仮想マシンの他のあらゆるもの全てと同じプロセスに存在していて, そのコードは巨大です. グラフィックススタックはシェーダコンパイルのために LLVM を含んでおり, その中の簡単な不具合1つでゲストの完全な乗っ取りが可能です.

vhost-user-gpu はグラフィックスアクセラレーションの分離を提供しますが, Linux 以外で動作するように修正が必要です.

  • 歴史的には, vhost-user は Linux カーネルの vhost インターフェイスの再実装となっていて, インターフェイス定義のためにカーネルヘッダに依存しています.
  • vhost-user は Linux でしか利用できない eventfd を利用しています.

これは難しくないでしょうが, プロセス分離がなくても満足してるのでやりません. やってもグラフィックスアクセラレーションプロセスは共有されたままになるでしょうし, 単独のグラフィカルプロセスの攻撃がグラフィックス出力全体の暴露につながるのは変わりないでしょう.

Apple Silicon/M1 上の Linux デスクトップ一般について

先に説明したとおり, このような仮想化ソフトウェアは Linux デスクトップを実行する 実用的で効率的な方法です. 性能上のオーバーヘッドも日常的な利用には許容できる範囲で, Linux と macOS のよりよい統合を提供しさえします. 例えば, macOS と Linux をトラックパッド上の3本指ジェスチャーで切り替えられます. VirtFS も使えます.

しかし, 仮想化による複雑さもあります. 要は1つのハードウェアを2つのシステムで 共有することになるので, 資源を適切に割り当てなければユーザー体験を悪化させます. この問題はあらゆる場面でおきます (キーボードのような HID, CPU のような計算資源, 電力管理などなど). この方法は 効率的 ですが 最善 ではありません.

長期的には ネイティブの Linux 移植が最善でしょう. Asahi Linux は期待できます. 今でも利用法によっては私が改変した QEMU よりよいかもしれません.

set -eux
mkdir -p depot_tools build/qemu source/angle source/libepoxy source/virglrenderer source/qemu var
git -C depot_tools init
git -C depot_tools fetch https://chromium.googlesource.com/chromium/tools/depot_tools 5400d9ef5a9e1b22fc846eca81d5a27df02d838a
git -C depot_tools checkout FETCH_HEAD
git -C source/angle init
git -C source/angle fetch https://chromium.googlesource.com/angle/angle f9bad5e27d61e2ab6a7504b1793be5aa14eb1414
git -C source/angle checkout FETCH_HEAD
git -C source/libepoxy init
git -C source/libepoxy fetch https://github.com/akihikodaki/libepoxy.git macos
git -C source/libepoxy checkout FETCH_HEAD
git -C source/virglrenderer init
git -C source/virglrenderer fetch https://github.com/akihikodaki/virglrenderer.git macos
git -C source/virglrenderer checkout FETCH_HEAD
git -C source/qemu init
git -C source/qemu fetch https://github.com/akihikodaki/qemu.git macos
git -C source/qemu checkout FETCH_HEAD
export DEPOT_TOOLS_UPDATE=0
export PATH="$PWD/depot_tools:$PATH"
cd source/angle
scripts/bootstrap.py
gclient sync -D
gn gen --args=is_debug=false ../../build/angle
cd ../..
ninja -C build/angle
[ -e build/libepoxy/meson-info ] || meson setup "-Dc_args=-I$PWD/source/angle/include" -Degl=yes -Dx11=false "--prefix=$PWD" build/libepoxy source/libepoxy
meson install -C build/libepoxy
[ -e build/virglrenderer/meson-info ] || meson setup "-Dc_args=-I$PWD/source/angle/include" "--pkg-config-path=$PWD/lib/pkgconfig" "--prefix=$PWD" build/virglrenderer source/virglrenderer
meson install -C build/virglrenderer
cd build/qemu
PKG_CONFIG_PATH="$PWD/../../lib/pkgconfig" ../../source/qemu/configure "--extra-cflags=-I$PWD/../../source/angle/include" "--extra-ldflags=-L$PWD/../angle" "--prefix=$PWD/../.."
make -j$(nproc) install
[ -e ../../var/edk2-arm-vars.fd ] || cp pc-bios/edk2-arm-vars.fd ../../var
cd ../..
cat > run <<'EOF'
#!/bin/bash
d="$(dirname "${BASH_SOURCE[0]}")"
exec sudo DYLD_FALLBACK_LIBRARY_PATH="$d/build/angle:$d/lib" "$d/bin/qemu-system-aarch64" -machine virt,accel=hvf -cpu host -smp "$(getconf _NPROCESSORS_ONLN)" -m 4G -device pcie-root-port,id=pcie -device virtio-sound-pci,addr=0x0.0x0,bus=pcie,multifunction=on,audiodev=audio,streams=1 -device virtio-gpu-gl-pci,addr=0x0.0x1,bus=pcie -device virtio-keyboard-pci,addr=0x0.0x2,bus=pcie -device virtio-net-pci,addr=0x0.0x3,bus=pcie,netdev=net -device virtio-rng-pci,addr=0x0.0x4,bus=pcie -display cocoa,gl=es -drive "if=pflash,format=raw,file=$d/share/qemu/edk2-aarch64-code.fd,readonly=on" -drive "if=pflash,format=raw,file=$d/var/edk2-arm-vars.fd" -drive "id=virtio,if=none,format=raw,file=$d/var/virtio.raw,discard=on" -device virtio-blk-pci,addr=0x0.0x5,backend_defaults=on,bus=pcie,drive=virtio -audiodev coreaudio,id=audio,out.fixed-settings=false -netdev vmnet-shared,id=net -chardev qemu-vdagent,id=spice,name=vdagent,clipboard=on -device virtio-serial-pci,addr=0x0.0x6,bus=pcie -device virtserialport,chardev=spice,name=com.redhat.spice.0 -full-screen -runas "$(id -u):$(id -g)" "$@"
EOF
chmod a+x run
@ZeppLu
Copy link

ZeppLu commented Jul 21, 2023

I checked qemu/meson.build, found

have_vhost_user = get_option('vhost_user') \
  .disable_auto_if(targetos != 'linux') \
  .require(targetos != 'windows',
           error_message: 'vhost-user is not available on Windows').allowed()

vhost-user can be explicitly enabled on macOS. Not bad, until...

have_vhost_user_gpu = have_tools and targetos == 'linux' and pixman.found()

Oppps! vhost-user-gpu available only on Linux!

@xlla
Copy link

xlla commented Dec 2, 2023

No, macOS requires Metal. gfxstream is for OpenGL and Vulkan.

for old macos, OpenGL is supported, I'am stick on macos 10.13.6 for best gpu and cuda

@akihikodaki
Copy link
Author

It's been quite a while, but I made an update today. This project is kind of in maintenance mode; I do no longer use this myself these days since Asahi works quite well. I only maintain patches already present and no longer add new ones. That said, the latest update has some interesting changes:

  • Changed to use virtio-sound-pci, which was added last year. Having Intel HDA in an Arm VM was a bit... awkward after all. virtio-sound-pci seems to have less glitches for me, but it may be just a placebo effect.
  • Reimplemented cursor composition with Core Animation, which makes it independent of rendering mechanism (Core Graphics or OpenGL), and allows upstreaming it before Virgl support.
  • Changed to use PCI Express for virtio devices.
  • Bunch of bug fixes that were done in course of upstreaming.

Some changes such as the full-screen mode improvement were also upstreamed and will be included in QEMU 9.0. I hope more changes to be upstreamed this year.

@DUOLabs333
Copy link

DUOLabs333 commented Mar 20, 2024

Awesome. I myself use UTM (I no longer have enough space to rebuild ANGLE), so I hope they upstream these changes. There was some memory leak that affects both this and UTM --- did you ever experience it; if so, have you been able to fix it?

Longer-term, I've been working on getting Vulkan to work on MacOS hosts (over TCP). I got to the point where Vulkan applications work, but they are slow --- turns out, synchronizing memory over TCP is slow. Is there any advice to speed things up, either using some QEMU-specific feature, or some faster internet interface on QEMU (right now, I get ~100MB/s between guest and host)?

@akihikodaki
Copy link
Author

@DUOLabs333 I haven't observed a memory leak. I don't actively use it after all.

ivshmem should be the fastest, but using would not be easier to port Venus:
https://www.qemu.org/docs/master/system/devices/ivshmem.html

I saw libkrun implemented Venus for macOS, but it is probably only for a headless environment.
https://sinrega.org/2024-03-06-enabling-containers-gpu-macos/

@DUOLabs333
Copy link

Doesn't ivshmem only exist for Linux hosts, not MacOS?

@akihikodaki
Copy link
Author

Maybe so.

@DUOLabs333
Copy link

I've been having some network speed issues with vmnet recently --- I've only been able to get around ~850 Mbps with TCP and ~2.0 Gbps with UDP (these were both tested with iperf3). Is this expected, or is there some parameter(s) I can tweak? I was expecting it to be much faster, as it should be as fast as copying memory, right?

@DUOLabs333
Copy link

DUOLabs333 commented Apr 14, 2024

I tried building this again but ran into some errors:

  1. I couldn't get scripts/bootstrap.py to run with python3, only with python2.
  2. When configuring libepoxy, I get
Trying to compare values of different types (MachineInfo, str) using ==.
This was deprecated and undefined behavior previously and is as of 0.60.0 a hard error.

I'm assuming you wanted host_system, not host_machine.

@DUOLabs333
Copy link

DUOLabs333 commented Apr 14, 2024

I was able to build your QEMU fork. I also changed my QEMU script to match run.sh. However, I found a few issues ---

  1. audio no longer works (It turns out that Arch Linux does not build the virtio_snd module. However, reverting to "-device intel-hda" causes the guest to no longer boot, though the QEMU process does start
    (
    EDIT: I got around this by replacing the sound-pci with
-device ich9-intel-hda,bus=pcie,addr=0x0.0x0,multifunction=on
-device hda-micro,audiodev=audio

).

  1. The mouse is no longer automatically captured/released.
    (
    EDIT: I got past this issue by removing a virtio-mouse-pci line in my script. However, while the mouse now does get successfully released/grabbed, once I mouse over the QEMU window, the corresponding cursor in the VM no longer moves.
    ).

@startergo
Copy link

startergo commented May 30, 2024

Hmmm. Almost succeeded but failed at the end.

meson logs
Build started at 2024-05-29T21:14:35.377556
Main binary: /usr/local/opt/python@3.12/bin/python3.12
Build Options: -Dc_args=-I/Users/mbp151/qemu-virgl/source/angle/include -Degl=yes -Dx11=false -Dprefix=/Users/mbp151/qemu-virgl
Python system: Darwin
The Meson build system
Version: 1.4.0
Source dir: /Users/mbp151/qemu-virgl/source/libepoxy
Build dir: /Users/mbp151/qemu-virgl/build/libepoxy
Build type: native build
Project name: libepoxy
Project version: 1.5.11
-----------
Detecting compiler via: `cc --version` -> 0
stdout:
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
-----------
Running command: cc -E -dM -
-----
-----------
Detecting linker via: `cc -Wl,--version` -> 1
stderr:
ld: unknown options: --version 
clang: error: linker command failed with exit code 1 (use -v to see invocation)
-----------
-----------
Detecting Apple linker via: `cc -Wl,-v` -> 0
stderr:
@(#)PROGRAM:ld PROJECT:ld-1053.12
BUILD 10:14:46 Mar 29 2024
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
will use ld-classic for: armv6 armv7 armv7s arm64_32 i386 armv6m armv7k armv7m armv7em
LTO support using: LLVM version 15.0.0 (static support for 29, runtime is 29)
TAPI support using: Apple TAPI version 15.0.0 (tapi-1500.3.2.2)
-----------
Sanity testing C compiler: cc
Is cross compiler: False.
Sanity check compiler command line: cc sanitycheckc.c -o sanitycheckc.exe -I/Users/mbp151/qemu-virgl/source/angle/include
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/sanitycheckc.exe
C compiler for the host machine: cc (clang 15.0.0 "Apple clang version 15.0.0 (clang-1500.3.9.4)")
C linker for the host machine: cc ld64 1053.12
-----------
Detecting archiver via: `llvm-ar-15 --version` -> [Errno 2] No such file or directory: 'llvm-ar-15'
-----------
Detecting archiver via: `llvm-ar --version` -> [Errno 2] No such file or directory: 'llvm-ar'
-----------
Detecting archiver via: `ar --version` -> 1
stderr:
usage:  ar -d [-TLsv] archive file ...
  ar -m [-TLsv] archive file ...
  ar -m [-abiTLsv] position archive file ...
  ar -p [-TLsv] archive [file ...]
  ar -q [-cTLsv] archive file ...
  ar -r [-cuTLsv] archive file ...
  ar -r [-abciuTLsv] position archive file ...
  ar -t [-TLsv] archive [file ...]
  ar -x [-ouTLsv] archive [file ...]
-----------
-----------
Detecting compiler via: `cc --version` -> 0
stdout:
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
-----------
Running command: cc -E -dM -
-----
-----------
Detecting linker via: `cc -Wl,--version` -> 1
stderr:
ld: unknown options: --version 
clang: error: linker command failed with exit code 1 (use -v to see invocation)
-----------
-----------
Detecting Apple linker via: `cc -Wl,-v` -> 0
stderr:
@(#)PROGRAM:ld PROJECT:ld-1053.12
BUILD 10:14:46 Mar 29 2024
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
will use ld-classic for: armv6 armv7 armv7s arm64_32 i386 armv6m armv7k armv7m armv7em
LTO support using: LLVM version 15.0.0 (static support for 29, runtime is 29)
TAPI support using: Apple TAPI version 15.0.0 (tapi-1500.3.2.2)
-----------
Sanity testing C compiler: cc
Is cross compiler: False.
Sanity check compiler command line: cc sanitycheckc.c -o sanitycheckc.exe
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/sanitycheckc.exe
C compiler for the build machine: cc (clang 15.0.0 "Apple clang version 15.0.0 (clang-1500.3.9.4)")
C linker for the build machine: cc ld64 1053.12
-----------
Detecting archiver via: `llvm-ar-15 --version` -> [Errno 2] No such file or directory: 'llvm-ar-15'
-----------
Detecting archiver via: `llvm-ar --version` -> [Errno 2] No such file or directory: 'llvm-ar'
-----------
Detecting archiver via: `ar --version` -> 1
stderr:
usage:  ar -d [-TLsv] archive file ...
  ar -m [-TLsv] archive file ...
  ar -m [-abiTLsv] position archive file ...
  ar -p [-TLsv] archive [file ...]
  ar -q [-cTLsv] archive file ...
  ar -r [-cuTLsv] archive file ...
  ar -r [-abciuTLsv] position archive file ...
  ar -t [-TLsv] archive [file ...]
  ar -x [-ouTLsv] archive [file ...]
-----------
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpdcgjin4u
Code:

      #ifdef __has_include
       #if !__has_include("KHR/khrplatform.h")
        #error "Header 'KHR/khrplatform.h' could not be found"
       #endif
      #else
       #include <KHR/khrplatform.h>
      #endif
-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpdcgjin4u/testfile.c -E -P -P -O0 -Werror=implicit-function-declaration -std=gnu99` -> 0
Has header "KHR/khrplatform.h" : YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpvmo45m7j
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpvmo45m7j/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpvmo45m7j/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wpointer-arith` -> 0
Compiler for C supports arguments -Wpointer-arith: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp1wohyrnj
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp1wohyrnj/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp1wohyrnj/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wmissing-declarations` -> 0
Compiler for C supports arguments -Wmissing-declarations: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpoc02c6v2
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpoc02c6v2/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpoc02c6v2/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wformat=2` -> 0
Compiler for C supports arguments -Wformat=2: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpxk660b64
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpxk660b64/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpxk660b64/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wstrict-prototypes` -> 0
Compiler for C supports arguments -Wstrict-prototypes: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpdr703og6
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpdr703og6/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpdr703og6/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wmissing-prototypes` -> 0
Compiler for C supports arguments -Wmissing-prototypes: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp5x106y9x
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp5x106y9x/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp5x106y9x/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wnested-externs` -> 0
Compiler for C supports arguments -Wnested-externs: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmparxw39if
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmparxw39if/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmparxw39if/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wbad-function-cast` -> 0
Compiler for C supports arguments -Wbad-function-cast: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpcol9_3ot
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpcol9_3ot/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpcol9_3ot/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wold-style-definition` -> 0
Compiler for C supports arguments -Wold-style-definition: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp5hecfav1
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp5hecfav1/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp5hecfav1/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wdeclaration-after-statement` -> 0
Compiler for C supports arguments -Wdeclaration-after-statement: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmply4xy15s
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmply4xy15s/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmply4xy15s/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wunused` -> 0
Compiler for C supports arguments -Wunused: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpj5azw6q5
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpj5azw6q5/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpj5azw6q5/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wuninitialized` -> 0
Compiler for C supports arguments -Wuninitialized: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp8pa_q2v7
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp8pa_q2v7/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp8pa_q2v7/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wshadow` -> 0
Compiler for C supports arguments -Wshadow: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp38u8w0d2
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp38u8w0d2/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp38u8w0d2/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wmissing-noreturn` -> 0
Compiler for C supports arguments -Wmissing-noreturn: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmps8vbp8b1
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmps8vbp8b1/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmps8vbp8b1/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wmissing-format-attribute` -> 0
Compiler for C supports arguments -Wmissing-format-attribute: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpezh7nfek
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpezh7nfek/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpezh7nfek/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wredundant-decls` -> 0
Compiler for C supports arguments -Wredundant-decls: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpi7mb7n1d
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpi7mb7n1d/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpi7mb7n1d/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wlogical-op` -> 1
stderr:
error: unknown warning option '-Wlogical-op'; did you mean '-Wlong-long'? [-Werror,-Wunknown-warning-option]
-----------
Compiler for C supports arguments -Wlogical-op: NO 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpp8urmvm8
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpp8urmvm8/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpp8urmvm8/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Werror=implicit` -> 0
Compiler for C supports arguments -Werror=implicit: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp9hxa9an0
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp9hxa9an0/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp9hxa9an0/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Werror=nonnull` -> 0
Compiler for C supports arguments -Werror=nonnull: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpmimfmiqh
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpmimfmiqh/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpmimfmiqh/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Werror=init-self` -> 0
Compiler for C supports arguments -Werror=init-self: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp4cvv8u9t
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp4cvv8u9t/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp4cvv8u9t/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Werror=main` -> 0
Compiler for C supports arguments -Werror=main: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp1adtem0a
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp1adtem0a/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp1adtem0a/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Werror=missing-braces` -> 0
Compiler for C supports arguments -Werror=missing-braces: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpbn7_vyt_
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpbn7_vyt_/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpbn7_vyt_/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Werror=sequence-point` -> 0
Compiler for C supports arguments -Werror=sequence-point: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp2wh_nqam
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp2wh_nqam/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp2wh_nqam/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Werror=return-type` -> 0
Compiler for C supports arguments -Werror=return-type: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpggt6yedr
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpggt6yedr/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpggt6yedr/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Werror=trigraphs` -> 0
Compiler for C supports arguments -Werror=trigraphs: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpfln7z626
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpfln7z626/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpfln7z626/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Werror=array-bounds` -> 0
Compiler for C supports arguments -Werror=array-bounds: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp2ornqwpe
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp2ornqwpe/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp2ornqwpe/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Werror=write-strings` -> 0
Compiler for C supports arguments -Werror=write-strings: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpjjuh6eez
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpjjuh6eez/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpjjuh6eez/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Werror=address` -> 0
Compiler for C supports arguments -Werror=address: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpgg0n1sde
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpgg0n1sde/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpgg0n1sde/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Werror=int-to-pointer-cast` -> 0
Compiler for C supports arguments -Werror=int-to-pointer-cast: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpz45g8cq3
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpz45g8cq3/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpz45g8cq3/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Werror=pointer-to-int-cast` -> 0
Compiler for C supports arguments -Werror=pointer-to-int-cast: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpid2s0f07
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpid2s0f07/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpid2s0f07/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -fno-strict-aliasing` -> 0
Compiler for C supports arguments -fno-strict-aliasing: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpkd57gho7
Code:
extern int i;
int i;

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpkd57gho7/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpkd57gho7/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument -Wint-conversion -Wno-int-conversion` -> 0
Compiler for C supports arguments -Wno-int-conversion: YES 
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpyniy8ybp
Code:
int main(void) { return 0; }

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpyniy8ybp/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpyniy8ybp/output.exe -O0 -Werror=implicit-function-declaration -ldl -Wl,-undefined,dynamic_lookup` -> 0
Library dl found: YES
Pkg-config binary missing from cross or native file, or env var undefined.
Trying a default Pkg-config fallback at pkg-config
Found pkg-config: YES (/usr/local/bin/pkg-config) 0.29.2
Determining dependency 'gl' with pkg-config executable '/usr/local/bin/pkg-config'
env[PKG_CONFIG_PATH]: 
env[PKG_CONFIG]: /usr/local/bin/pkg-config
-----------
Called: `/usr/local/bin/pkg-config --modversion gl` -> 1
stderr:
Package gl was not found in the pkg-config search path.
Perhaps you should add the directory containing `gl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gl' found
-----------
Run-time dependency gl found: YES
Determining dependency 'x11' with pkg-config executable '/usr/local/bin/pkg-config'
env[PKG_CONFIG_PATH]: 
env[PKG_CONFIG]: /usr/local/bin/pkg-config
-----------
Called: `/usr/local/bin/pkg-config --modversion x11` -> 0
stdout:
1.8.9
-----------
env[PKG_CONFIG_PATH]: 
env[PKG_CONFIG]: /usr/local/bin/pkg-config
-----------
Called: `/usr/local/bin/pkg-config --cflags x11` -> 0
stdout:
-I/usr/local/Cellar/libx11/1.8.9/include -I/usr/local/Cellar/libxcb/1.17.0/include -I/usr/local/Cellar/libxau/1.0.11/include -I/usr/local/Cellar/libxdmcp/1.1.5/include -I/usr/local/Cellar/xorgproto/2024.1/include
-----------
env[PKG_CONFIG_ALLOW_SYSTEM_LIBS]: 1
env[PKG_CONFIG_PATH]: 
env[PKG_CONFIG]: /usr/local/bin/pkg-config
-----------
Called: `/usr/local/bin/pkg-config --libs x11` -> 0
stdout:
-L/usr/local/Cellar/libx11/1.8.9/lib -lX11
-----------
env[PKG_CONFIG_PATH]: 
env[PKG_CONFIG]: /usr/local/bin/pkg-config
-----------
Called: `/usr/local/bin/pkg-config --libs x11` -> 0
stdout:
-L/usr/local/Cellar/libx11/1.8.9/lib -lX11
-----------
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp8c7mgabl
Code:

      #include<stddef.h>
      #include<stdio.h>
      int main(void) {
          printf("%ld\n", (long)(sizeof(void *)));
          return 0;
      }
-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp8c7mgabl/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp8c7mgabl/output.exe -O0 -Werror=implicit-function-declaration` -> 0
Program stdout:

8

Program stderr:


Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpd894ogrd
Code:

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpd894ogrd/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpd894ogrd/output.obj -c -O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option -Werror=unused-command-line-argument -Werror=ignored-optimization-argument --print-search-dirs` -> 0
stdout:
programs: =/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
libraries: =/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0
-----------
Run-time dependency x11 found: YES 1.8.9
Determining dependency 'egl' with pkg-config executable '/usr/local/bin/pkg-config'
env[PKG_CONFIG_PATH]: 
env[PKG_CONFIG]: /usr/local/bin/pkg-config
-----------
Called: `/usr/local/bin/pkg-config --modversion egl` -> 1
stderr:
Package egl was not found in the pkg-config search path.
Perhaps you should add the directory containing `egl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'egl' found
-----------
Finding framework path by running:  cc -v -E - -I/Users/mbp151/qemu-virgl/source/angle/include 

Looking for framework egl in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks
CMake binary for host machine is not cached
CMake binary missing from cross or native file, or env var undefined.
Trying a default CMake fallback at cmake
Found CMake: /usr/local/bin/cmake (3.29.3)
Extracting basic cmake information
CMake Toolchain: Calling CMake once to generate the compiler state
Calling CMake (['/usr/local/bin/cmake']) in /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/__CMake_compiler_info__ with:
- "--trace-expand"
- "--trace-format=json-v1"
- "--no-warn-unused-cli"
- "--trace-redirect=cmake_trace.txt"
- "-G"
- "Ninja"
- "-DCMAKE_TOOLCHAIN_FILE=/Users/mbp151/qemu-virgl/build/libepoxy/meson-private/__CMake_compiler_info__/CMakeMesonTempToolchainFile.cmake"
- "."
CMake trace warning: add_executable() non imported executables are not supported
CMake TRACE: /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/__CMake_compiler_info__/CMakeFiles/CMakeScratch/TryCompile-xXcfJp/CMakeLists.txt:22 add_executable(['cmTC_12b9b'])
CMake trace warning: target_link_options() TARGET cmTC_12b9b not found
CMake TRACE: /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/__CMake_compiler_info__/CMakeFiles/CMakeScratch/TryCompile-xXcfJp/CMakeLists.txt:28 target_link_libraries(['cmTC_12b9b', ''])
Try CMake generator: auto
Calling CMake (['/usr/local/bin/cmake']) in /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/cmake_egl with:
- "--trace-expand"
- "--trace-format=json-v1"
- "--no-warn-unused-cli"
- "--trace-redirect=cmake_trace.txt"
- "-DCMAKE_TOOLCHAIN_FILE=/Users/mbp151/qemu-virgl/build/libepoxy/meson-private/cmake_egl/CMakeMesonToolchainFile.cmake"
- "."
-- Module search paths:    ['/', '/Applications', '/Applications/Xcode.app/Contents/Applications', '/Applications/Xcode.app/Contents/Developer/Applications', '/Applications/Xcode.app/Contents/Developer/Library/Frameworks', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/System/Library/Frameworks', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr', '/Library/Frameworks', '/System/Library/Frameworks', '/Users/mbp151/Applications', '/opt', '/opt/local', '/usr', '/usr/local', '/usr/local/Cellar/cmake/3.29.3']
-- CMake root:             /usr/local/Cellar/cmake/3.29.3/share/cmake
-- CMake architectures:    []
-- CMake lib search paths: ['lib', 'lib32', 'lib64', 'libx32', 'share', '']
Preliminary CMake check failed. Aborting.
Run-time dependency egl found: NO (tried pkgconfig, framework and cmake)
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpquyd7t0p
Code:
int main(void) { return 0; }

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpquyd7t0p/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpquyd7t0p/output.exe -O0 -Werror=implicit-function-declaration -lEGL -Wl,-undefined,dynamic_lookup` -> 0
Library EGL found: YES
Determining dependency 'glesv2' with pkg-config executable '/usr/local/bin/pkg-config'
env[PKG_CONFIG_PATH]: 
env[PKG_CONFIG]: /usr/local/bin/pkg-config
-----------
Called: `/usr/local/bin/pkg-config --modversion glesv2` -> 1
stderr:
Package glesv2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glesv2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glesv2' found
-----------
Finding framework path by running:  cc -v -E - -I/Users/mbp151/qemu-virgl/source/angle/include 

Looking for framework glesv2 in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks
CMake binary for host machine is cached.
Preliminary CMake check failed. Aborting.
Run-time dependency glesv2 found: NO (tried pkgconfig, framework and cmake)
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpxwbsjisx
Code:
int main(void) { return 0; }

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpxwbsjisx/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmpxwbsjisx/output.exe -O0 -Werror=implicit-function-declaration -lGLESv2 -Wl,-undefined,dynamic_lookup` -> 0
Library GLESv2 found: YES
Determining dependency 'glesv1_cm' with pkg-config executable '/usr/local/bin/pkg-config'
env[PKG_CONFIG_PATH]: 
env[PKG_CONFIG]: /usr/local/bin/pkg-config
-----------
Called: `/usr/local/bin/pkg-config --modversion glesv1_cm` -> 1
stderr:
Package glesv1_cm was not found in the pkg-config search path.
Perhaps you should add the directory containing `glesv1_cm.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glesv1_cm' found
-----------
Finding framework path by running:  cc -v -E - -I/Users/mbp151/qemu-virgl/source/angle/include 

Looking for framework glesv1_cm in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks
CMake binary for host machine is cached.
Preliminary CMake check failed. Aborting.
Run-time dependency glesv1_cm found: NO (tried pkgconfig, framework and cmake)
Running compile:
Working directory:  /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp8h8zovac
Code:
int main(void) { return 0; }

-----------
Command line: `cc -I/Users/mbp151/qemu-virgl/source/angle/include /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp8h8zovac/testfile.c -o /Users/mbp151/qemu-virgl/build/libepoxy/meson-private/tmp8h8zovac/output.exe -O0 -Werror=implicit-function-declaration -lGLESv1_CM -Wl,-undefined,dynamic_lookup` -> 1
stderr:
ld: library 'GLESv1_CM' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
-----------
Library GLESv1_CM found: NO

source/libepoxy/meson.build:204:45: ERROR: 
Trying to compare values of different types (MachineInfo, str) using ==.
This was deprecated and undefined behavior previously and is as of 0.60.0 a hard error.

@startergo
Copy link

this is the same failure as on your upstream pull request:
https://github.com/anholt/libepoxy/actions/runs/8357971479/job/22878316751?pr=239

@startergo
Copy link

@akihikodaki So I kinda fixed the compilation of qemu, but I can't get it running. Is this supposed to work on x86_64 or only arm?
https://gist.github.com/startergo/0d9a7425876c2b42f8b797af80fbe3d8

@DUOLabs333
Copy link

DUOLabs333 commented Jun 3, 2024

@startergo I ran into the same problem --- host_machine == should now be host_system ==.

What exactly was the issue when you tried to run the program?

@startergo
Copy link

@startergo I ran into the same problem --- host_machine == should now be host_system ==.

What exactly was the issue when you tried to run the program?

Well first of all I can't even install it, because when It gets to Qemu configuration it says that there is some error in the data file and I need to reconfigure. So I added reconfigure option and it compiles successfully, but for instance when I try to start Qemu I get:
qemu-system-x86_64: -device virtio-vga-gl: 'virtio-vga-gl' is not a valid device model name
run zip
Rename jpg to zip after downloading.

@DUOLabs333
Copy link

'virtio-vga-gl' is not a valid device model name

That's because that is the wrong name --- you should use virtio-gpu-gl-pci.

@startergo
Copy link

'virtio-vga-gl' is not a valid device model name

That's because that is the wrong name --- you should use virtio-gpu-gl-pci.

I changed it:

qemu-system-x86_64: -device virtio-gpu-gl-pci: 'virtio-gpu-gl-pci' is not a valid device model name

According to this: https://github.com/knazarov/homebrew-qemu-virgl
It is the correct name for x86_64. The name you gave me is for ARM. I am just let to believe that Virgl did not compile for me because of the reconfigure. Are you able to compile this now from scratch?

@akihikodaki
Copy link
Author

@startergo I ran into the same problem --- host_machine == should now be host_system ==.

I made this change on my tree.

What exactly was the issue when you tried to run the program?

Well first of all I can't even install it, because when It gets to Qemu configuration it says that there is some error in the data file and I need to reconfigure. So I added reconfigure option and it compiles successfully, but for instance when I try to start Qemu I get: qemu-system-x86_64: -device virtio-vga-gl: 'virtio-vga-gl' is not a valid device model name run zip Rename jpg to zip after downloading.

It implies virgl is disabled for your build. Delete everything and try again.

@startergo
Copy link

startergo commented Jun 9, 2024

@akihikodaki thanks. Just tried it again. Here is where it fails:

meson logs
Initialized empty Git repository in /Users/mbp151/newqemu/source/qemu/subprojects/berkeley-softfloat-3/.git/
remote: Enumerating objects: 441, done.
remote: Counting objects: 100% (441/441), done.
remote: Compressing objects: 100% (357/357), done.
remote: Total 441 (delta 397), reused 97 (delta 83), pack-reused 0 (from 0)
Receiving objects: 100% (441/441), 206.19 KiB | 8.96 MiB/s, done.
Resolving deltas: 100% (397/397), done.
From https://gitlab.com/qemu-project/berkeley-softfloat-3
 * branch            b64af41c3276f97f0e181920400ee056b9c88037 -> FETCH_HEAD
HEAD is now at b64af41 Fix typo in function 'softfloat_propagateNaNF128M' for RISC-V.

Executing subproject berkeley-softfloat-3 

berkeley-softfloat-3| Project name: berkeley-softfloat-3
berkeley-softfloat-3| Project version: undefined
berkeley-softfloat-3| C compiler for the host machine: cc -m64 (clang 15.0.0 "Apple clang version 15.0.0 (clang-1500.3.9.4)")
berkeley-softfloat-3| C linker for the host machine: cc -m64 ld64 1053.12
berkeley-softfloat-3| Configuring platform.h using configuration
berkeley-softfloat-3| Build targets in project: 477
berkeley-softfloat-3| Subproject berkeley-softfloat-3 finished.

Initialized empty Git repository in /Users/mbp151/newqemu/source/qemu/subprojects/berkeley-testfloat-3/.git/
remote: Enumerating objects: 214, done.
remote: Counting objects: 100% (214/214), done.
remote: Compressing objects: 100% (205/205), done.
remote: Total 214 (delta 154), reused 26 (delta 8), pack-reused 0 (from 0)
Receiving objects: 100% (214/214), 183.29 KiB | 10.78 MiB/s, done.
Resolving deltas: 100% (154/154), done.
From https://gitlab.com/qemu-project/berkeley-testfloat-3
 * branch            e7af9751d9f9fd3b47911f51a5cfd08af256a9ab -> FETCH_HEAD
HEAD is now at e7af975 Fix -Wreturn-type errors in fNNRandom

Executing subproject berkeley-testfloat-3 

berkeley-testfloat-3| Project name: berkeley-testfloat-3
berkeley-testfloat-3| Project version: undefined
berkeley-testfloat-3| C compiler for the host machine: cc -m64 (clang 15.0.0 "Apple clang version 15.0.0 (clang-1500.3.9.4)")
berkeley-testfloat-3| C linker for the host machine: cc -m64 ld64 1053.12
berkeley-testfloat-3| Configuring platform.h using configuration
berkeley-testfloat-3| Compiler for C supports arguments -Wno-ignored-pragmas: YES
berkeley-testfloat-3| Build targets in project: 479
berkeley-testfloat-3| Subproject berkeley-testfloat-3 finished.

Program diff found: YES (/usr/bin/diff)
Program dbus-daemon found: YES (/usr/local/bin/dbus-daemon)
Run-time dependency gvnc-1.0 found: YES 1.3.1
Run-time dependency sysprof-capture-4 found: NO (tried pkgconfig)
WARNING: Static library 'iconv' not found for dependency 'glib-2.0', may not be statically linked
Run-time dependency glib-2.0 found: YES 2.80.2
Program initrd-stress.sh found: YES (/Users/mbp151/newqemu/source/qemu/tests/migration/initrd-stress.sh)
Program xgettext found: YES (/usr/local/bin/xgettext)
Program msgfmt found: YES (/usr/local/bin/msgfmt)
Program msginit found: YES (/usr/local/bin/msginit)
Program msgmerge found: YES (/usr/local/bin/msgmerge)
Program xgettext found: YES (/usr/local/bin/xgettext)
Build targets in project: 715
WARNING: Deprecated features used:
 * 0.60.0: {'install_subdir with empty directory'}

qemu 9.0.50

  Build environment
    Build directory                              : /Users/mbp151/newqemu/build/qemu
    Source path                                  : /Users/mbp151/newqemu/source/qemu
    Download dependencies                        : YES

  Directories
    Build directory                              : /Users/mbp151/newqemu/build/qemu
    Source path                                  : /Users/mbp151/newqemu/source/qemu
    Download dependencies                        : YES
    Install prefix                               : /Users/mbp151/newqemu/build/qemu/../..
    BIOS directory                               : share/qemu
    firmware path                                : share/qemu-firmware
    binary directory                             : /Users/mbp151/newqemu/build/qemu/../../bin
    library directory                            : /Users/mbp151/newqemu/build/qemu/../../lib
    module directory                             : lib/qemu
    libexec directory                            : /Users/mbp151/newqemu/build/qemu/../../libexec
    include directory                            : /Users/mbp151/newqemu/build/qemu/../../include
    config directory                             : /Users/mbp151/newqemu/build/qemu/../../etc
    local state directory                        : /Users/mbp151/newqemu/build/qemu/../../var
    Manual directory                             : /Users/mbp151/newqemu/build/qemu/../../share/man
    Doc directory                                : /Users/mbp151/newqemu/build/qemu/../../share/doc

  Host binaries
    python                                       : /Users/mbp151/newqemu/build/qemu/pyvenv/bin/python3 (version: 3.9)
    sphinx-build                                 : /Users/mbp151/newqemu/build/qemu/pyvenv/bin/sphinx-build
    gdb                                          : 
    iasl                                         : /usr/local/bin/iasl
    genisoimage                                  : 
    smbd                                         : /usr/sbin/smbd

  Configurable features
    Documentation                                : YES
    system-mode emulation                        : YES
    user-mode emulation                          : NO
    block layer                                  : YES
    Install blobs                                : YES
    module support                               : NO
    fuzzing support                              : NO
    Audio drivers                                : coreaudio sdl
    Trace backends                               : log
    D-Bus display                                : YES
    QOM debugging                                : YES
    Relocatable install                          : YES
    vhost-kernel support                         : NO
    vhost-net support                            : NO
    vhost-user support                           : NO
    vhost-user-crypto support                    : NO
    vhost-user-blk server support                : NO
    vhost-vdpa support                           : NO
    build guest agent                            : NO

  Compilation
    host CPU                                     : x86_64
    host endianness                              : little
    C compiler                                   : cc -m64
    Host C compiler                              : cc -m64
    C++ compiler                                 : NO
    Objective-C compiler                         : clang -m64
    CFLAGS                                       : -I/Users/mbp151/newqemu/build/qemu/../../source/angle/include -g -O2
    OBJCFLAGS                                    : -I/Users/mbp151/newqemu/build/qemu/../../source/angle/include -g -O2
    LDFLAGS                                      : -I/Users/mbp151/newqemu/build/qemu/../../source/angle/include -L/Users/mbp151/newqemu/build/qemu/../angle
    QEMU_CFLAGS                                  : -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -fno-pie -ftrivial-auto-var-init=zero -fzero-call-used-regs=used-gpr -fstack-protector-strong
    QEMU_OBJCFLAGS                               : -mcx16 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-common -fwrapv -fno-pie -ftrivial-auto-var-init=zero -fzero-call-used-regs=used-gpr
    QEMU_LDFLAGS                                 : -fstack-protector-strong
    link-time optimization (LTO)                 : NO
    PIE                                          : NO
    static build                                 : NO
    malloc trim support                          : NO
    membarrier                                   : NO
    debug graph lock                             : NO
    debug stack usage                            : NO
    mutex debugging                              : NO
    memory allocator                             : system
    avx2 optimization                            : YES
    avx512bw optimization                        : YES
    avx512f optimization                         : NO
    gcov                                         : NO
    thread sanitizer                             : NO
    CFI support                                  : NO
    strip binaries                               : NO
    sparse                                       : NO
    mingw32 support                              : NO

  Targets and accelerators
    KVM support                                  : NO
    HVF support                                  : YES
    WHPX support                                 : NO
    NVMM support                                 : NO
    Xen support                                  : NO
    Xen emulation                                : NO
    TCG support                                  : YES
    TCG backend                                  : native (x86_64)
    TCG plugins                                  : YES
    TCG debug enabled                            : NO
    target list                                  : aarch64-softmmu alpha-softmmu arm-softmmu avr-softmmu cris-softmmu hppa-softmmu i386-softmmu loongarch64-softmmu m68k-softmmu microblaze-softmmu microblazeel-softmmu mips-softmmu mips64-softmmu mips64el-softmmu mipsel-softmmu or1k-softmmu ppc-softmmu ppc64-softmmu riscv32-softmmu riscv64-softmmu rx-softmmu s390x-softmmu sh4-softmmu sh4eb-softmmu sparc-softmmu sparc64-softmmu tricore-softmmu x86_64-softmmu xtensa-softmmu xtensaeb-softmmu
    default devices                              : YES
    out of process emulation                     : NO
    vfio-user server                             : NO

  Block layer support
    coroutine backend                            : sigaltstack
    coroutine pool                               : YES
    Block whitelist (rw)                         : 
    Block whitelist (ro)                         : 
    Use block whitelist in tools                 : NO
    VirtFS (9P) support                          : YES
    VirtFS (9P) Proxy Helper support (deprecated): NO
    replication support                          : YES
    bochs support                                : YES
    cloop support                                : YES
    dmg support                                  : YES
    qcow v1 support                              : YES
    vdi support                                  : YES
    vhdx support                                 : YES
    vmdk support                                 : YES
    vpc support                                  : YES
    vvfat support                                : YES
    qed support                                  : YES
    parallels support                            : YES
    FUSE exports                                 : NO
    VDUSE block exports                          : NO

  Crypto
    TLS priority                                 : NORMAL
    GNUTLS support                               : YES 3.8.4
      GNUTLS crypto                              : YES
    libgcrypt                                    : NO
    nettle                                       : NO
    SM4 ALG support                              : NO
    AF_ALG support                               : NO
    rng-none                                     : NO
    Linux keyring                                : NO
    Linux keyutils                               : NO

  User interface
    Cocoa support                                : YES
    SDL support                                  : YES 2.30.3
    SDL image support                            : NO
    GTK support                                  : YES
    pixman                                       : YES 0.42.2
    VTE support                                  : NO
    PNG support                                  : YES 1.6.43
    VNC support                                  : YES
    VNC SASL support                             : YES
    VNC JPEG support                             : YES 3.0.3
    spice protocol support                       : YES 0.14.4
      spice server support                       : YES 0.15.2
    curses support                               : YES
    brlapi support                               : NO

  Graphics backends
    VirGL support                                : YES 1.0.1
    Rutabaga support                             : NO

  Audio backends
    CoreAudio support                            : YES
    PipeWire support                             : NO
    JACK support                                 : NO

  Network backends
    vmnet.framework support                      : YES
    AF_XDP support                               : NO
    slirp support                                : YES 4.8.0
    vde support                                  : YES
    netmap support                               : NO
    l2tpv3 support                               : NO

  Dependencies
    libtasn1                                     : YES 4.19.0
    PAM                                          : YES
    iconv support                                : YES
    blkio support                                : NO
    curl support                                 : YES 8.4.0
    Multipath support                            : NO
    Linux AIO support                            : NO
    Linux io_uring support                       : NO
    ATTR/XATTR support                           : NO
    RDMA support                                 : NO
    fdt support                                  : YES
    libcap-ng support                            : NO
    bpf support                                  : NO
    rbd support                                  : NO
    smartcard support                            : NO
    U2F support                                  : NO
    libusb                                       : YES 1.0.27
    usb net redir                                : YES 0.14.0
    OpenGL support (epoxy)                       : YES 1.5.11
    GBM                                          : NO
    libiscsi support                             : NO
    libnfs support                               : NO
    seccomp support                              : NO
    GlusterFS support                            : NO
    hv-balloon support                           : YES
    TPM support                                  : YES
    libssh support                               : YES 0.10.6
    lzo support                                  : YES
    snappy support                               : YES
    bzip2 support                                : YES
    lzfse support                                : NO
    zstd support                                 : YES 1.5.6
    NUMA host support                            : NO
    capstone                                     : YES 5.0.1
    libpmem support                              : NO
    libdaxctl support                            : NO
    libudev                                      : NO
    FUSE lseek                                   : NO
    selinux                                      : NO
    libdw                                        : NO

  Subprojects
    berkeley-softfloat-3                         : YES
    berkeley-testfloat-3                         : YES
    keycodemapdb                                 : YES

  User defined options
    Native files                                 : config-meson.cross
    prefix                                       : /Users/mbp151/newqemu/build/qemu/../..
    b_pie                                        : false
    docs                                         : enabled
    plugins                                      : true

Found ninja-1.12.1 at /Users/mbp151/newqemu/depot_tools/ninja
Running postconf script '/Users/mbp151/newqemu/build/qemu/pyvenv/bin/python3 /Users/mbp151/newqemu/source/qemu/scripts/symlink-install-tree.py'
+ meson install

ERROR: Build data file '/Users/mbp151/newqemu/build/qemu/meson-private/build.dat' references functions or classes that don't exist. This probably means that it was generated with an old version of meson. Consider reconfiguring the directory with "meson setup --reconfigure".

@kode54
Copy link

kode54 commented Jun 9, 2024

clang 15.0.0

Thanks, google made me think that's too old by showing me results from someone using a 2018 machine, which is likely still a supported Intel platform. Could have saved myself some embarrassment by logging into my own Mac and checking what current Xcode is running, which is still 15.0.0.

@akihikodaki
Copy link
Author

@startergo

ERROR: Build data file '/Users/mbp151/newqemu/build/qemu/meson-private/build.dat' references functions or classes that don't exist. This probably means that it was generated with an old version of meson. Consider reconfiguring the directory with "meson setup --reconfigure".

Wipe your build directory.

@startergo
Copy link

I am always starting from scratch.

@akihikodaki
Copy link
Author

@startergo I have just updated the script so try with the latest one. This replaces meson install with make -j$(nproc) install for QEMU to make sure we use Meson QEMU bundles.

@startergo
Copy link

@startergo I have just updated the script so try with the latest one. This replaces meson install with make -j$(nproc) install for QEMU to make sure we use Meson QEMU bundles.

This time it built successfully thanks

@startergo
Copy link

How can I increase the resolution?
image

@akihikodaki
Copy link
Author

@startergo Use a normal display configuration application on the guest. It should list the native resolution if it's working properly.

@startergo
Copy link

If I run:

Macintosh:~ vagrant$  glxgears -info
No matching pixelformats found, perhaps try setting LIBGL_ALLOW_SOFTWARE=true
Abort trap: 6

@akihikodaki So I can only run glxgears through software but not virgl ?

LIBGL_ALLOW_SOFTWARE=true glxgears -info
GL_RENDERER   = Apple Software Renderer
GL_VERSION    = 2.1 APPLE-9.6.5
GL_VENDOR     = Apple Computer, Inc.
GL_EXTENSIONS = GL_ARB_color_buffer_float GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_instanced_arrays GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_seamless_cube_map GL_ARB_shader_objects GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shadow GL_ARB_shadow_ambient GL_ARB_sync GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_mirrored_repeat GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_transpose_matrix GL_ARB_vertex_array_bgra GL_ARB_vertex_blend GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_window_pos GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_clip_volume_hint GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_depth_bounds_test GL_EXT_draw_buffers2 GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture_array GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc GL_EXT_texture_env_add GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_rectangle GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_timer_query GL_EXT_transform_feedback GL_EXT_vertex_array_bgra GL_APPLE_aux_depth_stencil GL_APPLE_client_storage GL_APPLE_element_array GL_APPLE_fence GL_APPLE_float_pixels GL_APPLE_flush_buffer_range GL_APPLE_flush_render GL_APPLE_packed_pixels GL_APPLE_pixel_buffer GL_APPLE_rgb_422 GL_APPLE_row_bytes GL_APPLE_specular_vector GL_APPLE_texture_range GL_APPLE_transform_hint GL_APPLE_vertex_array_object GL_APPLE_vertex_array_range GL_APPLE_vertex_point_size GL_APPLE_vertex_program_evaluators GL_APPLE_ycbcr_422 GL_ATI_separate_stencil GL_ATI_texture_compression_3dc GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_ATI_texture_mirror_once GL_IBM_rasterpos_clip GL_NV_blend_square GL_NV_conditional_render GL_NV_depth_clamp GL_NV_fog_distance GL_NV_light_max_exponent GL_NV_texgen_reflection GL_NV_texture_barrier GL_SGIS_generate_mipmap GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod 
VisualID 107, 0x6b
1485 frames in 5.0 seconds = 296.410 FPS
1276 frames in 5.0 seconds = 254.867 FPS
1419 frames in 5.0 seconds = 283.708 FPS
2100 frames in 5.0 seconds = 419.879 FPS
^C

@akihikodaki
Copy link
Author

@startergo You are running glxgears on macOS so virgl is not used.

@startergo
Copy link

So there is no Virgl acceleration for macOS guests just Linux?

@kode54
Copy link

kode54 commented Jun 13, 2024

macOS does not have a video driver for virgl. Pretty much the only thing that does is Linux, and maybe an installable driver for Windows with limited functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment