[MacPorts] #70694: qemu @9.1.0: error: implicit declaration of function 'pthread_jit_write_protect_np' is invalid in C99 [-Werror, -Wimplicit-function-declaration]

MacPorts noreply at macports.org
Sun Aug 16 01:51:14 UTC 2026


#70694: qemu @9.1.0: error: implicit declaration of function
'pthread_jit_write_protect_np' is invalid in C99 [-Werror,-Wimplicit-
function-declaration]
------------------------------+-------------------------
  Reporter:  tom-programming  |      Owner:  herbygillot
      Type:  defect           |     Status:  closed
  Priority:  Normal           |  Milestone:
 Component:  ports            |    Version:  2.10.1
Resolution:  fixed            |   Keywords:  legacy-os
      Port:  qemu             |
------------------------------+-------------------------
Changes (by herbygillot):

 * owner:  (none) => herbygillot
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"aae3f6252a00ef40c3dbdcdb4bf0fa08c4c7f83a/macports-ports"
 aae3f6252a00ef40c3dbdcdb4bf0fa08c4c7f83a/macports-ports] (master):
 {{{
 #!ConfigurableCommitTicketReference repository="macports-ports"
 revision="aae3f6252a00ef40c3dbdcdb4bf0fa08c4c7f83a"
 qemu: fix build on macOS 11 and earlier

 qemu 11.1.0 fails on every buildbot below macOS 12, from 10.6 through 11
 on both arches, while 12 and later are green apart from an unrelated
 arm64 failure on 12.  The cutoff falls where Apple's macOS 11 and 12 API
 additions and inclusive-language renames landed.  This is not a
 compiler-selection problem: the port already sets compiler.blacklist
 {clang < 1500} and is therefore already building with macports-clang.
 Each failure is a symbol the older SDK does not declare, and since the
 port declares no floor and carries deliberate support back to darwin 10,
 these are regressions rather than unsupported setups.

 Adds seven patchfiles guarding APIs that older SDKs lack:
 pthread_jit_write_protect_np (macOS 11), IOMainPort (12),
 kAudioObjectPropertyElementMain (12), -[NSScreen safeAreaInsets] (12),
 HV_DENIED (11), HV_DEADLINE_FOREVER with hv_vcpu_run_until (11 and
 10.15), and timespec_get/TIME_UTC (10.15); and disables vmnet below
 darwin 20.  Every threshold was read from Apple's own SDK headers on the
 target systems rather than from documentation.  Constants are guarded on
 MAC_OS_X_VERSION_MAX_ALLOWED, since they need only be declared; functions
 and Objective-C methods on MAC_OS_X_VERSION_MIN_REQUIRED, since referring
 to them below the deployment target would fail at run time even when a
 newer SDK declares them.

 Two are not simple defines.  hv_vcpu_run_until() is annotated __HV_10_15,
 so below 10.15 the function itself is absent and no #define can help; the
 shim falls back to hv_vcpu_run(), which Apple's macOS 11 header documents
 as its equivalent for an infinite deadline, keeping HVF acceleration
 instead of dropping those hosts to TCG.  vmnet is an upstream detection
 bug: meson probes for VMNET_BRIDGED_MODE, which 10.15 does have, and then
 compiles net/vmnet-* against macOS 11 symbols that it does not.

 Verified by full clean builds on 10.14.6, 10.15.7 and 11.7.10 with zero
 patch failures and HVF present in each.  Because the macOS 11 test host
 carried an SDK newer than its OS, a second build there pinned to an 11.3
 SDK exercises the other branch of the macOS 12 guards.  Symbol selection
 was confirmed against the built binaries.  Not tested below 10.14, on
 arm64, or with a running guest.

 Closes: https://trac.macports.org/ticket/70694
 Closes: https://trac.macports.org/ticket/72042
 Closes: https://trac.macports.org/ticket/70482
 Assisted-by: Claude:claude-opus-5
 Co-Authored-By: Claude Opus 5 <noreply at anthropic.com>
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/70694#comment:9>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list