-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Adding cross-compilation support for Windows on Arm #32582
Comments
cc @joaocgreis |
How do you plan to actually run V8's native GN build has some support for cross-compiling but it does so by running |
Not sure how recently the situation changed, but V8's native mksnapshot does support cross-compilation for Arm targets. QEMU is currently used AFAICT only for MIPS-based platforms. |
Yes, mksnapshot does support running on one platform to generate a snapshot for another platform. The limitation here is GYP's inability to support generating projects targeting the build host instead of the build target. |
@richard-townsend-arm happy to see this moving forward! We already cross-compile for Linux ARM from Linux x86. The main changes for doing that are using a compiler with support for the target (https://github.com/rvagg/rpi-newer-crosstools.git) and setting the |
Adds configuration to allow building an MSI installer for Windows ARM64. MSI can be created by running `vcbuild.bat release msi arm64` Refs: nodejs#25998 Refs: nodejs#32582
Adds configuration to allow building an MSI installer for Windows ARM64. MSI can be created by running `vcbuild.bat release msi arm64` Refs: #25998 Refs: #32582 PR-URL: #33689 Reviewed-By: João Reis <[email protected]> Reviewed-By: Bartosz Sosnowski <[email protected]>
Adds configuration to allow building an MSI installer for Windows ARM64. MSI can be created by running `vcbuild.bat release msi arm64` Refs: #25998 Refs: #32582 PR-URL: #33689 Reviewed-By: João Reis <[email protected]> Reviewed-By: Bartosz Sosnowski <[email protected]>
Adds configuration to allow building an MSI installer for Windows ARM64. MSI can be created by running `vcbuild.bat release msi arm64` Refs: #25998 Refs: #32582 PR-URL: #33689 Reviewed-By: João Reis <[email protected]> Reviewed-By: Bartosz Sosnowski <[email protected]>
Adds configuration to allow building an MSI installer for Windows ARM64. MSI can be created by running `vcbuild.bat release msi arm64` Refs: #25998 Refs: #32582 PR-URL: #33689 Reviewed-By: João Reis <[email protected]> Reviewed-By: Bartosz Sosnowski <[email protected]>
Adds configuration to allow building an MSI installer for Windows ARM64. MSI can be created by running `vcbuild.bat release msi arm64` Refs: #25998 Refs: #32582 PR-URL: #33689 Reviewed-By: João Reis <[email protected]> Reviewed-By: Bartosz Sosnowski <[email protected]>
Uses x64 node executable for running .js files in arm64 cross-compilation scenarios. MSI can now be created by running `vcbuild.bat release msi arm64` Refs: nodejs#25998 Refs: nodejs#32582
Updates the build instructions for Windows 10 ARM64, now that cross-compiling on a x64 host is possible. Refs: nodejs#25998 Refs: nodejs#32582
Uses x64 node executable for running .js files in arm64 cross-compilation scenarios. MSI can now be created by running `vcbuild.bat release msi arm64` Refs: #25998 Refs: #32582 PR-URL: #34009 Reviewed-By: James M Snell <[email protected]> Reviewed-By: João Reis <[email protected]>
Uses x64 node executable for running .js files in arm64 cross-compilation scenarios. MSI can now be created by running `vcbuild.bat release msi arm64` Refs: #25998 Refs: #32582 PR-URL: #34009 Reviewed-By: James M Snell <[email protected]> Reviewed-By: João Reis <[email protected]>
Uses x64 node executable for running .js files in arm64 cross-compilation scenarios. MSI can now be created by running `vcbuild.bat release msi arm64` Refs: #25998 Refs: #32582 PR-URL: #34009 Reviewed-By: James M Snell <[email protected]> Reviewed-By: João Reis <[email protected]>
The tricky thing is that qemu doesn't run windows. This also make testing the build hard. |
Cross-compilation to Windows on ARM was enabled some time ago and Windows ARM64 binaries are now a part of the official Node.js release. Closing the issue. |
Is your feature request related to a problem? Please describe.
Follow on #25998 (Support ARM64 Windows Desktop).
The current solution to build for Windows on Arm is to build on the device itself due to host-only tools (e.g. mksnapshot) in the build process. Catch is that because Microsoft have not (yet) released a native toolchain for Windows on Arm, building Node.js is hard because you have to use an x86 toolchain running under emulation, which is slow and bumps up against 32-bit memory limitations. As a result, the Windows on Arm build has bit-rotted and doesn't currently build out of the box.
Describe the solution you'd like
To make Windows on Arm easier to support, I'd like to add cross-compilation support to node-gyp and teach Node.js' build system how to cross-compile for Arm. GYP already makes the distinction between host and target, so the idea is to generate two versions of some projects:
Each host target is renamed to produce a
_host.exe
. Each action is then re-written to call the_host.exe
version, so e.g. actions which involvemksnapshot.exe
are fixed up to callmksnapshot_host.exe
instead. These host-only targets need to be built for x64, so we introduce a host-onlynode_host.sln
which is built first. Then,node.sln
(which contains both host and target projects) is built for ARM64. I'd also like to backport some recent V8 changes which fix support for MSVC (Microsoft's compiler) on Arm systems.Describe alternatives you've considered
Some possible alternatives are:
The second option is quite viable, but risks introducing ABI issues for native modules and would still require changes to node-gyp.
CC @jkunkee, @refack, if you're happy with the general outline of this approach, I'll clean up my patches, get them through internal review and open some PRs.
The text was updated successfully, but these errors were encountered: