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

Cross-compilation bug when compiling for ARM64 on a non-ARM64 host with Windows #52664

Open
devraymondsh opened this issue Apr 24, 2024 · 2 comments
Labels
build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform.

Comments

@devraymondsh
Copy link
Contributor

devraymondsh commented Apr 24, 2024

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:

--snip--

  NodeWorker.cpp

  NodeTracing.cpp

  NodeRuntime.cpp

     Creating library out\Release\libnode.lib and object out\Release\libnode.exp

  libnode.vcxproj -> out\Release\\libnode.dll

  generate_node_def_action

  '"out\Release\gen_node_def_host.exe"' is not recognized as an internal or external command,
  operable program or batch file.

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for 'out\Release\\libnode.dll' exited with code 1. [D:\a\github\node\generate_node_def.vcxproj]

Additional information

Compiling as a shared library with:

.\vcbuild.bat arm64 dll 
@VoltrexKeyva VoltrexKeyva added the build Issues and PRs related to build files or the CI. label Apr 24, 2024
@richardlau richardlau added the windows Issues and PRs related to the Windows platform. label Apr 24, 2024
@richardlau
Copy link
Member

cc @nodejs/platform-windows-arm

@StefanStojanovic
Copy link
Contributor

I've investigated this and can confirm the behavior. The issue is that the project used for generating the DLL gen_node_def is not compiled for the host architecture but for the target one. That is why there is no gen_node_def_host.exe. gen_node_def.exe does 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

4 participants