added support for `arm64` and `x64_arm64` in `otp_build`
This PR is one of the smaller PRs separated from the original PR https://github.com/erlang/otp/pull/8142 that attempts to add initial support for ARM64 windows.
I'm open to change x64_arm64 to any alternative value(s) that can tell us we're cross-compiling. I'm also open to add amd64_arm64 as an alias for x64_arm64 if we'd like to make it consistent with Microsoft Visual Studio, please see vcvarsall.
In this PR,
-
echo_env_wslnow accepts a single argumentARCH, which can be one ofx64,arm64,x64_arm64andx86 -
wsl_tools/vc/cc.shwill setLINKCMD="-MACHINE:${MACHINE}"by default, where the value forMACHINEis:-
x64whenCONFIG_SUBTYPEiswin64 -
ARM64whenCONFIG_SUBTYPEis eitherarm64orx64_arm64 -
x86for all otherCONFIG_SUBTYPEvalues
-
-
wsl_tools/vc/cc.shwill add-D__aarch64__toCOMMON_CFLAGSwhen (cross-)compiling for the arm64 target -
wsl_tools/reg_query.shwill setREG_OPT=" /reg:64"whenCONFIG_SUBTYPEis eitherarm64orx64_arm64
When compile on an arm64 machine natively
-
CONFIG_SUBTYPEwill be set toarm64 -
build_type,host_typeandtarget_typeare all set tolocal-aarch64-pc-windows -
win64-arm64.config.cache.staticwill be used.It uses
win64.config.cache.staticas the template and alllocal-x86_64-pc-windowsare replaced bylocal-aarch64-pc-windows
When cross-compiling on an x86_64 host machine
-
CONFIG_SUBTYPEwill be set tox64_arm64 -
build_typewill be set tolocal-x86_64-pc-windowswhilehost_typeandtarget_typeare all set tolocal-aarch64-pc-windows -
win64-x64_arm64.config.cache.staticwill be used.It uses
win64.config.cache.staticas the template andlocal-x86_64-pc-windowsare replaced bylocal-aarch64-pc-windowsexcept forac_cv_buildandac_cv_env_build_alias_value
CT Test Results
3 files 141 suites 48m 47s :stopwatch: 1 595 tests 1 546 :white_check_mark: 49 :zzz: 0 :x: 2 303 runs 2 234 :white_check_mark: 69 :zzz: 0 :x:
Results for commit 44f78586.
:recycle: This comment has been updated with latest results.
To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.
See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.
Artifacts
// Erlang/OTP Github Action Bot
Was going update wsl_tools/vc/emu_cc.sh in the next PR with documentation regarding where to get/download the compiler, but I think we should be fine to add it in this PR because its name, aarch64-w64-mingw32-gcc, should follow the same convention regardless of which implementation we're using.
Thanks for your pull request.
It seems that it would be better to squash the commits into one. While you are it, you could follow the advice in writing good commit messages and change the commit message to add support for arm64 and x64_arm64 in otp_build.
Thanks for your pull request.
It seems that it would be better to squash the commits into one. While you are it, you could follow the advice in writing good commit messages and change the commit message to
add support for arm64 and x64_arm64 in otp_build.
Hi @bjorng, thank you so much for the review, and I'll be happy to do so!
Thanks! Added to our daily builds. I expect to merge this pull request within a few days unless any problems show up.
Thanks @bjorng! And I think we're probably 2 more small PRs away from being able to compile an experimental version for ARM64 Windows.
Thanks for your pull request.