From 78e6933e60ca4c1c73f051eb5a1601124a3ce330 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 18 Aug 2026 14:45:12 +0000 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 --- 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