Opened 3 years ago

Closed 17 months ago

#64246 closed defect (fixed)

qemu @6.2.0: uses jack opportunistically, which fails

Reported by: mouse07410 (Mouse) Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc: mascguy (Christopher Nielsen), chadcatlett (Chad Catlett), cooljeanius (Eric Gallager)
Port: qemu

Description

macOS Big Sur 11.6.2. Xcode-13.2, current Macports.

Error:

.  .  .  .  .
:info:build /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 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_emulators_qemu/qemu/work/qemu-6.2.0 -iquote /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_emulators_qemu/qemu/work/qemu-6.2.0/include -iquote /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_emulators_qemu/qemu/work/qemu-6.2.0/disas/libvixl -iquote /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_emulators_qemu/qemu/work/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
:info:build ../qemu-6.2.0/audio/jackaudio.c:634:33: error: too many arguments to function call, expected 1, have 2
:info:build     pthread_setname_np(*thread, "jack-client");
:info:build     ~~~~~~~~~~~~~~~~~~          ^~~~~~~~~~~~~
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/pthread.h:510:5: note: 'pthread_setname_np' declared here
:info:build int     pthread_setname_np(const char*);
:info:build         ^
:info:build 1 error generated.
.  .  .  .  .

Currently installed qemu that Macports unsuccessfully tried to upgrade:

$ port installed qemu
The following ports are currently installed:
  qemu @6.1.0_0+cocoa+lzfse+lzo+ssh+target_arm+target_i386+target_x86_64+usb+zstd (active)

Full log attached.

Attachments (1)

qemu.log.txt (2.7 MB) - added by mouse07410 (Mouse) 3 years ago.
main.log of the build

Change History (10)

Changed 3 years ago by mouse07410 (Mouse)

Attachment: qemu.log.txt added

main.log of the build

comment:1 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: raimue removed
Owner: set to raimue
Status: newassigned
Summary: qemu build failureqemu @6.2.0: uses jack opportunistically, which fails
Version: 2.7.1

We have successful builds of qemu on the buildbot system, but I can confirm the build failure on Catalina when the jack port is installed. The qemu build seems to look for jack and use it if present, though the port doesn't declare a dependency on it. We should force the port not to use jack, even if it is present.

The other choice would be to add a jack dependency to qemu, but for the fact that, as you've found, it doesn't build. The code that uses jack assumes pthread_setname_np takes two arguments but on macOS it takes one. There is code in meson.build to detect which variant of pthread_setname_np the OS has, but the code that uses jack doesn't check that. This is an upstream bug that should be reported to the developers of qemu.

comment:2 in reply to:  1 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign:

This is an upstream bug that should be reported to the developers of qemu.

https://gitlab.com/qemu-project/qemu/-/issues/785

comment:3 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Looks like qemu has a bunch of features it will enable if the appropriate libraries are found. I didn't look at how many of them we are expecting to use in the portfile (based on what dependencies we set) and how many we aren't expecting. There is an option --without-default-features we could use to tell the build system only to enable things we explicitly tell it to. That might be wiser so that new features that are introduced in the future aren't unexpectedly enabled without the dependency having been added (which is what happened when jack support was added to qemu in 5.1.)

comment:4 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:5 Changed 3 years ago by chadcatlett (Chad Catlett)

Cc: chadcatlett added

comment:6 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

There's now a patch in the upstream issue to fix the build failure with jack, so we can now decide to go either way: either enable jack support in the qemu port, or force it not to find jack if it is installed.

Until we decide how to fix it, you can work around the problem by installing (or upgrading) with trace mode:

sudo port clean qemu
sudo port -t install qemu

or by deactivating jack before installing (or upgrading) qemu and reactivating it after:

sudo port clean qemu
sudo port -f deactivate jack
sudo port install qemu
sudo port activate jack

comment:7 Changed 3 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:8 Changed 3 years ago by cooljeanius (Eric Gallager)

heh, what a coincidence! Just as I was looking into this issue myself they pushed a commit that apparently fixes this: https://gitlab.com/qemu-project/qemu/-/commit/ead789eb46a7df4eaab9e14e29e1d0d2a379988d

comment:9 Changed 17 months ago by herbygillot (Herby Gillot)

Resolution: fixed
Status: assignedclosed

In ef95e8d8614e5aad0f141fb1ecaedbbe7bc9f687/macports-ports (master):

qemu: update to 8.0.2

  • support numerous image formats (qcow1, parallels, vdi, etc.) by default
  • build with compression formats (lzo, snappy, lzfse & zstd) by default
  • build with slirp support
  • use Python 3.11 Sphinx to build docs
  • disable linking against the jack audio library

Fixes: #67409
Fixes: #64246
See: #67549

Note: See TracTickets for help on using tickets.