Skip to contentSkip to conversation

package/openocd: fix build with jimtcl 0.84

PATCH In review Yegor Yefremov via buildroot 1 participant 3 messages Nov 4 – Nov 6

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/openocd: fix build with jimtcl 0.84

jimtcl 0.84 replaced the isproc member of Jim_Cmd with a flags field, so openocd 0.12.0 fails to build against it:

src/helper/command.c:51:19: error: 'Jim_Cmd' has no member named 'isproc'

Backport the upstream fix, which checks JIM_CMD_ISPROC at compile time and thus also keeps working with jimtcl 0.83. Its context had to be refreshed for 0.12.0.

Assisted-by Claude:claude-opus-5-5
---
 ...-fix-build-with-jimtcl-master-branch.patch | 64 +++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 package/openocd/0005-jimtcl-fix-build-with-jimtcl-master-branch.patch
package/openocd/0005-jimtcl-fix-build-with-jimtcl-master-branch.patch new file +64 -0
new file mode 100644
index 0000000000..4b0c9d8da5
@@ -0,0 +1,64 @@
+From fe0080478b9e76a4b6b64186b7b705726ac55848 Mon Sep 17 00:00:00 2001
+From: Antonio Borneo <[email protected]>
+Date: Sat, 28 Sep 2024 17:58:51 +0200
+Subject: [PATCH] jimtcl: fix build with jimtcl master branch
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Current jimtcl release 0.83 has been tagged on 2024-08-28 and the
+new 0.84 is on the way.
+
+The change [1] merged in jimtcl branch 'master' for 0.84 breaks
+the build of OpenOCD.
+OpenOCD releases are not frequent and jimtcl is now by default an
+external build dependency. The release of jimtcl 0.84 could force
+OpenOCD to deliver a fix release to support it.
+
+Anticipate the change [1] by detecting it at compile time, without
+relying on jimtcl version, and providing an alternative code.
+
+Link: https://github.com/msteveb/jimtcl/commit/5669e84aad22 [1]
+Change-Id: I61bf100d447083258aea222aaf15608b7cbe2e57
+Signed-off-by: Antonio Borneo <[email protected]>
+Reviewed-on: https://review.openocd.org/c/openocd/+/8956
+Tested-by: jenkins
+Reviewed-by: Andrzej Sierżęga <[email protected]>
+
+Upstream: https://github.com/openocd-org/openocd/commit/fe0080478b9e76a4b6b64186b7b705726ac55848
+
+[Yegor: refresh context for 0.12.0]
+Signed-off-by: Yegor Yefremov <[email protected]>
+---
+ src/helper/command.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/helper/command.c b/src/helper/command.c
+index ca66cf7..31964d5 100644
+--- a/src/helper/command.c
++++ b/src/helper/command.c
+@@ -48,17 +48,22 @@ static int help_del_command(struct command_context *cmd_ctx, const char *cmd_nam
+ /* set of functions to wrap jimtcl internal data */
+ static inline bool jimcmd_is_proc(Jim_Cmd *cmd)
+ {
++#if defined(JIM_CMD_ISPROC)
++	// JIM_VERSION >= 84
++	return cmd->flags & JIM_CMD_ISPROC;
++#else
+ 	return cmd->isproc;
++#endif
+ }
+ 
+ bool jimcmd_is_oocd_command(Jim_Cmd *cmd)
+ {
+-	return !cmd->isproc && cmd->u.native.cmdProc == jim_command_dispatch;
++	return !jimcmd_is_proc(cmd) && cmd->u.native.cmdProc == jim_command_dispatch;
+ }
+ 
+ void *jimcmd_privdata(Jim_Cmd *cmd)
+ {
+-	return cmd->isproc ? NULL : cmd->u.native.privData;
++	return jimcmd_is_proc(cmd) ? NULL : cmd->u.native.privData;
+ }
+ 
+ static void tcl_output(void *privData, const char *file, unsigned line,
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/2 package/jimtcl: bump to version 0.84

Release notes:
https://msteveb.github.io/jimtcl/articles/jim-release-0-84/

Assisted-by Claude:claude-opus-5-5

---
This needs the openocd patch earlier in this series. Static builds of usb_modeswitch with jimtcl's zlib or openssl support fail with 0.83 and 0.84 alike; they are fixed by
https://patchwork.buildroot.org/project/buildroot/patch/[email protected]/

 package/jimtcl/jimtcl.hash | 2 +-
 package/jimtcl/jimtcl.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/jimtcl/jimtcl.hash +1 -1
index 906d2ccc23..16655ad85e 100644
@@ -1,3 +1,3 @@
 # Locally computed
-sha256  6f2df00009f5ac4ad654c1ae1d2f8ed18191de38d1f5a88a54ea99cc16936686  jimtcl-0.83.tar.gz
+sha256  435095b436b38b96dd85e8cda13878144813bf52066057f76368db178dd8fea2  jimtcl-0.84.tar.gz
 sha256  419f1146334e57fb258d6c957d1f94d43455ec0d24b1b54c4447e5f61a353950  LICENSE
package/jimtcl/jimtcl.mk +1 -1
index e81b2a250d..283cc0f4be 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-JIMTCL_VERSION = 0.83
+JIMTCL_VERSION = 0.84
 JIMTCL_SITE = $(call github,msteveb,jimtcl,$(JIMTCL_VERSION))
 JIMTCL_INSTALL_STAGING = YES
 JIMTCL_LICENSE = BSD-2-Clause
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Yegor Yefremov via buildroot
Quoted 11 lines · Yegor Yefremov via buildroot

jimtcl 0.84 replaced the isproc member of Jim_Cmd with a flags field, so openocd 0.12.0 fails to build against it:

src/helper/command.c:51:19: error: 'Jim_Cmd' has no member named 'isproc'

Backport the upstream fix, which checks JIM_CMD_ISPROC at compile time and thus also keeps working with jimtcl 0.83. Its context had to be refreshed for 0.12.0.

Assisted-by Claude:claude-opus-5-5

Series applied to master, thanks.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot