All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/3] package/jimtcl: install pkg-config file
@ 2026-10-24  7:56 Yegor Yefremov
  2026-10-24  7:56 ` [Buildroot] [PATCH 2/3] package/openocd: fix static build with jimtcl Yegor Yefremov via buildroot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yegor Yefremov @ 2026-10-24  7:56 UTC (permalink / raw)
  To: buildroot; +Cc: Ezequiel Garcia

Install jimtcl.pc to staging, so that packages can use pkg-config to
find jimtcl. This is especially needed for static linking, as jimtcl
lists the libraries it links against (e.g. openssl and zlib) in
Libs.private.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 package/jimtcl/jimtcl.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/jimtcl/jimtcl.mk b/package/jimtcl/jimtcl.mk
index f2d59265ad..5e09e776ad 100644
--- a/package/jimtcl/jimtcl.mk
+++ b/package/jimtcl/jimtcl.mk
@@ -71,6 +71,8 @@ define JIMTCL_INSTALL_STAGING_CMDS
 		cp -a $(@D)/$$i $(STAGING_DIR)/usr/include/ || exit 1 ; \
 	done; \
 	$(call JIMTCL_INSTALL_LIB,$(STAGING_DIR))
+	$(INSTALL) -m 0644 -D $(@D)/jimtcl.pc \
+		$(STAGING_DIR)/usr/lib/pkgconfig/jimtcl.pc
 endef
 
 define JIMTCL_INSTALL_TARGET_CMDS
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 2/3] package/openocd: fix static build with jimtcl
  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
  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
  2 siblings, 0 replies; 4+ messages in thread
From: Yegor Yefremov via buildroot @ 2026-10-24  7:56 UTC (permalink / raw)
  To: buildroot; +Cc: Ezequiel Garcia

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 3/3] package/jimtcl: fix optional openssl and zlib dependencies
  2026-10-24  7:56 [Buildroot] [PATCH 1/3] package/jimtcl: install pkg-config file Yegor Yefremov
  2026-10-24  7:56 ` [Buildroot] [PATCH 2/3] package/openocd: fix static build with jimtcl Yegor Yefremov via buildroot
@ 2026-10-24  7:56 ` Yegor Yefremov
  2026-10-24 21:31 ` [Buildroot] [PATCH 1/3] package/jimtcl: install pkg-config file Thomas Petazzoni via buildroot
  2 siblings, 0 replies; 4+ messages in thread
From: Yegor Yefremov @ 2026-10-24  7:56 UTC (permalink / raw)
  To: buildroot; +Cc: Ezequiel Garcia

Since jimtcl 0.83, the "full" configuration is the default, so jimtcl
automatically enables ssl support in the aio extension and the zlib
extension when openssl and zlib are found. As these dependencies are
not declared, the result depends on whether openssl and zlib happen to
be built before jimtcl.

Add them to the dependencies when they are enabled (with host-pkgconf,
which jimtcl uses to find them), and otherwise pass --disable-ssl and
--without-ext=zlib.

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: 283821fc31c4890f141111cbc5994e36703c91eb ("package/jimtcl: bump to version 0.83")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 package/jimtcl/jimtcl.mk | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/package/jimtcl/jimtcl.mk b/package/jimtcl/jimtcl.mk
index 5e09e776ad..e81b2a250d 100644
--- a/package/jimtcl/jimtcl.mk
+++ b/package/jimtcl/jimtcl.mk
@@ -24,6 +24,20 @@ define JIMTCL_LINK_TCLSH
 endef
 endif
 
+# jimtcl automatically enables ssl support in the aio extension and
+# the zlib extension when the libraries are found
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
+JIMTCL_DEPENDENCIES += host-pkgconf openssl
+else
+JIMTCL_CONF_OPTS += --disable-ssl
+endif
+
+ifeq ($(BR2_PACKAGE_ZLIB),y)
+JIMTCL_DEPENDENCIES += host-pkgconf zlib
+else
+JIMTCL_CONF_OPTS += --without-ext=zlib
+endif
+
 ifeq ($(BR2_STATIC_LIBS),y)
 define JIMTCL_INSTALL_LIB
 	$(INSTALL) -m 0644 -D $(@D)/libjim.a $(1)/usr/lib/libjim.a
@@ -55,6 +69,7 @@ define JIMTCL_CONFIGURE_CMDS
 		--host=$(GNU_TARGET_NAME) \
 		--build=$(GNU_HOST_NAME) \
 		$(JIMTCL_SHARED) \
+		$(JIMTCL_CONF_OPTS) \
 	)
 endef
 
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH 1/3] package/jimtcl: install pkg-config file
  2026-10-24  7:56 [Buildroot] [PATCH 1/3] package/jimtcl: install pkg-config file Yegor Yefremov
  2026-10-24  7:56 ` [Buildroot] [PATCH 2/3] package/openocd: fix static build with jimtcl Yegor Yefremov via buildroot
  2026-10-24  7:56 ` [Buildroot] [PATCH 3/3] package/jimtcl: fix optional openssl and zlib dependencies Yegor Yefremov
@ 2026-10-24 21:31 ` Thomas Petazzoni via buildroot
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-24 21:31 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: buildroot, Ezequiel Garcia

On Sat, Oct 24, 2026 at 09:56:26AM +0200, Yegor Yefremov wrote:
> Install jimtcl.pc to staging, so that packages can use pkg-config to
> find jimtcl. This is especially needed for static linking, as jimtcl
> lists the libraries it links against (e.g. openssl and zlib) in
> Libs.private.
> 
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

Series applied, thanks!

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-24 21:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-24  7:56 [Buildroot] [PATCH 1/3] package/jimtcl: install pkg-config file Yegor Yefremov
2026-10-24  7:56 ` [Buildroot] [PATCH 2/3] package/openocd: fix static build with jimtcl Yegor Yefremov via buildroot
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.