Simdutf Can Now Be Used Without libc++ or libc++abi

· devtools · Source ↗

TLDR

  • Mitchell Hashimoto contributed a ~3,000-line PR to simdutf adding SIMDUTF_NO_LIBCXX mode, removing the final libc++ dependency from Ghostty’s libghostty-vt.

Key Takeaways

  • A new stl_compat.h header centralizes all STL usage; in NO_LIBCXX mode it provides minimal local implementations of types like std::pair instead of pulling in libc++.
  • libc++abi dependencies are subtler than libc++: function-local statics silently emit __cxa_guard_acquire calls; the fix replaces them with translation-unit statics in NO_LIBCXX mode.
  • A __cxa_pure_virtual shim marked weak handles pure-virtual vtable slots without requiring libc++abi at link time.
  • A CI audit script checks compiled objects for banned symbols (__cxa_guard_*, __gxx_personality, typeinfo) to prevent regressions in future simdutf changes.
  • ABI breakage is minimal and scoped only to NO_LIBCXX builds: a handful of diagnostic and C++-type-helper functions; the default build retains full ABI compatibility.

Why It Matters

  • Removing libc++ and libc++abi expands simdutf’s target set to embedded, WebAssembly, and freestanding environments where a C++ standard library is unavailable or undesirable.
  • Ghostty’s libghostty-vt merged the change and now has zero libc++/libc++abi dependencies for SIMD builds, confirming the approach works in a real downstream consumer.
  • The PR writeup doubles as a practical guide to detecting and eliminating hidden ABI dependencies in any C++ library, using object-file decompilation to find __cxa_* symbols.

Mitchell Hashimoto · 2026-04-15 · Read the original