Skip to content

[code_assets] Add arm64e as Architecture #3379

Open

Description

@dcharkes

The app store wants arm64

But to run on the CI on GitHub with the simulator, we need arm64e:

Currently, Flutter maps both architectures onto a single architecture:

https://github.com/flutter/flutter/blob/f9af233f48fc143a55911c9729430e60b2106752/packages/flutter_tools/lib/src/build_info.dart#L810-L812

XCode provides different architectures, but Flutter maps them onto one.

Do we need to change Flutter to distinguish between arm64 and arm64e? Their ABI is different so you can't call dylibs in one arch from the other.

Some background info: https://developer.apple.com/documentation/security/preparing-your-app-to-work-with-pointer-authentication

Activity

  1. dcharkes commented on Jul 8, 2026

    @dcharkes
    CollaboratorAuthor

    Arm64e ABI actually has different versions: The hardware has different versions, not all influence the ABI:

    • M1 has PAC
    • M2 has PAC and BTI
    • M5 has Pac, BTI, and EMTE.

    Gemini believes that these are encoded in the cpusubtype in the Mach-O headers:

    Bit Position Hex Mask (uint32_t) Meaning
    Bit 31 0x80000000 Versioned ABI Flag: If set to 1, the binary strictly follows a versioned pointer authentication ABI.
    Bit 30 0x40000000 Kernel ABI Flag: If set to 1, the binary is compiled for kernel space signing rules (used for things like .kext files).
    Bits 24 to 27 0x0f000000 The ABI Version Number: A 4-bit integer representing the specific generational ruleset.

    You can compile to that with

    #define __PTRAUTH_INTRINSICS__ 1
    #define __arm64e__ 1
    #define __ptrauth_abi_version__ 0

    https://github.com/lelegard/arm-cpusysregs/blob/main/docs/arm64e-on-macos.md#detecting-arm64-vs-arm64e-compilation-in-the-code

    or in assembly with

    .ptrauth_abi_version 0
    

    I suspect that BTI will then need to set a higher version in bits 24-27. (And then we have a maximum of 16 security ABI version bumps.)

    This means that adding an Architecture.arm64e to the code_assets configuration is not enough. We'll also need to add a ABI version at some point.

    cc @rmacnak-google if you have further insights, let us know.

  2. dcharkes commented on Aug 26, 2026

    @dcharkes
    CollaboratorAuthor

    Okay, I did some more digging.

    • No PAC: arm64
    • Yes PAC: arm64e version 1.
    • arm64e version 0 was the unstable version while PAC was in development.
    • BTI is backwards compatible and does not change the ABI.
    • EMTE/MIE is also not changing the ABI.
    • Apple has not announced anything for an arm64e version 2.

    So, maybe we just introduce Architecture.arm64e. And if Apple ever introduces a version 2, we can introduce a Architecture.arm64e v2. Simply folding it into the enum rather than having a separate version.

  3. dcharkes commented on Aug 26, 2026

    @dcharkes
    CollaboratorAuthor

    Note from @rmacnak-google We're conflating architecture and ABI here. An architecture can support multiple ABIs, but in Dart we basically always pick one based on Arch + OS. So we kind of shoe-horn the ABI choice into Architecture here, even though the hardware architecture can run both arm64e and arm64. Anyway, we don't want to do breaking changes. So, we're going to roll with it.

    Also, we don't want the complexity of an extra integer. So, if Apple ever introduces v2 we'll add an Architecture.arm64ev2.

  4. changed the title [-][code_assets] Add `arm64e` as `Architecture`?[/-] [+][code_assets] Add `arm64e` as `Architecture`[/+] on Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions