Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for arm64 and x64_arm64 in otp_build #8863

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cocoa-xu
Copy link
Contributor

@cocoa-xu cocoa-xu commented Sep 26, 2024

This PR is one of the smaller PRs separated from the original PR #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_wsl now accepts a single argument ARCH, which can be one of x64, arm64, x64_arm64 and x86
  • wsl_tools/vc/cc.sh will set LINKCMD="-MACHINE:${MACHINE}" by default, where the value for MACHINE is:
    • x64 when CONFIG_SUBTYPE is win64
    • ARM64 when CONFIG_SUBTYPE is either arm64 or x64_arm64
    • x86 for all other CONFIG_SUBTYPE values
  • wsl_tools/vc/cc.sh will add -D__aarch64__ to COMMON_CFLAGS when (cross-)compiling for the arm64 target
  • wsl_tools/reg_query.sh will set REG_OPT=" /reg:64" when CONFIG_SUBTYPE is either arm64 or x64_arm64

When compile on an arm64 machine natively

  • CONFIG_SUBTYPE will be set to arm64

  • build_type, host_type and target_type are all set to local-aarch64-pc-windows

  • win64-arm64.config.cache.static will be used.

    It uses win64.config.cache.static as the template and all local-x86_64-pc-windows are replaced by local-aarch64-pc-windows

When cross-compiling on an x86_64 host machine

  • CONFIG_SUBTYPE will be set to x64_arm64

  • build_type will be set to local-x86_64-pc-windows while host_type and target_type are all set to local-aarch64-pc-windows

  • win64-x64_arm64.config.cache.static will be used.

    It uses win64.config.cache.static as the template and local-x86_64-pc-windows are replaced by local-aarch64-pc-windows except for ac_cv_build and ac_cv_env_build_alias_value

Copy link
Contributor

github-actions bot commented Sep 26, 2024

CT Test Results

    3 files    141 suites   51m 12s ⏱️
1 588 tests 1 539 ✅ 49 💤 0 ❌
2 292 runs  2 223 ✅ 69 💤 0 ❌

Results for commit 7b29627.

♻️ 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

@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants