From c305e478c01db3c7c79af8125cf7d6de1f55f5c3 Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Tue, 15 Sep 2026 13:42:37 +0800 Subject: [PATCH] motion: keep the kinematics type declaration optional for old modules A kinematics module built before the type declarations exports no kinematicsTypeFlags, and motmod's hard reference kept it from loading: dlopen fails on the undefined symbol. Mark the reference weak and report -1, no information, when the module does not answer. --- src/emc/motion/motion.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/emc/motion/motion.c b/src/emc/motion/motion.c index 2a8085c21b2..b0b5acd91da 100644 --- a/src/emc/motion/motion.c +++ b/src/emc/motion/motion.c @@ -29,6 +29,9 @@ #define NOT_INITIALIZED -1 +// old modules export no kinematicsTypeFlags; keep it optional +#pragma weak kinematicsTypeFlags + /*********************************************************************** * KERNEL MODULE PARAMETERS * ************************************************************************/ @@ -915,7 +918,8 @@ static int init_comm_buffers(void) /* and what each switchable kinematics type is, as the module declares it, for the interpreter to resolve G13.1 against */ for (n = 0; n < SWITCHKINS_MAX_TYPES; n++) { - emcmotStatus->switchkins_flags[n] = kinematicsTypeFlags(n); + emcmotStatus->switchkins_flags[n] = + kinematicsTypeFlags ? kinematicsTypeFlags(n) : -1; } emcmot_config_change();