Simdutf Can Now Be Used Without libc++ or libc++abi
TLDR
-
Mitchell Hashimoto contributed a ~3,000-line PR to simdutf adding
SIMDUTF_NO_LIBCXXmode, removing the final libc++ dependency from Ghostty’s libghostty-vt.
Key Takeaways
-
A new
stl_compat.hheader centralizes all STL usage; inNO_LIBCXXmode it provides minimal local implementations of types likestd::pairinstead of pulling in libc++. -
libc++abi dependencies are subtler than libc++: function-local statics silently emit
__cxa_guard_acquirecalls; the fix replaces them with translation-unit statics inNO_LIBCXXmode. -
A
__cxa_pure_virtualshim markedweakhandles 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_LIBCXXbuilds: 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