Opened 11 months ago
Last modified 5 months ago
#72042 assigned defect
qemu @9.2.0: error: call to undeclared function 'IOMainPort'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
| Reported by: | chriskuku | Owned by: | raimue (Rainer Müller) |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | |
| Keywords: | Cc: | herbygillot (Herby Gillot), Dave-Allured (Dave Allured), ileadu (Marshall) | |
| Port: | qemu |
Description (last modified by jmroot (Joshua Root))
port install qemu fails (macOS BigSur, 11.7.10)
$ sudo port install qemu ---> Computing dependencies for qemu ---> Fetching archive for qemu ---> Attempting to fetch qemu-9.2.0_0+cocoa+curses+spice+spice_protocol+target_arm+target_i386+target_x86_64+usb+vnc.darwin_20.x86_64.tbz2 from https://fra.de.packages.macports.org/qemu ---> Attempting to fetch qemu-9.2.0_0+cocoa+curses+spice+spice_protocol+target_arm+target_i386+target_x86_64+usb+vnc.darwin_20.x86_64.tbz2 from https://packages.macports.org/qemu ---> Attempting to fetch qemu-9.2.0_0+cocoa+curses+spice+spice_protocol+target_arm+target_i386+target_x86_64+usb+vnc.darwin_20.x86_64.tbz2 from https://vie.at.packages.macports.org/qemu ---> Building qemu Error: Failed to build qemu: command execution failed Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_emulators_qemu/qemu/main.log for details. Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug. Error: Processing of port qemu failed $
Attachments (1)
Change History (7)
comment:1 Changed 11 months ago by jmroot (Joshua Root)
| Cc: | herbygillot added |
|---|---|
| Description: | modified (diff) |
| Owner: | set to raimue |
| Port: | qemu added |
| Status: | new → assigned |
Changed 11 months ago by jmroot (Joshua Root)
| Attachment: | main.log.bz2 added |
|---|
comment:2 follow-up: 4 Changed 11 months ago by jmroot (Joshua Root)
:info:build ../qemu-9.2.0/block/file-posix.c:3942:18: error: call to undeclared function 'IOMainPort'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] :info:build 3942 | kernResult = IOMainPort(MACH_PORT_NULL, &mainPort); :info:build | ^
Different function, but might effectively be a duplicate of #71857.
comment:3 Changed 11 months ago by Dave-Allured (Dave Allured)
| Cc: | Dave-Allured added |
|---|
comment:4 Changed 11 months ago by Dave-Allured (Dave Allured)
Replying to jmroot:
Different function, but might effectively be a duplicate of #71857.
Not really a duplicate. #71857 is originally about accessing the Hypervisor framework. This report for IOMainPort concerns file I/O. QEMU is strict about deprecating older macos versions. So these two tickets are about different deprecations, probably at different times.
Here is the QEMU commit that removed IOMainPort:
"Drop ifdef for macOS versions older than 12.0"
https://gitlab.com/qemu-project/qemu/-/commit/e9c9d8dc3ba993384bc9553b617120ad4717345c
Same issue filed for upstream. Note, "won't fix" for macOS < 12.0, unfortunately. They say that even 12.x and 13.x are no longer officially supported.
https://gitlab.com/qemu-project/qemu/-/issues/2694
comment:5 Changed 11 months ago by Dave-Allured (Dave Allured)
The discussion in #71857 leads to this patch, which I think would fix this particular IOMainPort build error on BigSur/OS 11:
https://github.com/koucyuu/qemu_catalina_patches/blob/master/patch-qemu-block-file-posix.diff
So how far does MacPorts want to go, patching QEMU to support older OS versions that upstream is actively discouraging? Tickets on both MacPorts and QEMU suggest ongoing interest within the legacy Mac user base.
comment:6 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)
| Cc: | ileadu added |
|---|---|
| Summary: | qemu port fails → qemu @9.2.0: error: call to undeclared function 'IOMainPort'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] |
MacPorts probably doesn't want to patch qemu to reinstate support for old OS versions that upstream has removed.
But we could introduce ports for older versions of qemu that would work on older OS versions.
Has duplicate #72665.

Please attach the main.log.