From 67154a70fa41a7aa94cce26e89688814a6acf1ec Mon Sep 17 00:00:00 2001 From: cnc Date: Tue, 2 Jun 2026 13:46:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E6=8F=90=E7=A4=BA=E8=AF=8D=E7=BB=93?= =?UTF-8?q?=E8=AE=BA=E8=A1=A5=20wasm=20=E6=8E=A2=E9=92=88=E6=BA=90?= =?UTF-8?q?=E4=BE=9D=E6=8D=AE=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-linuxcnc-wasm-link-probe.sh | 6 ++++++ build-linuxcnc-wasm-standalone-probe.sh | 4 ++++ test-linuxcnc-wasm-python-plugin-link.sh | 2 ++ test-linuxcnc-wasm-rs274ngc-pre-link.sh | 2 ++ test-linuxcnc-wasm-rs274ngc-pre-object.sh | 2 ++ test-linuxcnc-wasm-runtime-link.sh | 3 +++ test-native.sh | 8 ++++++++ 7 files changed, 27 insertions(+) diff --git a/build-linuxcnc-wasm-link-probe.sh b/build-linuxcnc-wasm-link-probe.sh index 18796c1..34264f7 100755 --- a/build-linuxcnc-wasm-link-probe.sh +++ b/build-linuxcnc-wasm-link-probe.sh @@ -3,6 +3,9 @@ set -euo pipefail cd "$(dirname "$0")" +# LinuxCNC source basis: link probe modes reuse wasm-safe objects built from +# linuxcnc-rs274-wasm-source-files.txt and add only a narrow probe main that +# asserts LinuxCNC rs274ngc_pre/runtime symbols stay linked. usage() { echo "usage: $0 --mode rs274ngc-pre|runtime [manifest]" >&2 } @@ -82,6 +85,9 @@ target_name=rs274ngc_pre_probe common_flag_output=$(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-wasm-common-cxxflags.sh --profile core20-sections) mapfile -t common_flags <<<"$common_flag_output" case "$mode" in + rs274ngc-pre) + grep -F 'LinuxCNC source basis: src/emc/rs274ngc/rs274ngc_pre.cc provides' "$main_source" >/dev/null + ;; runtime) object_mode=runtime main_source=core/wasm_shims/cnc_sim_wasm_runtime_probe_main.cc diff --git a/build-linuxcnc-wasm-standalone-probe.sh b/build-linuxcnc-wasm-standalone-probe.sh index c20a0eb..577ca4f 100755 --- a/build-linuxcnc-wasm-standalone-probe.sh +++ b/build-linuxcnc-wasm-standalone-probe.sh @@ -3,6 +3,9 @@ set -euo pipefail cd "$(dirname "$0")" +# LinuxCNC source basis: standalone probe modes either compile LinuxCNC +# rs274/tooldata sources directly or link wasm-safe shims whose source basis is +# checked against LinuxCNC source comments before building. usage() { echo "usage: $0 --mode tooldata-link|tooldata-common-link|interp-base-link|python-plugin-link|rs274ngc-pre-object" >&2 } @@ -122,6 +125,7 @@ case "$mode" in ;; rs274ngc-pre-object) rs274ngc_pre_source=$(LINUXCNC_ROOT="$linuxcnc_root" ./list-linuxcnc-source-files.sh src/emc/rs274ngc/rs274ngc_pre.cc) + grep -F 'core:src/emc/rs274ngc/rs274ngc_pre.cc:Interp implementation covered by rs274ngc_pre link probe' linuxcnc-rs274-wasm-source-files.txt >/dev/null sources+=("$rs274ngc_pre_source") target_name=rs274ngc_pre.o ;; diff --git a/test-linuxcnc-wasm-python-plugin-link.sh b/test-linuxcnc-wasm-python-plugin-link.sh index 398b3d7..a9c9ec9 100755 --- a/test-linuxcnc-wasm-python-plugin-link.sh +++ b/test-linuxcnc-wasm-python-plugin-link.sh @@ -3,6 +3,8 @@ set -euo pipefail cd "$(dirname "$0")" +# LinuxCNC source basis: src/emc/pythonplugin/python_plugin.cc and +# python_plugin.hh define the PythonPlugin API covered by this wrapper. probe=$(./build-linuxcnc-wasm-standalone-probe.sh --mode python-plugin-link) "$probe" diff --git a/test-linuxcnc-wasm-rs274ngc-pre-link.sh b/test-linuxcnc-wasm-rs274ngc-pre-link.sh index bea2453..3657029 100755 --- a/test-linuxcnc-wasm-rs274ngc-pre-link.sh +++ b/test-linuxcnc-wasm-rs274ngc-pre-link.sh @@ -3,6 +3,8 @@ set -euo pipefail cd "$(dirname "$0")" +# LinuxCNC source basis: src/emc/rs274ngc/rs274ngc_pre.cc provides the Interp +# init/read/execute path exercised by the source-linked probe main. manifest=${1:-linuxcnc-rs274-wasm-source-files.txt} preflight_cache_dir=${CNC_SIM_PREFLIGHT_CACHE_DIR:-build/wasm-probe-preflight-cache} diff --git a/test-linuxcnc-wasm-rs274ngc-pre-object.sh b/test-linuxcnc-wasm-rs274ngc-pre-object.sh index ceef442..90c55b5 100755 --- a/test-linuxcnc-wasm-rs274ngc-pre-object.sh +++ b/test-linuxcnc-wasm-rs274ngc-pre-object.sh @@ -3,6 +3,8 @@ set -euo pipefail cd "$(dirname "$0")" +# LinuxCNC source basis: src/emc/rs274ngc/rs274ngc_pre.cc is compiled directly +# here so wasm-safe object coverage cannot drift away from the Interp source. ./build-linuxcnc-wasm-standalone-probe.sh --mode rs274ngc-pre-object >/dev/null echo "linuxcnc wasm rs274ngc_pre object probe passed" diff --git a/test-linuxcnc-wasm-runtime-link.sh b/test-linuxcnc-wasm-runtime-link.sh index 7220bfc..8aef380 100755 --- a/test-linuxcnc-wasm-runtime-link.sh +++ b/test-linuxcnc-wasm-runtime-link.sh @@ -3,6 +3,9 @@ set -euo pipefail cd "$(dirname "$0")" +# LinuxCNC source basis: src/emc/rs274ngc/rs274ngc_pre.cc provides read() and +# execute(), interp_convert.cc converts G0/G2/M30, and emcops.cc/dummyemcstat.cc +# provide the EMC status symbols required by this runtime link probe. manifest=${1:-linuxcnc-rs274-wasm-source-files.txt} preflight_cache_dir=${CNC_SIM_PREFLIGHT_CACHE_DIR:-build/wasm-probe-preflight-cache} diff --git a/test-native.sh b/test-native.sh index 6ac7229..533dc14 100755 --- a/test-native.sh +++ b/test-native.sh @@ -54,6 +54,14 @@ grep -F 'metadata:src/emc/tooldata/tooldata_nml.cc:source basis for wasm-safe to grep -F 'LinuxCNC source basis: this probe derives required Python C API exports from' test-linuxcnc-wasm-python-c-api-symbols.sh >/dev/null grep -F 'LinuxCNC source basis: this probe compares wasm-safe tooldata runtime stubs' test-linuxcnc-wasm-tooldata-runtime-symbols.sh >/dev/null grep -F 'LinuxCNC source basis: the standalone probe links src/emc/rs274ngc/interp_base.cc' test-linuxcnc-wasm-interp-base-link.sh >/dev/null +grep -F 'LinuxCNC source basis: src/emc/pythonplugin/python_plugin.cc and' test-linuxcnc-wasm-python-plugin-link.sh >/dev/null +grep -F 'LinuxCNC source basis: src/emc/rs274ngc/rs274ngc_pre.cc is compiled directly' test-linuxcnc-wasm-rs274ngc-pre-object.sh >/dev/null +grep -F 'LinuxCNC source basis: src/emc/rs274ngc/rs274ngc_pre.cc provides the Interp' test-linuxcnc-wasm-rs274ngc-pre-link.sh >/dev/null +grep -F 'LinuxCNC source basis: src/emc/rs274ngc/rs274ngc_pre.cc provides read()' test-linuxcnc-wasm-runtime-link.sh >/dev/null +grep -F 'LinuxCNC source basis: standalone probe modes either compile LinuxCNC' build-linuxcnc-wasm-standalone-probe.sh >/dev/null +grep -F 'LinuxCNC source basis: link probe modes reuse wasm-safe objects built from' build-linuxcnc-wasm-link-probe.sh >/dev/null +grep -F 'grep -F '\''LinuxCNC source basis: src/emc/rs274ngc/rs274ngc_pre.cc provides'\'' "$main_source" >/dev/null' build-linuxcnc-wasm-link-probe.sh >/dev/null +grep -F 'core:src/emc/rs274ngc/rs274ngc_pre.cc:Interp implementation covered by rs274ngc_pre link probe' build-linuxcnc-wasm-standalone-probe.sh >/dev/null grep -F 'LinuxCNC source basis: linuxcnc-rs274-source-files.txt enumerates the native' list-linuxcnc-source-manifest-sources.sh >/dev/null grep -F 'LinuxCNC source basis: native source-link support objects come from the' list-linuxcnc-source-support-objects.sh >/dev/null grep -F 'LinuxCNC source basis: this probe compiles the core RS274 interpreter sources' test-linuxcnc-source-objects.sh >/dev/null