尽快推进:收紧gettext shim源码锚点
This commit is contained in:
@@ -24,7 +24,11 @@ grep -F 'interp_lib = dlopen(interp_path, RTLD_NOW);' "$linuxcnc_root/src/emc/rs
|
||||
grep -F 'Constructor constructor = (Constructor)dlsym(interp_lib, "makeInterp");' \
|
||||
"$linuxcnc_root/src/emc/rs274ngc/interp_base.cc" >/dev/null
|
||||
grep -F 'dlerror()' "$linuxcnc_root/src/emc/rs274ngc/interp_base.cc" >/dev/null
|
||||
grep -F '#include "libintl.h"' "$linuxcnc_root/src/emc/rs274ngc/interp_internal.hh" >/dev/null
|
||||
grep -F '#define _(s) gettext(s)' "$linuxcnc_root/src/emc/rs274ngc/interp_internal.hh" >/dev/null
|
||||
grep -F 'CHKS((!_readers[(int)' "$linuxcnc_root/src/emc/rs274ngc/interp_internal.cc" >/dev/null
|
||||
grep -F 'Cannot use polar coordinate on a machine lacking X or Y axes' \
|
||||
"$linuxcnc_root/src/emc/rs274ngc/interp_internal.cc" >/dev/null
|
||||
grep -F 'int _task = 0;' "$linuxcnc_root/src/emc/rs274ngc/gcodemodule.cc" >/dev/null
|
||||
grep -F 'int _task = 1;' "$linuxcnc_root/src/emc/task/emctaskmain.cc" >/dev/null
|
||||
grep -F 'struct _inittab builtin_modules[]' "$linuxcnc_root/src/emc/task/taskclass.cc" >/dev/null
|
||||
@@ -165,6 +169,13 @@ for shim_path, linuxcnc_sources in expected_shims.items():
|
||||
|
||||
runtime_shim = Path("core/wasm_shims/linuxcnc_runtime_shim.cc").read_text(encoding="utf-8")
|
||||
runtime_probe = Path("core/wasm_shims/cnc_sim_wasm_runtime_probe_main.cc").read_text(encoding="utf-8")
|
||||
gettext_shim = Path("core/wasm_shims/gettext_shim.cc").read_text(encoding="utf-8")
|
||||
for needle in [
|
||||
"extern \"C\" char *gettext(const char *msgid)",
|
||||
"return const_cast<char *>(msgid ? msgid : \"\");",
|
||||
]:
|
||||
if needle not in gettext_shim:
|
||||
raise SystemExit(f"gettext shim missing diagnostic passthrough boundary: {needle}")
|
||||
for needle in [
|
||||
'extern "C" int hal_get_pin_value_by_name',
|
||||
'extern "C" int hal_get_signal_value_by_name',
|
||||
@@ -248,6 +259,8 @@ for phrase in [
|
||||
"CMake `linuxcnc_wasm_safe_probe_shims` set",
|
||||
"RS274/WASM manifest",
|
||||
"browser-safe LinuxCNC adaptations",
|
||||
"LinuxCNC `_()` diagnostic call sites",
|
||||
"browser gettext catalogs unavailable",
|
||||
"dynamic loading unavailable",
|
||||
"unavailable HAL lookup",
|
||||
"must leave HAL values unavailable",
|
||||
|
||||
@@ -16,7 +16,7 @@ only; it must not add CNC behavior and must not expand the temporary smoke parse
|
||||
| --- | --- | --- |
|
||||
| `core/wasm_shims/dlfcn.cc` | `src/emc/rs274ngc/interp_base.cc` | Satisfies native `dlopen` symbols for browser-safe probes while keeping dynamic loading unavailable. |
|
||||
| `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/gettext_shim.cc` | `src/emc/rs274ngc/interp_internal.hh` | Preserves LinuxCNC `_()` diagnostic call sites by satisfying `gettext()` while leaving browser gettext catalogs unavailable. |
|
||||
| `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`, `include/hal.h`, `src/hal/hal_lib.c`, `src/emc/rs274ngc/rs274ngc_pre.cc` | Keeps preview/task, builtin Python module, unavailable 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. |
|
||||
|
||||
Reference in New Issue
Block a user