build: derive NODE_ARCH from target_cpu in the GN build - #65491
Open
codebytere wants to merge 1 commit into
Open
build: derive NODE_ARCH from target_cpu in the GN build#65491codebytere wants to merge 1 commit into
codebytere wants to merge 1 commit into
Conversation
unofficial.gni special-cased ia32 on current_cpu while every other architecture used target_cpu. When node is also compiled in a host toolchain of a cross build (for example node_mksnapshot running in V8's snapshot toolchain, which is x86-hosted for 32-bit arm targets), current_cpu is the host's, so NODE_ARCH became "ia32" for an arm-targeted build and process.arch deserialized as 'ia32' on the device. Key the special case off target_cpu like the rest. Signed-off-by: Shelley Vohr <shelley.vohr@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
unofficial.gnispecial-cases ia32 oncurrent_cpu == "x86"while every other architecture usestarget_cpu. When node is also compiled in a host toolchain of a cross build (e.g.node_mksnapshotrunning in V8's snapshot toolchain, which is x86-hosted for 32-bit arm targets),current_cpuis the host's, soNODE_ARCHbecomes"ia32"for an arm-targeted build andprocess.archdeserializes as'ia32'on the device. This keys the special case offtarget_cpulike the rest of the block. GN build only; the gyp build is untouched. Seen in Electron's arm builds: electron/electron#52959.Refs: electron/electron#52959
Disclosure: the code and this description were written by Claude Code, directed and reviewed by @codebytere.