{"record":{"id":"c142305d80a042b8","repo":"nodejs/node","slug":"cpu-architecture-s-is-unknown-n","errorCode":null,"errorMessage":"CPU architecture \"%s\" is unknown.\\n","messagePattern":"CPU architecture \"(.+?)\" is unknown\\.\\\\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/genccode/genccode.c","lineNumber":202,"sourceCode":"                writeCCode(filename, options[kOptDestDir].value,\n                           options[kOptEntryPoint].doesOccur ? options[kOptEntryPoint].value : NULL,\n                           options[kOptName].doesOccur ? options[kOptName].value : NULL,\n                           options[kOptFilename].doesOccur ? options[kOptFilename].value : NULL,\n                           NULL,\n                           0);\n                break;\n            case CALL_WRITEASSEMBLY:\n                writeAssemblyCode(filename, options[kOptDestDir].value,\n                                  options[kOptEntryPoint].doesOccur ? options[kOptEntryPoint].value : NULL,\n                                  options[kOptFilename].doesOccur ? options[kOptFilename].value : NULL,\n                                  NULL,\n                                  0);\n                break;\n#ifdef CAN_GENERATE_OBJECTS\n            case CALL_WRITEOBJECT:\n                if(options[kOptCpuArch].doesOccur) {\n                    if (!checkCpuArchitecture(options[kOptCpuArch].value)) {\n                        fprintf(stderr,\n                            \"CPU architecture \\\"%s\\\" is unknown.\\n\", options[kOptCpuArch].value);\n                        return -1;\n                    }\n                }\n                writeObjectCode(filename, options[kOptDestDir].value,\n                                options[kOptEntryPoint].doesOccur ? options[kOptEntryPoint].value : NULL,\n                                options[kOptMatchArch].doesOccur ? options[kOptMatchArch].value : NULL,\n                                options[kOptCpuArch].doesOccur ? options[kOptCpuArch].value : NULL,\n                                options[kOptFilename].doesOccur ? options[kOptFilename].value : NULL,\n                                NULL,\n                                0,\n                                !options[kOptSkipDllExport].doesOccur);\n                break;\n#endif\n            default:\n                /* Should never occur. */\n                break;\n            }","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/genccode/genccode.c#L184-L220","documentation":"When -o/--object and -c/--cpu-arch are both in use, genccode calls checkCpuArchitecture() on the -c value. The accepted values are exactly x64, x86, arm64, arm (case-insensitive pairs). Any other string is rejected with this message and the tool returns -1 before generating object code.","triggerScenarios":"options[kOptCpuArch].value is not one of {x64,x86,arm64,arm,X64,X86,ARM64,ARM}. Common misses: \"aarch64\" (use \"arm64\"), \"amd64\" (use \"x64\"), \"i386\"/\"i686\" (use \"x86\"), \"armhf\" (use \"arm\").","commonSituations":"Cross-compile scripts that pass the GNU triple's machine name (aarch64, amd64) instead of genccode's normalized names; CI matrices using architecture labels from a different vocabulary than ICU's; copying -c from a clang/gcc -march flag.","solutions":["Map your architecture to genccode's name: aarch64->arm64, amd64->x64, i386/i686->x86, armhf/armv7->arm.","Drop -c if you do not need object generation with a specific arch (genccode will infer the host arch).","Verify the spelling is exactly one of x64/x86/arm64/arm (case-insensitive)."],"exampleFix":"# before\ngenccode -o -c aarch64 data.dat\n\n# after\ngenccode -o -c arm64 data.dat","handlingStrategy":"type-guard","validationCode":"// normalize host arch names to genccode's accepted set\nALIAS = {'aarch64':'arm64','amd64':'x64','x86_64':'x64','i386':'x86','i686':'x86','armhf':'arm','armv7l':'arm'}\ncpu = ALIAS.get(host_arch.lower(), host_arch.lower())\nif cpu not in {'x64','x86','arm64','arm'}:\n    raise ValueError(f'unsupported --cpu-arch {host_arch}; map to x64/x86/arm64/arm')","typeGuard":"// type guard for genccode cpu-arch values\nbool is_valid_cpu_arch(const char* a) {\n    return strcmp(a,\"x64\")==0||strcmp(a,\"x86\")==0||strcmp(a,\"arm64\")==0||strcmp(a,\"arm\")==0;\n}","tryCatchPattern":null,"preventionTips":["Translate GNU-triple machine names to genccode names in one place (aarch64->arm64, amd64->x64).","Omit -c entirely when host inference is acceptable."],"tags":["icu","genccode","cross-compile","cpu-arch"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}