Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/libmodbus: bump version to 3.2.0
@ 2026-09-07 21:33 Julien BOIBESSOT
  2026-09-30 11:55 ` Yegor Yefremov via buildroot
  2026-10-03 16:34 ` Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 4+ messages in thread
From: Julien BOIBESSOT @ 2026-09-07 21:33 UTC (permalink / raw)
  To: buildroot; +Cc: Julien Boibessot

https://github.com/stephane/libmodbus/blob/v3.2.0/NEWS.md

libmodbus 3.2.0 adds termios2 support to allow custom baud rates (RTU),
but the TCGETS2/TCSETS2 ioctl constants are not exposed by musl through
<sys/ioctl.h>. Add a patch to include <asm/ioctls.h>, which defines
these constants on all Linux libc, fixing the build with musl.

Added tarball hash provided by upstream.

Bump requested by Buildroot's autobuilder.

Build tested with test-pkg (6 toolchains : uclibc, glibc, noMMU, musl, static, old glibc).

Signed-off-by: Julien BOIBESSOT <julien.boibessot@armadeus.com>
---
 ...-include-asm-ioctls.h-for-termios2-s.patch | 40 +++++++++++++++++++
 package/libmodbus/libmodbus.hash              |  4 +-
 package/libmodbus/libmodbus.mk                |  2 +-
 3 files changed, 43 insertions(+), 3 deletions(-)
 create mode 100644 package/libmodbus/0001-src-modbus-rtu-include-asm-ioctls.h-for-termios2-s.patch

diff --git a/package/libmodbus/0001-src-modbus-rtu-include-asm-ioctls.h-for-termios2-s.patch b/package/libmodbus/0001-src-modbus-rtu-include-asm-ioctls.h-for-termios2-s.patch
new file mode 100644
index 0000000000..21b4ecebbd
--- /dev/null
+++ b/package/libmodbus/0001-src-modbus-rtu-include-asm-ioctls.h-for-termios2-s.patch
@@ -0,0 +1,40 @@
+From 5f6af9e0e3d6adebc103a1f5a45a5b0d9c5a7e11 Mon Sep 17 00:00:00 2001
+From: Julien BOIBESSOT <julien.boibessot@armadeus.com>
+Date: Mon, 07 Sep 2026 18:54:00 +0200
+Subject: [PATCH] src/modbus-rtu: include <asm/ioctls.h> for termios2 support
+
+Since v3.2.0, libmodbus uses the Linux termios2 interface (TCGETS2,
+TCSETS2) to support custom baud rates. The configure check detects
+"struct termios2" via <asm/termbits.h>, but the TCGETS2/TCSETS2 ioctl
+constants are defined in <asm/ioctls.h>, which is not included by musl
+libc through <sys/ioctl.h>.
+
+This breaks the build on musl-based systems:
+
+  modbus-rtu.c: error: 'TCGETS2' undeclared (first use in this function)
+  modbus-rtu.c: error: 'TCSETS2' undeclared (first use in this function)
+
+Include <asm/ioctls.h> alongside <sys/ioctl.h> when HAVE_STRUCT_TERMIOS2
+is defined to expose the TC*2 ioctl constants on all Linux libc.
+
+Upstream: not yet
+
+Signed-off-by: Julien BOIBESSOT <julien.boibessot@armadeus.com>
+---
+ src/modbus-rtu.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/modbus-rtu.c b/src/modbus-rtu.c
+index 2a063fb1..d8414d2d 100644
+--- a/src/modbus-rtu.c
++++ b/src/modbus-rtu.c
+@@ -14,6 +14,7 @@
+ #endif
+ #if defined(HAVE_STRUCT_TERMIOS2)
+ #include <sys/ioctl.h>
++#include <asm/ioctls.h>
+ #endif
+ #include "modbus-private.h"
+ #include <assert.h>
+-- 
+2.43.0
diff --git a/package/libmodbus/libmodbus.hash b/package/libmodbus/libmodbus.hash
index ddca835f34..dc5674f308 100644
--- a/package/libmodbus/libmodbus.hash
+++ b/package/libmodbus/libmodbus.hash
@@ -1,4 +1,4 @@
-# From https://github.com/stephane/libmodbus/releases/tag/v3.1.12
-sha256  2f4d4191cd196c1fba131daec03b621db75129d8255c832fc66b259d9fc46e7b  libmodbus-3.1.12.tar.gz
+# From https://github.com/stephane/libmodbus/releases/tag/v3.2.0
+sha256  72239f319b9b8483e3d393c5a60865d734fcff18a8abbb2486e389834a2f6ef1  libmodbus-3.2.0.tar.gz
 # Locally computed
 sha256  dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551  COPYING.LESSER
