Skip to content

iphonesim HXCPP_ARM64: distinct LIBEXTRA/objdir, arm64 dll linker (follow-up to 3668203c) - #1343

Open
AxGord wants to merge 5 commits into
HaxeFoundation:masterfrom
soccertutor:bugfix/ios-simulator-arm64
Open

iphonesim HXCPP_ARM64: distinct LIBEXTRA/objdir, arm64 dll linker (follow-up to 3668203c)#1343
AxGord wants to merge 5 commits into
HaxeFoundation:masterfrom
soccertutor:bugfix/ios-simulator-arm64

Conversation

@AxGord

@AxGord AxGord commented May 11, 2026

Copy link
Copy Markdown

Summary

Rescoped after 3668203 — the core arm64 iOS simulator support
(-arch arm64 + -mios-simulator-version-min) landed upstream in
3668203, which supersedes the compiler-flag part of this PR. Upstream
master has been merged in and this branch's equivalent -target triple
sections were dropped in favor of upstream's approach.

What remains (8 insertions, 5 deletions across 2 files):

  • Distinct LIBEXTRA for arm64-sim (finish-setup.xml): with
    HXCPP_ARM64 set, simulator libs currently get the plain .iphonesim
    suffix — colliding with the i386 name. This PR names them
    .iphonesim-arm64 so arm64/x86_64/i386 simulator binaries can coexist
    (matters for multi-slice workflows and for Lime's NDLL naming).
  • Per-arch objdir (iphonesim-toolchain.xml): all simulator archs
    currently share obj/iphonesim/; switching arch without a clean
    rebuild mixes object files. arm64-sim gets obj/iphonesim…-arm64/.
  • dll linker arm64 (iphonesim-toolchain.xml): the dll linker
    still only emits -arch i386/-arch x86_64 — with HXCPP_ARM64 it
    produces an i386 dylib. Rarely hit (sim builds are static_link by
    default), but wrong; this adds the arm64 case with the same
    if/unless guards as the compiler.

With HXCPP_ARM64 unset, everything is byte-identical to master.

We've been carrying arm64-sim support in our soccertutor/hxcpp fork for
~1.5 years, used in production OpenFL+AIR apps that ship to iPad; built
and tested on Apple Silicon (M1 Pro) against Xcode 15/16 SDKs, iOS
simulator runtimes 16/17/18. xmllint --noout confirms both files are
well-formed.

Use

haxelib run lime build ios -simulator -Dhxcpp_arm64
# or direct hxcpp:
haxe -cp <path> -cpp out -DHXCPP_ARM64 -Diphonesim

Context for follow-up

This is the foundation for an Apple Silicon support PR queued for
openfl/lime (NDLL fallback chain, auto-OpenAL backend selection),
which keys off the arm64-sim LIBEXTRA naming.

Original PR description (pre-3668203c)

The original scope added full arm64 simulator support via
-target arm64-apple-ios${version}-simulator compiler flags, separate
LIBEXTRA/objdir, and the dll linker arch. The compiler-flag half was
implemented upstream independently in 3668203 using
-arch arm64 + -mios-simulator-version-min, which achieves the same
correct LC_BUILD_VERSION simulator platform marking.

Comment thread toolchain/iphonesim-toolchain.xml Outdated
Per review feedback: -isysroot and its SDK path are identical in both
ARM64 and x86_64/i386 sections, move them out to avoid duplication.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@MRK2009 MRK2009 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it's much better, I think it would be cool if ARM64 support for iOS simulator going to be implemented in lime.

Comment thread toolchain/iphonesim-toolchain.xml Outdated
@MRK2009

MRK2009 commented Aug 2, 2026

Copy link
Copy Markdown

This commit causes the pr have merge conflicts
3668203

)

Resolve toolchain/iphonesim-toolchain.xml in favor of upstream's
-arch arm64 + -mios-simulator-version-min approach, dropping this
branch's equivalent -target triple sections. Remaining deltas vs
master: distinct .iphonesim-arm64 LIBEXTRA, per-arch sim objdir,
and arm64 in the dll linker.
@AxGord AxGord changed the title iphonesim: support iOS simulator builds on Apple Silicon (HXCPP_ARM64) iphonesim HXCPP_ARM64: distinct LIBEXTRA/objdir, arm64 dll linker (follow-up to 3668203c) Aug 3, 2026
@AxGord

AxGord commented Aug 3, 2026

Copy link
Copy Markdown
Author

Conflicts resolved — merged master in (fc373fe). Since 3668203 implements the arm64 simulator compiler flags upstream (thanks!), I dropped this branch's equivalent -target sections and rescoped the PR to the remaining gaps: distinct .iphonesim-arm64 LIBEXTRA, per-arch sim objdir, and the arm64 case in the dll linker (which otherwise still emits -arch i386 under HXCPP_ARM64). Diff vs master is now +8/−5 across the same 2 files; PR description updated accordingly.

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.

3 participants