Skip to content

virtmem: include OSCacheControl.h on all Apple platforms#521

Open
avwohl wants to merge 1 commit into
asmjit:masterfrom
avwohl:iospharo-catalyst
Open

virtmem: include OSCacheControl.h on all Apple platforms#521
avwohl wants to merge 1 commit into
asmjit:masterfrom
avwohl:iospharo-catalyst

Conversation

@avwohl
Copy link
Copy Markdown

@avwohl avwohl commented May 17, 2026

sys_icache_invalidate() is called by VirtMem::flushInstructionCache on every Apple SDK (iOS, Mac Catalyst, tvOS, watchOS, macOS), but the #include <libkern/OSCacheControl.h> is currently guarded by TARGET_OS_OSX. On Mac Catalyst (TARGET_OS_OSX=0, TARGET_OS_MACCATALYST=1) this fails to compile with "undeclared identifier sys_icache_invalidate".

This patch moves the include out of the TARGET_OS_OSX guard. The header is available on every Apple SDK so the unconditional include is safe.

Verified on Mac Catalyst arm64 (Xcode 26 / macOS 26.5 SDK) — fixes the build break.

sys_icache_invalidate() is needed for icache flushing on iOS, Mac
Catalyst, and macOS — not just OSX.  Upstream gates the include
behind TARGET_OS_OSX, which breaks Mac Catalyst builds with
"undeclared identifier 'sys_icache_invalidate'".  Move the include
out of the TARGET_OS_OSX block so all Apple SDKs get it.

Used by avwohl/iospharo via submodule pin.
avwohl pushed a commit to avwohl/iospharo that referenced this pull request May 17, 2026
asmjit/asmjit#521 — virtmem: include
OSCacheControl.h on all Apple platforms.  State: OPEN, awaiting
maintainer review.

Replaced the ready-to-fire `gh pr create` block with the PR URL +
follow-up steps (what to do on merge vs rejection).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant