From fc452effb6cfed98704f45d2c1f70bd580d805a7 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 31 Aug 2026 07:07:22 -0600 Subject: [PATCH] build: derive NODE_ARCH from target_cpu in the GN build 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 PR-URL: https://github.com/nodejs/node/pull/65491 Refs: https://github.com/electron/electron/pull/52959 Reviewed-By: Filip Skokan --- unofficial.gni | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unofficial.gni b/unofficial.gni index 16bf46acb0f..5878f079d94 100644 --- a/unofficial.gni +++ b/unofficial.gni @@ -105,7 +105,7 @@ template("node_gn_build") { "-Wno-unused-function", ] - if (current_cpu == "x86") { + if (target_cpu == "x86") { node_arch = "ia32" } else { node_arch = target_cpu