Build failure on macOS with jack
qemu 6.2.0 fails to build on macOS if jack is installed. The error is:
/usr/bin/clang -m64 -mcx16 -Ilibcommon.fa.p -I../qemu-6.2.0/dtc/libfdt -I../qemu-6.2.0/slirp -I../qemu-6.2.0/slirp/src -I/opt/local/include/pixman-1 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include/gio-unix-2.0 -I/opt/local/include/libusb-1.0 -fcolor-diagnostics -Wall -Winvalid-pch -std=gnu11 -O2 -g -iquote . -iquote qemu-6.2.0 -iquote qemu-6.2.0/include -iquote qemu-6.2.0/disas/libvixl -iquote qemu-6.2.0/tcg/i386 -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 -fstack-protector-strong -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64 -MD -MQ libcommon.fa.p/audio_jackaudio.c.o -MF libcommon.fa.p/audio_jackaudio.c.o.d -o libcommon.fa.p/audio_jackaudio.c.o -c ../qemu-6.2.0/audio/jackaudio.c
../qemu-6.2.0/audio/jackaudio.c:634:33: error: too many arguments to function call, expected 1, have 2
pthread_setname_np(*thread, "jack-client");
~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/pthread.h:510:5: note: 'pthread_setname_np' declared here
int pthread_setname_np(const char*);
^
1 error generated.
jackaudio.c assumes pthread_setname_np
takes two arguments. On macOS, it appears to take only one argument. There is code in meson.build to detect which version of pthread_setname_np
the OS has but the code in jackaudio.c doesn't use it.
This problem was originally reported to MacPorts here: https://trac.macports.org/ticket/64246