Repository navigation
Cross-compilation bug when compiling for ARM64 on a non-ARM64 host with Windows #52664
Description
Activity
- addedbuildIssues and PRs related to Node.js builds or CI infrastructure.Issues and PRs related to Node.js builds or CI infrastructure.
on Apr 24, 2024 - addedwindowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
on Apr 24, 2024 cc @nodejs/platform-windows-arm
I've investigated this and can confirm the behavior. The issue is that the project used for generating the DLL
gen_node_defis not compiled for the host architecture but for the target one. That is why there is nogen_node_def_host.exe.gen_node_def.exedoes exist but cannot be executed on an x64 machine since it is built for ARM64.By the looks of things, this never worked but is caught just now.
Reacted by Mahdi SharifiFWIW I ran into something similar too but my situation is a bit funnier - I accidentally built with the x64 host toolchain on ARM64 Windows (because the Python installer currently installs x64 Python on ARM64 Windows until Python's ARM64 Windows support is stable), while I could run the x64 gen_node_def_host.exe on ARM64 with emulation, it couldn't load the ARM64 DLL either. After I fix the Python issue to stop the unnecessary cross compiling ARM64 gen_node_def.exe does work though. So my understanding is that no only the build files are broken, the tool itself might also need fix up for cross-compilation too.
github-actions commented
on Jul 20, 2026 on Jul 20, 2026 – with GitHub ActionsContributorMore actionsThis issue has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Jul 20, 2026 - added a commit that references this issue
on Jul 24, 2026 - added a commit that references this issue
on Aug 3, 2026 - added 5 commits that reference this issue
on Aug 3, 2026
Version
v21.7.3
Platform
Microsoft Windows NT 10.0.20348.0 x64
What steps will reproduce the bug?
Cross-compiling for Windows ARM64 on a Windows x86_64 machine.
What is the expected behavior? Why is that the expected behavior?
Should compile.
What do you see instead?
Here's the log:
Additional information
Compiling as a shared library with: