QEMU 7.2.0 - Failed compilation under MacOS

Host environment

  • Operating system: MacOS
  • OS/kernel version: 13.1
  • Architecture: Apple M1 Pro
  • QEMU flavor: (qemu-system-x86_64, qemu-aarch64, qemu-img, etc.)
  • QEMU version: 7.2.0
  • QEMU command line:

Description of problem

I downloaded and tried to build QEMU from git following the instructions from here: https://www.qemu.org/download/

(I successfully installed QEMU with homebrew later, but I still want to figure out why my compilation failed.)

Steps to reproduce

git clone https://gitlab.com/qemu-project/qemu.git
cd qemu
git submodule init
git submodule update --recursive
./configure
make

Additional information

With ./configure I got:

Using './build' as the directory for build output
Disabling PIE due to missing toolchain support
The Meson build system
Version: 0.61.5
Source dir: /Users/xxx/qemu
Build dir: /Users/xxx/qemu/build
Build type: native build
Project name: qemu
Project version: 7.2.50
C compiler for the host machine: cc (clang 14.0.0 "Apple clang version 14.0.0 (clang-1400.0.29.202)")
C linker for the host machine: cc ld64 820.1
Host machine cpu family: aarch64
Host machine cpu: arm64
Program scripts/symlink-install-tree.py found: YES (/opt/homebrew/opt/python@3.10/bin/python3.10 /Users/xxx/qemu/scripts/symlink-install-tree.py)
Program sh found: YES (/bin/sh)
Program python3 found: YES (/opt/homebrew/opt/python@3.10/bin/python3.10)
Program bzip2 found: YES (/usr/bin/bzip2)
Program iasl found: NO
Compiler for C supports link arguments -Wl,-z,relro: NO 
Compiler for C supports link arguments -Wl,-z,now: NO 
C++ compiler for the host machine: c++ (clang 14.0.0 "Apple clang version 14.0.0 (clang-1400.0.29.202)")
C++ linker for the host machine: c++ ld64 820.1
Compiler for C++ supports link arguments -Wl,--warn-common: NO 
Objective-C compiler for the host machine: clang (clang 14.0.0)
Objective-C linker for the host machine: clang ld64 820.1
Program cgcc found: NO
Library m found: YES
Run-time dependency threads found: YES
Library util found: YES
Run-time dependency appleframeworks found: YES (CoreFoundation)
Run-time dependency appleframeworks found: YES (IOKit)
Run-time dependency appleframeworks found: YES (Hypervisor)
Found pkg-config: /opt/homebrew/bin/pkg-config (0.29.2)
Run-time dependency gio-2.0 found: YES 2.74.4
Program /opt/homebrew/Cellar/glib/2.74.4/bin/gdbus-codegen found: YES (/opt/homebrew/Cellar/glib/2.74.4/bin/gdbus-codegen)
Run-time dependency gio-unix-2.0 found: YES 2.74.4
Run-time dependency pixman-1 found: YES 0.42.2
Run-time dependency zlib found: YES 1.2.11
Has header "libaio.h" : NO 
Run-time dependency liburing found: NO (tried pkgconfig)
Run-time dependency libnfs found: NO (tried pkgconfig)
Has header "attr/xattr.h" : NO 
Run-time dependency appleframeworks found: YES (Cocoa, CoreVideo)
Run-time dependency appleframeworks found: YES (vmnet)
Header <vmnet/vmnet.h> has symbol "VMNET_BRIDGED_MODE" with dependency appleframeworks: YES 
Run-time dependency libseccomp found: NO (tried pkgconfig)
Has header "cap-ng.h" : NO 
Run-time dependency xkbcommon found: NO (tried pkgconfig)
Run-time dependency slirp found: NO (tried pkgconfig)
Has header "libvdeplug.h" : NO 
Run-time dependency jack found: NO (tried pkgconfig)
Run-time dependency sndio found: NO (tried pkgconfig)
Run-time dependency spice-protocol found: NO (tried pkgconfig)
Run-time dependency spice-server found: NO (tried pkgconfig)
Library rt found: NO
Run-time dependency libiscsi found: NO (tried pkgconfig)
Run-time dependency libzstd found: NO (tried pkgconfig)
Run-time dependency virglrenderer found: NO (tried pkgconfig)
Run-time dependency blkio found: NO (tried pkgconfig)
Run-time dependency libcurl found: YES 7.84.0
Run-time dependency ncursesw found: YES 5.7.20081102
Has header "brlapi.h" : NO 
sdl2-config found: NO
Run-time dependency sdl2 found: NO (tried pkgconfig, config-tool and framework)
Library rados found: NO
Has header "rbd/librbd.h" : NO 
Run-time dependency glusterfs-api found: NO (tried pkgconfig)
Run-time dependency libssh found: NO (tried pkgconfig)
Has header "bzlib.h" : YES 
Library bz2 found: YES
Has header "lzfse.h" : NO 
Has header "sys/soundcard.h" : NO 
Run-time dependency appleframeworks found: YES (CoreAudio)
Run-time dependency epoxy found: NO (tried pkgconfig)
Has header "epoxy/egl.h" with dependency epoxy: NO 
Run-time dependency gnutls found: NO (tried pkgconfig)
Run-time dependency gnutls found: NO (tried pkgconfig)
libgcrypt-config found: NO need ['>=1.8']
Run-time dependency libgcrypt found: NO (tried config-tool)
Run-time dependency nettle found: NO (tried pkgconfig)
Run-time dependency gmp found: NO (tried pkgconfig)
Run-time dependency gtk+-3.0 found: NO (tried pkgconfig)
Run-time dependency libpng found: NO (tried pkgconfig)
Run-time dependency libjpeg found: NO (tried pkgconfig)
Has header "sasl/sasl.h" : YES 
Library sasl2 found: YES
Has header "security/pam_appl.h" : YES 
Library pam found: YES
Has header "snappy-c.h" : NO 
Has header "lzo/lzo1x.h" : NO 
Has header "numa.h" : NO 
Library ibumad found: NO
Has header "rdma/rdma_cma.h" : NO 
Library ibverbs found: NO
Run-time dependency xencontrol found: NO (tried pkgconfig)
Library xenstore found: NO
Library xenctrl found: NO
Library xendevicemodel found: NO
Library xenforeignmemory found: NO
Library xengnttab found: NO
Library xenevtchn found: NO
Library xentoolcore found: NO
Run-time dependency libcacard found: NO (tried pkgconfig)
Run-time dependency u2f-emu found: NO (tried pkgconfig)
Run-time dependency canokey-qemu found: NO (tried pkgconfig)
Run-time dependency libusbredirparser-0.5 found: NO (tried pkgconfig)
Run-time dependency libusb-1.0 found: NO (tried pkgconfig)
Run-time dependency libpmem found: NO (tried pkgconfig)
Run-time dependency libdaxctl found: NO (tried pkgconfig)
Run-time dependency libkeyutils found: NO (tried pkgconfig)
Checking for function "gettid" : NO 
Run-time dependency libselinux found: NO (tried pkgconfig)
Run-time dependency fuse3 found: NO (tried pkgconfig)
Run-time dependency libbpf found: NO (tried pkgconfig)
Has header "IOKit/storage/IOMedia.h" : YES 
Checking for function "pthread_fchdir_np" : YES 
Has header "sys/epoll.h" : NO 
Has header "linux/magic.h" : NO 
Has header "valgrind/valgrind.h" : NO 
Has header "linux/btrfs.h" : NO 
Has header "libdrm/drm.h" : NO 
Has header "pty.h" : NO 
Has header "sys/disk.h" : YES 
Has header "sys/ioccom.h" : YES 
Has header "sys/kcov.h" : NO 
Checking for function "close_range" : NO 
Checking for function "accept4" : NO 
Checking for function "clock_adjtime" : NO 
Checking for function "dup3" : NO 
Checking for function "fallocate" : NO 
Checking for function "posix_fallocate" : NO 
Checking for function "posix_memalign" : YES 
Checking for function "_aligned_malloc" : NO 
Checking for function "valloc" : YES 
Checking for function "memalign" : NO 
Checking for function "ppoll" : NO 
Checking for function "preadv" : YES 
Checking for function "pthread_fchdir_np" : YES (cached)
Checking for function "sendfile" : YES 
Checking for function "setns" : NO 
Checking for function "syncfs" : NO 
Checking for function "sync_file_range" : NO 
Checking for function "timerfd_create" : NO 
Checking for function "copy_file_range" : NO 
Checking for function "getifaddrs" : YES 
Checking for function "openpty" with dependency -lutil: YES 
Checking for function "strchrnul" : NO 
Checking for function "system" : YES 
Header <byteswap.h> has symbol "bswap_32" : NO 
Header <sys/epoll.h> has symbol "epoll_create1" : NO 
Header <linux/falloc.h> has symbol "FALLOC_FL_PUNCH_HOLE" : NO 
Header <linux/falloc.h> has symbol "FALLOC_FL_ZERO_RANGE" : NO 
Has header "linux/fiemap.h" : NO 
Checking for function "getrandom" : NO 
Header <sys/inotify.h> has symbol "inotify_init" : NO 
Header <sys/inotify.h> has symbol "inotify_init1" : NO 
Header <machine/bswap.h> has symbol "bswap32" : NO 
Header <sys/prctl.h> has symbol "PR_SET_TIMERSLACK" : NO 
Header <linux/rtnetlink.h> has symbol "IFLA_PROTO_DOWN" : NO 
Header <sys/sysmacros.h> has symbol "makedev" : NO 
Header <getopt.h> has symbol "optreset" : YES 
Header <netinet/in.h> has symbol "IPPROTO_MPTCP" : NO 
Header <sys/mount.h> has symbol "FSCONFIG_SET_FLAG" : NO 
Checking whether type "struct sigevent" has member "sigev_notify_thread_id" : NO 
Checking whether type "struct stat" has member "st_atim" : NO 
Checking for type "struct iovec" : YES 
Checking for type "struct utmpx" : YES 
Checking for type "struct mmsghdr" : NO 
Header <linux/vm_sockets.h> has symbol "AF_VSOCK" : NO 
Program scripts/minikconf.py found: YES (/opt/homebrew/opt/python@3.10/bin/python3.10 /Users/xxx/qemu/scripts/minikconf.py)
Configuring x86_64-softmmu-config-target.h using configuration
Configuring x86_64-softmmu-config-devices.mak with command
Reading depfile: /Users/xxx/qemu/build/meson-private/x86_64-softmmu-config-devices.mak.d
Configuring x86_64-softmmu-config-devices.h using configuration
Program scripts/make-config-poison.sh found: YES (/Users/xxx/qemu/scripts/make-config-poison.sh)
Run-time dependency capstone found: NO (tried pkgconfig)
Library fdt found: NO
Configuring config-host.h using configuration
Program scripts/hxtool found: YES (/Users/xxx/qemu/scripts/hxtool)
Program scripts/shaderinclude.pl found: YES (/usr/bin/env perl /Users/xxx/qemu/scripts/shaderinclude.pl)
Program scripts/qapi-gen.py found: YES (/opt/homebrew/opt/python@3.10/bin/python3.10 /Users/xxx/qemu/scripts/qapi-gen.py)
Program scripts/qemu-version.sh found: YES (/Users/xxx/qemu/scripts/qemu-version.sh)
Program scripts/decodetree.py found: YES (/opt/homebrew/opt/python@3.10/bin/python3.10 /Users/xxx/qemu/scripts/decodetree.py)
Program ../scripts/modules/module_block.py found: YES (/opt/homebrew/opt/python@3.10/bin/python3.10 /Users/xxx/qemu/block/../scripts/modules/module_block.py)
Program ../scripts/block-coroutine-wrapper.py found: YES (/opt/homebrew/opt/python@3.10/bin/python3.10 /Users/xxx/qemu/block/../scripts/block-coroutine-wrapper.py)
Configuring qemu-plugins-ld64.symbols with command
Program scripts/modinfo-collect.py found: YES (/Users/xxx/qemu/scripts/modinfo-collect.py)
Program scripts/modinfo-generate.py found: YES (/Users/xxx/qemu/scripts/modinfo-generate.py)
Program nm found: YES
Program scripts/undefsym.py found: YES (/opt/homebrew/opt/python@3.10/bin/python3.10 /Users/xxx/qemu/scripts/undefsym.py)
Program scripts/feature_to_c.sh found: YES (/bin/sh /Users/xxx/qemu/scripts/feature_to_c.sh)
Program scripts/entitlement.sh found: YES (/Users/xxx/qemu/scripts/entitlement.sh)
Configuring 50-edk2-i386-secure.json using configuration
Configuring 50-edk2-x86_64-secure.json using configuration
Configuring 60-edk2-aarch64.json using configuration
Configuring 60-edk2-arm.json using configuration
Configuring 60-edk2-i386.json using configuration
Configuring 60-edk2-x86_64.json using configuration
Program qemu-keymap found: NO
Program sphinx-build-3 sphinx-build found: NO
Program bash found: NO found 3.2.57 but need: '>= 4.0' (/bin/bash)
Message: bash >= v4.0 not available ==> Disabled the qemu-iotests.
Program diff found: YES (/usr/bin/diff)
Program dbus-daemon found: NO
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency gvnc-1.0 found: NO (tried pkgconfig, framework and cmake)
Program initrd-stress.sh found: YES (/Users/xxx/qemu/tests/migration/initrd-stress.sh)
Build targets in project: 499

