nodejs/node · error

Assembly type "%s" is unknown.\n

Error message

Assembly type "%s" is unknown.\n

What it means

When -a/--assembly is given, genccode validates the value against its built-in table of assembly header templates (gcc, sun, aCC-ia64, aCC-parisc, nasm, masm, masm64, etc.) via checkAssemblyHeaderName(). If the value matches none of them, the tool prints the unknown assembly type, calls printAssemblyHeadersToStdErr() to list the valid names, and returns -1.

Source

Thrown at deps/icu-small/source/tools/genccode/genccode.c:155

            "\t                    Valid values for this opton are x64, x86 and arm64.\n"
            "\t--skip-dll-export   Don't export the ICU data entry point symbol (for use when statically linking)\n");
#endif
        fprintf(stderr,
            "\t-f or --filename    Specify an alternate base filename. (default: symbolname_typ)\n"
            "\t-a or --assembly    Create assembly file. (possible values are: ");

        printAssemblyHeadersToStdErr();
    } else {
        const char *message, *filename;
        /* TODO: remove void (*writeCode)(const char *, const char *); */

        if(options[kOptAssembly].doesOccur) {
            message="generating assembly code for %s\n";
            writeCode = CALL_WRITEASSEMBLY;
            /* TODO: remove writeCode=&writeAssemblyCode; */

            if (!checkAssemblyHeaderName(options[kOptAssembly].value)) {
                fprintf(stderr,
                    "Assembly type \"%s\" is unknown.\n", options[kOptAssembly].value);
                return -1;
            }
        }
#ifdef CAN_GENERATE_OBJECTS
        else if(options[kOptObject].doesOccur) {
            message="generating object code for %s\n";
            writeCode = CALL_WRITEOBJECT;
            /* TODO: remove writeCode=&writeObjectCode; */
        }
#endif
        else
        {
            message="generating C code for %s\n";
            writeCode = CALL_WRITECCODE;
            /* TODO: remove writeCode=&writeCCode; */
        }
        if (options[kOptQuiet].doesOccur) {

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Use one of the names printed by printAssemblyHeadersToStdErr() (run genccode -a badname to list them).
  2. Match case exactly — checkAssemblyHeaderName uses strcmp, so "nasm" not "NASM".
  3. If your platform truly needs a new dialect, add a template to assemblyHeader[] in pkg_genc.cpp and rebuild the tool.

Example fix

# before
genccode -a NASM data.dat

# after
genccode -a nasm data.dat
Defensive patterns

Strategy: validation

Validate before calling

// canonical, supported assembly names (keep in sync with pkg_genc.cpp assemblyHeader[])
VALID_ASM = {"gcc","gcc-cygwin","gcc-win32","sun","sun-x86","aCC-ia64","aCC-parisc","nasm","masm","masm64"}
if assembly not in VALID_ASM:
    raise ValueError(f'unsupported -a {assembly!r}; choose from {sorted(VALID_ASM)}')

Prevention

When it happens

Trigger: options[kOptAssembly].value is a string not equal to any entry in the assemblyHeader[] array — e.g. "gcc5", "elf", "att", a platform name instead of an assembly dialect, or a case mismatch (the comparison is case-sensitive strcmp).

Common situations: Setting GENCCODE_ASSEMBLY in a config/mh-* file to a value not supported by this ICU build; porting an ICU build to a new toolchain and guessing the assembly name; case error (e.g. "NASM" vs "nasm").

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/2b4a186c169a2b14. Report an issue: GitHub.