pcbjam/wasm/bindings/sym_convert_embind.cpp
Gergő Törcsvári f8da88472c
sym_convert wasm diet: 31.3->11.05 MB via kiface prune + link-order shims (ysync 0009)
New wasm/cli/sym_convert_stubs.cpp: first-definition-wins overrides
(--allow-multiple-definition) severing schematic load/save, the KIFONT
factory (drops newstroke + freetype/harfbuzz), and the four UI virtuals
whose bodies reference pruned typeinfo/data. New
wasm/bindings/sym_convert_embind.cpp: no-op kicadCollabOnSave so the
converter stops linking eeschema's embind object (and --bind) that rooted
the editor surface from .init_array. build-kicad-target.sh: per-app
EMBIND_LINK_FLAG + sym_convert now uses its own embind TU. Bumps kicad
(kiface prune, gated). Output byte-identical on the qa corpus.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H58sC87w12FotXEmxrJrQV
2026-07-10 09:25:14 +02:00

11 lines
708 B
C++

// sym_convert's "embind" object — deliberately embind-free (ysync 0009 size
// research, step (a)).
//
// The eeschema kiface references exactly ONE symbol from the editor's embind
// TU: kicadCollabOnSave (files-io.cpp, called from SCH_EDIT_FRAME::SaveEEFile —
// a path the headless converter never executes). Linking the real
// eeschema_embind.o for that one symbol roots the ENTIRE editor surface from
// .init_array (EMSCRIPTEN_BINDINGS takes the address of every bound function:
// kicadOpenFile → frames/tools/dialogs, collab bridge, presence → GAL), which
// GC cannot remove. This no-op hook satisfies the reference instead.
extern "C" void kicadCollabOnSave( const char* /* aPath */ ) {}