diff --git a/package/libmodbus/libmodbus.mk b/package/libmodbus/libmodbus.mk
index 5d20aef35c..36e32fe5d4 100644
--- a/package/libmodbus/libmodbus.mk
+++ b/package/libmodbus/libmodbus.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-LIBMODBUS_VERSION = 3.1.12
+LIBMODBUS_VERSION = 3.2.0
 LIBMODBUS_SITE = https://github.com/stephane/libmodbus/releases/download/v$(LIBMODBUS_VERSION)
 LIBMODBUS_LICENSE = LGPL-2.1+
 LIBMODBUS_LICENSE_FILES = COPYING.LESSER
-- 
2.43.0

_______________________________________________
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/1] package/libmodbus: bump version to 3.2.0
  2026-09-07 21:33 [Buildroot] [PATCH 1/1] package/libmodbus: bump version to 3.2.0 Julien BOIBESSOT
@ 2026-09-30 11:55 ` Yegor Yefremov via buildroot
  2026-10-03 16:34 ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 4+ messages in thread
From: Yegor Yefremov via buildroot @ 2026-09-30 11:55 UTC (permalink / raw)
  To: Julien BOIBESSOT; +Cc: buildroot

On Tue, Sep 8, 2026 at 12:12 AM Julien BOIBESSOT
<julien.boibessot@armadeus.com> wrote:
>
> https://github.com/stephane/libmodbus/blob/v3.2.0/NEWS.md
>
> libmodbus 3.2.0 adds termios2 support to allow custom baud rates (RTU),
> but the TCGETS2/TCSETS2 ioctl constants are not exposed by musl through
> <sys/ioctl.h>. Add a patch to include <asm/ioctls.h>, which defines
> these constants on all Linux libc, fixing the build with musl.
>
> Added tarball hash provided by upstream.
>
> Bump requested by Buildroot's autobuilder.
>
> Build tested with test-pkg (6 toolchains : uclibc, glibc, noMMU, musl, static, old glibc).
>
> Signed-off-by: Julien BOIBESSOT <julien.boibessot@armadeus.com>

Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>

> ---
>  ...-include-asm-ioctls.h-for-termios2-s.patch | 40 +++++++++++++++++++
>  package/libmodbus/libmodbus.hash              |  4 +-
>  package/libmodbus/libmodbus.mk                |  2 +-
>  3 files changed, 43 insertions(+), 3 deletions(-)
>  create mode 100644 package/libmodbus/0001-src-modbus-rtu-include-asm-ioctls.h-for-termios2-s.patch
>
> diff --git a/package/libmodbus/0001-src-modbus-rtu-include-asm-ioctls.h-for-termios2-s.patch b/package/libmodbus/0001-src-modbus-rtu-include-asm-ioctls.h-for-termios2-s.patch
> new file mode 100644
> index 0000000000..21b4ecebbd
> --- /dev/null
> +++ b/package/libmodbus/0001-src-modbus-rtu-include-asm-ioctls.h-for-termios2-s.patch
> @@ -0,0 +1,40 @@
> +From 5f6af9e0e3d6adebc103a1f5a45a5b0d9c5a7e11 Mon Sep 17 00:00:00 2001
> +From: Julien BOIBESSOT <julien.boibessot@armadeus.com>
> +Date: Mon, 07 Sep 2026 18:54:00 +0200
> +Subject: [PATCH] src/modbus-rtu: include <asm/ioctls.h> for termios2 support
> +
> +Since v3.2.0, libmodbus uses the Linux termios2 interface (TCGETS2,
> +TCSETS2) to support custom baud rates. The configure check detects
> +"struct termios2" via <asm/termbits.h>, but the TCGETS2/TCSETS2 ioctl
> +constants are defined in <asm/ioctls.h>, which is not included by musl
> +libc through <sys/ioctl.h>.
> +
> +This breaks the build on musl-based systems:
> +
> +  modbus-rtu.c: error: 'TCGETS2' undeclared (first use in this function)
> +  modbus-rtu.c: error: 'TCSETS2' undeclared (first use in this function)
> +
> +Include <asm/ioctls.h> alongside <sys/ioctl.h> when HAVE_STRUCT_TERMIOS2
> +is defined to expose the TC*2 ioctl constants on all Linux libc.
> +
> +Upstream: not yet
> +
> +Signed-off-by: Julien BOIBESSOT <julien.boibessot@armadeus.com>
> +---
> + src/modbus-rtu.c | 1 +
> + 1 file changed, 1 insertion(+)
> +
> +diff --git a/src/modbus-rtu.c b/src/modbus-rtu.c
> +index 2a063fb1..d8414d2d 100644
> +--- a/src/modbus-rtu.c
> ++++ b/src/modbus-rtu.c
> +@@ -14,6 +14,7 @@
> + #endif
> + #if defined(HAVE_STRUCT_TERMIOS2)
> + #include <sys/ioctl.h>
> ++#include <asm/ioctls.h>
> + #endif
> + #include "modbus-private.h"
> + #include <assert.h>
> +--
> +2.43.0
> diff --git a/package/libmodbus/libmodbus.hash b/package/libmodbus/libmodbus.hash
> index ddca835f34..dc5674f308 100644
> --- a/package/libmodbus/libmodbus.hash
> +++ b/package/libmodbus/libmodbus.hash
> @@ -1,4 +1,4 @@
> -# From https://github.com/stephane/libmodbus/releases/tag/v3.1.12
> -sha256  2f4d4191cd196c1fba131daec03b621db75129d8255c832fc66b259d9fc46e7b  libmodbus-3.1.12.tar.gz
> +# From https://github.com/stephane/libmodbus/releases/tag/v3.2.0
> +sha256  72239f319b9b8483e3d393c5a60865d734fcff18a8abbb2486e389834a2f6ef1  libmodbus-3.2.0.tar.gz
>  # Locally computed
>  sha256  dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551  COPYING.LESSER
> diff --git a/package/libmodbus/libmodbus.mk b/package/libmodbus/libmodbus.mk
> index 5d20aef35c..36e32fe5d4 100644
> --- a/package/libmodbus/libmodbus.mk
> +++ b/package/libmodbus/libmodbus.mk
> @@ -4,7 +4,7 @@
>  #
>  ################################################################################
>
> -LIBMODBUS_VERSION = 3.1.12
> +LIBMODBUS_VERSION = 3.2.0
>  LIBMODBUS_SITE = https://github.com/stephane/libmodbus/releases/download/v$(LIBMODBUS_VERSION)
>  LIBMODBUS_LICENSE = LGPL-2.1+
>  LIBMODBUS_LICENSE_FILES = COPYING.LESSER
> --
> 2.43.0
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/libmodbus: bump version to 3.2.0
  2026-09-07 21:33 [Buildroot] [PATCH 1/1] package/libmodbus: bump version to 3.2.0 Julien BOIBESSOT
  2026-09-30 11:55 ` Yegor Yefremov via buildroot
@ 2026-10-03 16:34 ` Thomas Petazzoni via buildroot
  2026-10-06 21:39   ` Yegor Yefremov via buildroot
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-10-03 16:34 UTC (permalink / raw)
  To: Julien BOIBESSOT; +Cc: buildroot

On Mon, Sep 07, 2026 at 11:33:35PM +0200, Julien BOIBESSOT wrote:

> diff --git a/package/libmodbus/0001-src-modbus-rtu-include-asm-ioctls.h-for-termios2-s.patch b/package/libmodbus/0001-src-modbus-rtu-include-asm-ioctls.h-for-termios2-s.patch
> new file mode 100644
> index 0000000000..21b4ecebbd
> --- /dev/null
> +++ b/package/libmodbus/0001-src-modbus-rtu-include-asm-ioctls.h-for-termios2-s.patch
> @@ -0,0 +1,40 @@
> +From 5f6af9e0e3d6adebc103a1f5a45a5b0d9c5a7e11 Mon Sep 17 00:00:00 2001
> +From: Julien BOIBESSOT <julien.boibessot@armadeus.com>
> +Date: Mon, 07 Sep 2026 18:54:00 +0200
> +Subject: [PATCH] src/modbus-rtu: include <asm/ioctls.h> for termios2 support
> +
> +Since v3.2.0, libmodbus uses the Linux termios2 interface (TCGETS2,
> +TCSETS2) to support custom baud rates. The configure check detects
> +"struct termios2" via <asm/termbits.h>, but the TCGETS2/TCSETS2 ioctl
> +constants are defined in <asm/ioctls.h>, which is not included by musl
> +libc through <sys/ioctl.h>.
> +
> +This breaks the build on musl-based systems:
> +
> +  modbus-rtu.c: error: 'TCGETS2' undeclared (first use in this function)
> +  modbus-rtu.c: error: 'TCSETS2' undeclared (first use in this function)
> +
> +Include <asm/ioctls.h> alongside <sys/ioctl.h> when HAVE_STRUCT_TERMIOS2
> +is defined to expose the TC*2 ioctl constants on all Linux libc.
> +
> +Upstream: not yet

Thanks a lot, but we need patches to be submitted before they can be
accepted in Buildroot.

I'm not 100% sure including <asm/ioctls.h> is the right solution, but
I honestly don't know. These TC* ioctl() are a bit of a mess :/

Thomas
-- 
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

* Re: [Buildroot] [PATCH 1/1] package/libmodbus: bump version to 3.2.0
  2026-10-03 16:34 ` Thomas Petazzoni via buildroot
@ 2026-10-06 21:39   ` Yegor Yefremov via buildroot
  0 siblings, 0 replies; 4+ messages in thread
From: Yegor Yefremov via buildroot @ 2026-10-06 21:39 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Julien BOIBESSOT, buildroot

On Sat, Oct 3, 2026 at 6:34 PM Thomas Petazzoni via buildroot
<buildroot@buildroot.org> wrote:
>
> On Mon, Sep 07, 2026 at 11:33:35PM +0200, Julien BOIBESSOT wrote:
>
> > diff --git a/package/libmodbus/0001-src-modbus-rtu-include-asm-ioctls.h-for-termios2-s.patch b/package/libmodbus/0001-src-modbus-rtu-include-asm-ioctls.h-for-termios2-s.patch
> > new file mode 100644
> > index 0000000000..21b4ecebbd
> > --- /dev/null
> > +++ b/package/libmodbus/0001-src-modbus-rtu-include-asm-ioctls.h-for-termios2-s.patch
> > @@ -0,0 +1,40 @@
> > +From 5f6af9e0e3d6adebc103a1f5a45a5b0d9c5a7e11 Mon Sep 17 00:00:00 2001
> > +From: Julien BOIBESSOT <julien.boibessot@armadeus.com>
> > +Date: Mon, 07 Sep 2026 18:54:00 +0200
> > +Subject: [PATCH] src/modbus-rtu: include <asm/ioctls.h> for termios2 support
> > +
> > +Since v3.2.0, libmodbus uses the Linux termios2 interface (TCGETS2,
> > +TCSETS2) to support custom baud rates. The configure check detects
> > +"struct termios2" via <asm/termbits.h>, but the TCGETS2/TCSETS2 ioctl
> > +constants are defined in <asm/ioctls.h>, which is not included by musl
> > +libc through <sys/ioctl.h>.
> > +
> > +This breaks the build on musl-based systems:
> > +
> > +  modbus-rtu.c: error: 'TCGETS2' undeclared (first use in this function)
> > +  modbus-rtu.c: error: 'TCSETS2' undeclared (first use in this function)
> > +
> > +Include <asm/ioctls.h> alongside <sys/ioctl.h> when HAVE_STRUCT_TERMIOS2
> > +is defined to expose the TC*2 ioctl constants on all Linux libc.
> > +
> > +Upstream: not yet
>
> Thanks a lot, but we need patches to be submitted before they can be
> accepted in Buildroot.
>
> I'm not 100% sure including <asm/ioctls.h> is the right solution, but
> I honestly don't know. These TC* ioctl() are a bit of a mess :/

To get some data on the <asm/ioctls.h> question, I built libmodbus 3.2.0
with this patch using two Bootlin musl toolchains (stable 2026.08-1) on
architectures that have their own ioctl numbers, instead of the
asm-generic ones:

- mips32 musl: configure finds struct termios2, and the build passes
  without any warnings, so including <asm/ioctls.h> together with
  musl's <sys/ioctl.h> doesn't cause macro redefinition warnings.
  Without the patch it fails as described in the commit log:

    modbus-rtu.c:695:23: error: 'TCGETS2' undeclared
    modbus-rtu.c:911:23: error: 'TCSETS2' undeclared

- powerpc-e500mc musl: configure doesn't find struct termios2, so the
  new include is never reached and libmodbus uses the old termios
  code. The build passes.

On glibc and uClibc, <sys/ioctl.h> already pulls in <asm/ioctls.h>, so
the extra include changes nothing there.

Yegor
_______________________________________________
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-06 21:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-07 21:33 [Buildroot] [PATCH 1/1] package/libmodbus: bump version to 3.2.0 Julien BOIBESSOT
2026-09-30 11:55 ` Yegor Yefremov via buildroot
2026-10-03 16:34 ` Thomas Petazzoni via buildroot
2026-10-06 21:39   ` Yegor Yefremov via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox