From: Yegor Yefremov via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Subject: [Buildroot] [PATCH 2/3] package/openocd: fix static build with jimtcl
Date: Sat, 24 Oct 2026 09:56:27 +0200 [thread overview]
Message-ID: <20261024075628.3205436-2-yegorslists@googlemail.com> (raw)
In-Reply-To: <20261024075628.3205436-1-yegorslists@googlemail.com>
Since jimtcl 0.83, jimtcl enables ssl support in the aio extension and
the zlib extension when openssl and zlib are found. With
BR2_STATIC_LIBS, openocd then fails to link, as it only uses -ljim to
link against libjim.a:
jim-aio.c:(.text+0x16f4): undefined reference to `SSL_set_fd'
[...]
jim-zlib.c:(.text+0x11c): undefined reference to `deflateInit2_'
Backport an upstream commit making openocd use pkg-config to find
jimtcl, which adds the libraries from Libs.private when linking
statically. This requires the jimtcl.pc file installed by the previous
commit.
This issue has been present since commit 283821fc31c4 ("package/jimtcl:
bump to version 0.83"), as jimtcl 0.83 made its optional features
enabled by default. It therefore affects 2025.11 and later.
Fixes:
https://autobuild.buildroot.org/results/6436c7c81cda5eeb8331f18d40f33f4bf1dadd79
Fixes: 283821fc31c4890f141111cbc5994e36703c91eb ("package/jimtcl: bump to version 0.83")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
...-configure-Use-pkg-config-for-jimtcl.patch | 83 +++++++++++++++++++
1 file changed, 83 insertions(+)
create mode 100644 package/openocd/0004-configure-Use-pkg-config-for-jimtcl.patch
diff --git a/package/openocd/0004-configure-Use-pkg-config-for-jimtcl.patch b/package/openocd/0004-configure-Use-pkg-config-for-jimtcl.patch
new file mode 100644
index 0000000000..65f0f9424b
--- /dev/null
+++ b/package/openocd/0004-configure-Use-pkg-config-for-jimtcl.patch
@@ -0,0 +1,83 @@
+From a8a0b4c50768fb8bbcbd1683d020a31ad2bb0cad Mon Sep 17 00:00:00 2001
+From: Marc Schink <dev@zapb.de>
+Date: Tue, 2 Jul 2024 17:14:22 +0200
+Subject: [PATCH] configure: Use pkg-config for jimtcl
+
+The jimtcl project supports pkg-config, use it for a simpler
+configuration of compiler and linker flags and to enforce the minimum
+required package version.
+
+Since the jimtcl pkg-config file is not available on all systems, use
+AC_CHECK_HEADER() as fallback.
+
+Change-Id: I6fdcc818a8fdd205a126b0a46356434dbe890226
+Upstream: https://github.com/openocd-org/openocd/commit/a8a0b4c50768fb8bbcbd1683d020a31ad2bb0cad
+Signed-off-by: Marc Schink <dev@zapb.de>
+Reviewed-on: https://review.openocd.org/c/openocd/+/8383
+Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
+Tested-by: jenkins
+Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
+---
+ Makefile.am | 2 ++
+ configure.ac | 10 ++++++++++
+ src/Makefile.am | 4 ++++
+ 3 files changed, 16 insertions(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index 647b571cfa..2230e628f8 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -48,6 +48,8 @@ AM_CPPFLAGS = $(HOST_CPPFLAGS)\
+ if INTERNAL_JIMTCL
+ AM_CPPFLAGS += -I$(top_srcdir)/jimtcl \
+ -I$(top_builddir)/jimtcl
++else
++AM_CPPFLAGS += $(JIMTCL_CFLAGS)
+ endif
+ EXTRA_DIST += \
+ BUGS \
+diff --git a/configure.ac b/configure.ac
+index becc531b0d..b7aed245e6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -594,6 +594,15 @@ AS_IF([test "x$use_internal_jimtcl" = "xyes"], [
+ ], [
+ AC_MSG_ERROR([jimtcl not found, run git submodule init and git submodule update.])
+ ])
++], [
++ PKG_CHECK_MODULES([JIMTCL], [jimtcl >= 0.79], [
++ have_jimtcl_pkg_config=yes
++ ], [
++ have_jimtcl_pkg_config=no
++ AC_CHECK_HEADER([jim.h], [], [
++ AC_MSG_ERROR([jimtcl is required but not found via pkg-config and system includes])
++ ])
++ ])
+ ])
+
+ AS_IF([test "x$build_remote_bitbang" = "xyes"], [
+@@ -781,6 +790,7 @@ AM_CONDITIONAL([DMEM], [test "x$build_dmem" = "xyes"])
+ AM_CONDITIONAL([HAVE_CAPSTONE], [test "x$enable_capstone" != "xno"])
+
+ AM_CONDITIONAL([INTERNAL_JIMTCL], [test "x$use_internal_jimtcl" = "xyes"])
++AM_CONDITIONAL([HAVE_JIMTCL_PKG_CONFIG], [test "x$have_jimtcl_pkg_config" = "xyes"])
+ AM_CONDITIONAL([INTERNAL_LIBJAYLINK], [test "x$use_internal_libjaylink" = "xyes"])
+
+ # Look for environ alternatives. Possibility #1: is environ in unistd.h or stdlib.h?
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 6d79cd6311..4d1c1a2509 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -17,8 +17,12 @@ bin_PROGRAMS += %D%/openocd
+ if INTERNAL_JIMTCL
+ %C%_openocd_LDADD += $(top_builddir)/jimtcl/libjim.a
+ else
++if HAVE_JIMTCL_PKG_CONFIG
++%C%_openocd_LDADD += $(JIMTCL_LIBS)
++else
+ %C%_openocd_LDADD += -ljim
+ endif
++endif
+
+ %C%_libopenocd_la_CPPFLAGS =
+
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2026-10-24 7:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-24 7:56 [Buildroot] [PATCH 1/3] package/jimtcl: install pkg-config file Yegor Yefremov
2026-10-24 7:56 ` Yegor Yefremov via buildroot [this message]
2026-10-24 7:56 ` [Buildroot] [PATCH 3/3] package/jimtcl: fix optional openssl and zlib dependencies Yegor Yefremov
2026-10-24 21:31 ` [Buildroot] [PATCH 1/3] package/jimtcl: install pkg-config file Thomas Petazzoni via buildroot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261024075628.3205436-2-yegorslists@googlemail.com \
--to=buildroot@buildroot.org \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=yegorslists@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox