Skip to content

linux-x64 prebuild still needs AVX2: addon C++ is compiled for x86-64-v3 #57

Closed

Description

@ThomasK33

Problem

The linux-x64 prebuild of every published version crashes with Illegal instruction (SIGILL) on x86-64 CPUs without AVX2 (pre-Haswell Intel, older AMD, many low-end Atom/Celeron/Pentium parts). #55 removed the AVX-512 code from libghostty-vt, so 0.1.0-beta.5 runs on AVX2 CPUs again, but the README and CHANGELOG say the build now "runs on older CPUs", and that holds only for the libghostty-vt part.

Evidence (published npm tarballs, consumer install, one script that creates a terminal, feeds, snapshots, disposes)

version native (EPYC 9454P) qemu-x86_64 -cpu Haswell qemu-x86_64 -cpu qemu64
0.1.0-beta.0 exit 0 exit 0 exit 132 (SIGILL)
0.1.0-beta.4 exit 0 exit 132 (SIGILL) exit 132 (SIGILL)
0.1.0-beta.5 exit 0 exit 0 exit 132 (SIGILL)

node -e 0 alone exits 0 under -cpu qemu64 on this host, so the addon causes the crash.

VEX-encoded (v*) instructions in the addon's own C++ functions (libghostty_vt_node::* and Napi::*), counted with objdump -d: beta.0 has 0, beta.4 has 481, and beta.5 has 481. Examples in beta.5 are vpxor in TerminalWrap::BuildSnapshot and vmovdqa ... %ymm0 in DefineIndex. libghostty-vt itself is built with -Dcpu=baseline since #55.

Likely cause (inferred, not verified)

ubuntu-latest (Ubuntu 26.04) runners install Ubuntu's amd64v3 packages (see the comment in .github/workflows/ci.yml), and their g++ appears to default to -march=x86-64-v3. node-gyp compiles native/*.cc with that default. beta.0 was built before the runner change.

Possible fixes

  • Pass -march=x86-64 (or -march=x86-64-v2 if that is the chosen floor) in binding.gyp cflags_cc for Linux x64, or build the linux-x64 prebuild on ubuntu-24.04.
  • Then make check-baseline-cpu prove the chosen floor. Today CI uses QEMU_CPU=Haswell because Node alone dies under qemu64 on the runner, so CI cannot catch this. One option: run the check in an ubuntu:24.04 container on the runner.
  • Decide and document the supported x86-64 floor (v1, v2 or v3) in the README.

Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Activity

  1. self-assigned this
    on Nov 1, 2026
  2. added a commit that references this issue on Nov 2, 2026
    d3abe63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions