magic/toolchains
Darryl L. Miles c21f4a96db wasm: force TCL select() notifier (Emscripten has no working epoll)
TCL 9.1's configure defines NOTIFIER_EPOLL whenever <sys/epoll.h> is
present (unix/configure.ac:342).  Emscripten's sysroot ships that header
and the epoll_* symbols, so TCL picked the epoll notifier — but epoll
does not work under WASM at runtime and the event loop hangs.

Hide the header/functions from TCL's configure via autoconf cache vars
(ac_cv_header_sys_epoll_h=no + epoll_create/epoll_create1=no) so the
select()-based notifier is selected instead.

Verified with emsdk 6.0.3: NOTIFIER_EPOLL is absent from DEFS, the
tclEpollNotfy.o/tclKqueueNotfy.o objects are empty stubs (333 B) and
tclSelectNotfy.o is the live notifier (~9.9 KB); the tcl WASM variant
links (magic.js + magic.wasm) via npm/build.sh out-of-source.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 14:54:11 -04:00
..
emscripten wasm: force TCL select() notifier (Emscripten has no working epoll) 2026-07-26 14:54:11 -04:00