Files
wasm-simulator/docs/linuxcnc-wasm-shims-source-map.md
cnc cb22ecd8ef 参考所有分组,完成尽量多的内容。禁止顺手扩功能 smoke
结论:补齐 LinuxCNC WASM-safe shim source-map,锁定 linuxcnc_wasm_safe_probe_shims、RS274/WASM manifest、每个 shim 的 LinuxCNC 源依据与聚合 guardrails;未扩展 smoke 行为。验证通过:./check-linuxcnc-wasm-shims-source-map.sh linuxcnc-rs274-wasm-source-files.txt、./check-linuxcnc-wasm-blockers-source-map.sh linuxcnc-rs274-wasm-source-files.txt、./test-linuxcnc-wasm-cmake-safe-probe.sh、./test-native.sh、./test-linuxcnc-source-link.sh、./test-linuxcnc-source-syntax.sh、CNC_SIM_ALL_NATIVE_GUARDRAILS_ONLY=1 ./test-all-native.sh。
2026-06-04 16:08:32 +08:00

3.5 KiB

LinuxCNC WASM shims source map

This map records the source basis for the C++ sources in the CMake linuxcnc_wasm_safe_probe_shims set. It is a build/source-link guard only; it must not add CNC behavior and must not expand the temporary smoke parser.

Generated Coverage

Output Count Source coverage role
CMake linuxcnc_wasm_safe_probe_shims sources 11 Browser-safe LinuxCNC adaptation shims linked into WASM source probes.

Shim Map

Shim LinuxCNC source basis Boundary
core/wasm_shims/dlfcn.cc src/emc/rs274ngc/interp_base.cc Satisfies native dlopen symbols for browser-safe probes.
core/wasm_shims/emc_status_shim.cc src/emc/sai/dummyemcstat.cc Provides the source-backed emcStatus singleton shape without task/NML startup.
core/wasm_shims/gettext_shim.cc src/emc/rs274ngc/interp_internal.hh Preserves LinuxCNC diagnostic call sites without browser gettext catalogs.
core/wasm_shims/linuxcnc_runtime_shim.cc src/emc/rs274ngc/gcodemodule.cc, src/emc/task/emctaskmain.cc, src/emc/task/taskclass.cc, src/emc/rs274ngc/interp_namedparams.cc, src/hal/hal_lib.c, src/emc/rs274ngc/rs274ngc_pre.cc Keeps preview/task, builtin Python module, HAL lookup, and wordexp() edges compile-safe.
core/wasm_shims/nml_status_shim.cc src/libnml/nml/nmlmsg.cc, src/libnml/nml/stat_msg.cc Provides NML status constructors needed by source-linked EMC status objects.
core/wasm_shims/python_c_api_shim.cc src/emc/rs274ngc/interp_python.cc, src/emc/rs274ngc/interp_namedparams.cc, src/emc/rs274ngc/gcodemodule.cc, src/emc/pythonplugin/python_plugin.cc Satisfies Python C API symbols while Python/Boost.Python remap paths remain tracked blockers.
core/wasm_shims/rcs_print_shim.cc src/libnml/rcs/rcs_print.cc Provides LinuxCNC RCS print diagnostics used by NML validation.
core/wasm_shims/rtapi_compat.cc src/rtapi/uspace_common.h, src/rtapi/rtapi.h Provides userspace RTAPI formatting declarations used by RS274/NML code.
core/wasm_shims/tooldata/tooldata_mmap_backend.cc src/emc/tooldata/tooldata_mmap.cc Replaces native mmap storage with an in-memory WASM-safe backend for probes.
core/wasm_shims/tooldata/tooldata_runtime_stubs.cc src/emc/tooldata/tooldata_nml.cc, src/emc/tooldata/tooldata_db.cc Satisfies NML and external tool database entry points without native services.
core/wasm_shims/pythonplugin/python_plugin.cc src/emc/pythonplugin/python_plugin.cc, src/emc/pythonplugin/python_plugin.hh Keeps LinuxCNC PythonPlugin API available while Python execution is disabled for browser-safe probes.

Boundaries

  • The CMake linuxcnc_wasm_safe_probe_shims set and list-linuxcnc-wasm-safe-shims.sh must stay synchronized.
  • Each shim source must keep a nearby LinuxCNC source basis: comment naming the LinuxCNC source it adapts.
  • Every LinuxCNC source named above must remain tracked in the RS274/WASM manifest as core, header, or metadata.
  • These shims are browser-safe LinuxCNC adaptations for source-link probes; they are not new interpreter behavior.

Checks

Run:

./check-linuxcnc-wasm-shims-source-map.sh
./test-linuxcnc-wasm-cmake-safe-probe.sh
./test-native.sh
./test-linuxcnc-source-link.sh

check-linuxcnc-wasm-shims-source-map.sh keeps this document, the CMake shim set, list-linuxcnc-wasm-safe-shims.sh, LinuxCNC source anchors, and the RS274/WASM manifest synchronized.