qemu 7.2.50

  Directories
    Install prefix               : /usr/local
    BIOS directory               : share/qemu
    firmware path                : share/qemu-firmware
    binary directory             : /usr/local/bin
    library directory            : /usr/local/lib
    module directory             : lib/qemu
    libexec directory            : /usr/local/libexec
    include directory            : /usr/local/include
    config directory             : /usr/local/etc
    local state directory        : /var/local
    Manual directory             : /usr/local/share/man
    Doc directory                : /usr/local/share/doc
    Build directory              : /Users/xxx/qemu/build
    Source path                  : /Users/xxx/qemu
    GIT submodules               : ui/keycodemapdb meson tests/fp/berkeley-testfloat-3 tests/fp/berkeley-softfloat-3 dtc

  Host binaries
    git                          : git
    make                         : make
    python                       : /opt/homebrew/opt/python@3.10/bin/python3.10 (version: 3.10)
    sphinx-build                 : NO
    iasl                         : NO
    genisoimage                  : 

  Configurable features
    Documentation                : NO
    system-mode emulation        : YES
    user-mode emulation          : NO
    block layer                  : YES
    Install blobs                : YES
    module support               : NO
    fuzzing support              : NO
    Audio drivers                : coreaudio
    Trace backends               : log
    D-Bus display                : NO
    QOM debugging                : NO
    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                     : aarch64
    host endianness              : little
    C compiler                   : cc
    Host C compiler              : cc
    C++ compiler                 : c++
    Objective-C compiler         : clang
    CFLAGS                       : -O2 -g
    CXXFLAGS                     : -O2 -g
    OBJCFLAGS                    : -O2 -g
    QEMU_CFLAGS                  : -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -Wno-gnu-variable-sized-type-not-at-end -fstack-protector-strong
    QEMU_CXXFLAGS                : -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wundef -Wwrite-strings -fno-strict-aliasing -fno-common -fwrapv -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -Wno-gnu-variable-sized-type-not-at-end -fstack-protector-strong
    QEMU_OBJCFLAGS               : -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -Wno-gnu-variable-sized-type-not-at-end
    QEMU_LDFLAGS                 : -fstack-protector-strong
    profiler                     : NO
    link-time optimization (LTO) : NO
    PIE                          : NO
    static build                 : NO
    malloc trim support          : NO
    membarrier                   : NO
    debug stack usage            : NO
    mutex debugging              : NO
    memory allocator             : system
    avx2 optimization            : NO
    avx512f optimization         : NO
    gprof enabled                : NO
    gcov                         : NO
    thread sanitizer             : NO
    CFI support                  : NO
    strip binaries               : NO
    sparse                       : NO
    mingw32 support              : NO

  Targets and accelerators
    KVM support                  : NO
    HAX support                  : NO
    HVF support                  : NO
    WHPX support                 : NO
    NVMM support                 : NO
    Xen support                  : NO
    TCG support                  : YES
    TCG backend                  : native (aarch64)
    TCG plugins                  : YES
    TCG debug enabled            : NO
    target list                  : x86_64-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 support               : YES
    build virtiofs daemon        : NO
    Live block migration         : YES
    replication support          : YES
    bochs support                : YES
    cloop support                : YES
    dmg support                  : YES
    qcow v1 support              : YES
    vdi support                  : YES
    vvfat support                : YES
    qed support                  : YES
    parallels support            : YES
    FUSE exports                 : NO
    VDUSE block exports          : NO

  Crypto
    TLS priority                 : NORMAL
    GNUTLS support               : NO
    libgcrypt                    : NO
    nettle                       : NO
    AF_ALG support               : NO
    rng-none                     : NO
    Linux keyring                : NO

  Dependencies
    Cocoa support                : YES
    vmnet.framework support      : YES
    SDL support                  : NO
    SDL image support            : NO
    GTK support                  : NO
    pixman                       : YES 0.42.2
    VTE support                  : NO
    slirp support                : NO
    libtasn1                     : NO
    PAM                          : YES
    iconv support                : YES
    curses support               : YES
    virgl support                : NO
    blkio support                : NO
    curl support                 : YES 7.84.0
    Multipath support            : NO
    PNG support                  : NO
    VNC support                  : YES
    VNC SASL support             : YES
    VNC JPEG support             : NO
    CoreAudio support            : YES
    JACK support                 : NO
    brlapi support               : NO
    vde support                  : NO
    netmap support               : NO
    l2tpv3 support               : NO
    Linux AIO support            : NO
    Linux io_uring support       : NO
    ATTR/XATTR support           : NO
    RDMA support                 : NO
    PVRDMA support               : NO
    fdt support                  : internal
    libcap-ng support            : NO
    bpf support                  : NO
    spice protocol support       : NO
    rbd support                  : NO
    smartcard support            : NO
    U2F support                  : NO
    libusb                       : NO
    usb net redir                : NO
    OpenGL support (epoxy)       : NO
    GBM                          : NO
    libiscsi support             : NO
    libnfs support               : NO
    seccomp support              : NO
    GlusterFS support            : NO
    TPM support                  : YES
    libssh support               : NO
    lzo support                  : NO
    snappy support               : NO
    bzip2 support                : YES
    lzfse support                : NO
    zstd support                 : NO
    NUMA host support            : NO
    capstone                     : NO
    libpmem support              : NO
    libdaxctl support            : NO
    libudev                      : NO
    FUSE lseek                   : NO
    selinux                      : NO

  User defined options
    Native files                 : config-meson.cross
    prefix                       : /usr/local
    b_pie                        : false
    vfio_user_server             : disabled

Found ninja-1.11.1 at /opt/homebrew/bin/ninja
Running postconf script '/opt/homebrew/opt/python@3.10/bin/python3.10 /Users/xxx/qemu/scripts/symlink-install-tree.py'

With make I got:

changing dir to build for /Library/Developer/CommandLineTools/usr/bin/make ""...
  GIT     ui/keycodemapdb meson tests/fp/berkeley-testfloat-3 tests/fp/berkeley-softfloat-3 dtc
[1/75] Generating qemu-version.h with a custom command (wrapped by meson to capture output)
changing dir to build for /Library/Developer/CommandLineTools/usr/bin/make ""...
  GIT     ui/keycodemapdb meson tests/fp/berkeley-testfloat-3 tests/fp/berkeley-softfloat-3 dtc
[1/75] Generating qemu-version.h with a custom command (wrapped by meson to capture output)
changing dir to build for /Library/Developer/CommandLineTools/usr/bin/make ""...
/opt/homebrew/bin/ninja  build.ninja && touch build.ninja.stamp
ninja: no work to do.
/opt/homebrew/bin/python3 -B /Users/xxx/qemu/meson/meson.py introspect --targets --tests --benchmarks | /opt/homebrew/bin/python3 -B scripts/mtest2make.py > Makefile.mtest
  GIT     ui/keycodemapdb meson tests/fp/berkeley-testfloat-3 tests/fp/berkeley-softfloat-3 dtc
  GIT     ui/keycodemapdb meson tests/fp/berkeley-testfloat-3 tests/fp/berkeley-softfloat-3 dtc
[1/2455] Generating config-poison.h with a custom command (wrapped by meson to capture output)
[2/2455] Compiling C object libfdt.a.p/dtc_libfdt_fdt.c.o
[3/2455] Compiling C object libfdt.a.p/dtc_libfdt_fdt_ro.c.o
[4/2455] Compiling C object libfdt.a.p/dtc_libfdt_fdt_wip.c.o
[5/2455] Compiling C object libfdt.a.p/dtc_libfdt_fdt_sw.c.o
... (no error)
[2455/2455] Linking target tests/qtest/readconfig-test
changing dir to build for /Library/Developer/CommandLineTools/usr/bin/make ""...
  GIT     ui/keycodemapdb meson tests/fp/berkeley-testfloat-3 tests/fp/berkeley-softfloat-3 dtc
[1/48] Generating qemu-version.h with a custom command (wrapped by meson to capture output)
[2/34] Generating tests/include/QAPI test (include) with a custom command