From 3a478ca33514b13fa2164f87dc85b72447aa74c1 Mon Sep 17 00:00:00 2001 From: cnc Date: Fri, 5 Jun 2026 10:13:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A7=E8=A1=8C=20AGENTS=20align-linuxcnc=20?= =?UTF-8?q?=E5=8A=A0=E9=80=9F=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 结论:补强 WASM interp_base 可执行探针,依据 LinuxCNC src/emc/rs274ngc/interp_base.cc 中绝对解释器路径直接 dlopen、相对路径经 EMC2_HOME/lib/linuxcnc 解析后 dlopen 的分支。验证通过:./test-linuxcnc-wasm-interp-base-link.sh、./test-native.sh、./test-linuxcnc-source-link.sh。 --- core/wasm_shims/interp_base_probe_main.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/core/wasm_shims/interp_base_probe_main.cc b/core/wasm_shims/interp_base_probe_main.cc index 876f77f..9c02a82 100644 --- a/core/wasm_shims/interp_base_probe_main.cc +++ b/core/wasm_shims/interp_base_probe_main.cc @@ -24,6 +24,15 @@ int main() { return 6; } - InterpBase *interp = interp_from_shlib("nonexistent-interpreter.so"); - return interp == nullptr ? 0 : 1; + // LinuxCNC src/emc/rs274ngc/interp_base.cc uses absolute interpreter + // paths directly before calling dlopen(). + if (interp_from_shlib("/tmp/cnc_sim_missing_absolute_interpreter.so") != nullptr) { + return 7; + } + // Relative interpreter names are resolved through EMC2_HOME/lib/linuxcnc + // before the same unavailable dynamic-loading edge is reached. + if (interp_from_shlib("nonexistent-interpreter.so") != nullptr) { + return 8; + } + return 0; }