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

build: support setting an emulator from configure script #53899

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

Conversation

tie
Copy link
Contributor

@tie tie commented Jul 17, 2024

V8’s JIT infrastructure requires binaries such as mksnapshot to be run during the build. However, these binaries must have the same bit-width as the host platform (e.g. a x86_64 build platform targeting ARMv6 needs to produce a 32-bit binary).

To work around this issue, allow building the binaries for the host platform and running them on the build platform with an emulator.

Based on Buildroot’s nodejs-src 0001-add-qemu-wrapper-support.patch. https://gitlab.com/buildroot.org/buildroot/-/blob/c1d5eada4d4db9eeaa1c44dd1dea95a67c8a70ca/package/nodejs/nodejs-src/0001-add-qemu-wrapper-support.patch

See also NixOS/nixpkgs#327653

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory. v8 engine Issues and PRs related to the V8 dependency. labels Jul 17, 2024
@tie
Copy link
Contributor Author

tie commented Jul 17, 2024

cc @aduh95

V8’s JIT infrastructure requires binaries such as mksnapshot to be run
during the build. However, these binaries must have the same bit-width
as the host platform (e.g. a x86_64 build platform targeting ARMv6 needs
to produce a 32-bit binary).

To work around this issue, allow building the binaries for the host
platform and running them on the build platform with an emulator.

Based on Buildroot’s nodejs-src 0001-add-qemu-wrapper-support.patch.
https://gitlab.com/buildroot.org/buildroot/-/blob/c1d5eada4d4db9eeaa1c44dd1dea95a67c8a70ca/package/nodejs/nodejs-src/0001-add-qemu-wrapper-support.patch
@tie tie marked this pull request as ready for review July 19, 2024 07:59
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. needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants