Add preliminary Windows arm64 support#389
Conversation
- Rolls buildroot to pick up flutter/buildroot#389 - Adds support to the gn wrapper for setting the traget CPU on Windows Attempting to generate Windows arm64 GN files will currently fail, due to lack of arm64 support for an OpenGL test support target, but this sets the foundation, and makes experimentation easier. Part of flutter/flutter#62597
| #define ARCH_CPU_32_BITS 1 | ||
| #define ARCH_CPU_LITTLE_ENDIAN 1 | ||
| #elif defined(__aarch64__) | ||
| #elif defined(__aarch64__) || defined(_M_ARM64) |
There was a problem hiding this comment.
I'm really surprised just __aarch64__ for Clang on Windows.
There was a problem hiding this comment.
Well, we still support non-clang local builds, at least in theory.
| } | ||
| } else if (is_win) { | ||
| if (is_clang) { | ||
| if (current_cpu == "x86") { |
There was a problem hiding this comment.
Does x86 actually work?
There was a problem hiding this comment.
No clue; all the support has been there since before we forked. My guess based on this experience and also reviving the stale Windows clang code is that in terms of just our build system, it's probably more or less working, and the problems would be all the expected issues with Dart.
We could theoretically rip it all out, but I don't want to mix that with this PR. (And since we have an open-even-if-unlikely-to-be-addressed issue requesting x86 Windows support, I'm not sure we actually want to go out of our way to do that.)
- Rolls buildroot to pick up flutter/buildroot#389 - Adds support to the gn wrapper for setting the traget CPU on Windows Attempting to generate Windows arm64 GN files will currently fail, due to lack of arm64 support for an OpenGL test support target, but this sets the foundation, and makes experimentation easier. Part of flutter/flutter#62597
This is not sufficient to make a working arm64 build for Windows, but it adds the buildroot plumbing to at least start experimenting:
- Fixes build_config.h to recognize the MSVC define for arm64 builds.
- Allows for differing host and target toolchains when building for Windows.
- Adds arm64 toolchain definitions.
- Sets target flags for Windows clang builds based on architecture (and moving the recently added -m32 from being hard-coded in the toolchain to being a cflag).
- Fixes several Windows configurations that had an `if (x64) { ... } else { assume x86 }` structure to include arm64, and to error out for unhandled configurations so that if we ever need to add more architectures these places will be easier to find (instead of silently doing the wrong thing).
- Adds arm64 support to setup_toolchain.py.
In general, these changes are taken from looking at how Chromium's versions of these files evolved for Windows arm64 support.
This is not sufficient to make a working arm64 build for Windows, but it adds the buildroot plumbing to at least start experimenting:
if (x64) { ... } else { assume x86 }structure to include arm64, and to error out for unhandled configurations so that if we ever need to add more architectures these places will be easier to find (instead of silently doing the wrong thing).In general, these changes are taken from looking at how Chromium's versions of these files evolved for Windows arm64 support.