Skip to content

Implement unknown function support for ARM64EC/ARM64X architecture for Windows on Arm #1884

@charles-lunarg

Description

@charles-lunarg

Currently, it is not possible to build this repo as arm64ec/arm64x with unknown function support enabled.

In the initial work to get the loader working on Windows on Arm, it was decided that the lack of support shouldn't be a blocker. This issue tracks the completion of the feature since it is a requirement for long term usage of the platform.

I have done some preliminary work to determine what changes are necessary. The first few are simple/one line things (albeit one is in CMake's source code). The last item is what prevented this from being a PR.

Changes necessary:

  • Change CMake's CMakeDetermineASM_MARMASMCompiler.cmake to allow ARM64EC in its detection of 32 vs 64 bit assembler support
  • Replace SYSTEM_PROCESSOR with CMAKE_GENERATOR_PLATFORM in loader/CMakeLists.txt (use the arch of the target, not the host)
  • Add 'arm64ec' to list of known architectures in update_deps.py
  • Correct asm_offset.c to detect 64 bit on arm with _M_ARM64EC (e.g., add || defined(_M_ARM64EC) to line 140
  • Implement necessary Adjustor Thunks in unknown_ext_chain_marmasm.asm to be ABI compatible with arm64ec/arm64x
    • This introduces a lot of complexity into the assembly source code as the adjustor thunks need to work with the existing asm, and various ABI constraints need to be followed.

Useful resources:
https://learn.microsoft.com/en-us/cpp/build/arm64ec-windows-abi-conventions
https://learn.microsoft.com/en-us/windows/arm/arm64ec-abi

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwindows

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions