public inbox for buildroot@busybox.net
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/tio: fix build with termio redefinition
@ 2020-05-11 14:26 Vadym Kochan
  2020-05-15 21:22 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Vadym Kochan @ 2020-05-11 14:26 UTC (permalink / raw)
  To: buildroot

Include termbits.h from asm-generic/ which does not have termio
definition which is already defined by sys/ioctl.h -> ioctl-types.h

Same approach is also used by flashrom tool.

Fixes: http://autobuild.buildroot.net/results/076d5f166631450d25f25916381f0bfd6f1d58da

Signed-off-by: Vadym Kochan <vadim4j@gmail.com>
---
 ...01-setspeed2-fix-termio-redefinition.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 package/tio/0001-setspeed2-fix-termio-redefinition.patch

diff --git a/package/tio/0001-setspeed2-fix-termio-redefinition.patch b/package/tio/0001-setspeed2-fix-termio-redefinition.patch
new file mode 100644
index 0000000000..89a555eceb
--- /dev/null
+++ b/package/tio/0001-setspeed2-fix-termio-redefinition.patch
@@ -0,0 +1,30 @@
+From 02e13b011b9fee00cafaf3ed95cb04a414e0aa35 Mon Sep 17 00:00:00 2001
+From: Vadym Kochan <vadim4j@gmail.com>
+Date: Sun, 10 May 2020 01:49:30 +0300
+Subject: [PATCH] setspeed2: fix termio redefinition
+
+Include termbits.h from asm-generic which does not defines 'struct
+termio' which causes redefinition issue with already declared one from
+the sys/ioctl.h -> ioctl-types.h by glibc.
+
+Signed-off-by: Vadym Kochan <vadim4j@gmail.com>
+---
+ src/setspeed2.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/setspeed2.c b/src/setspeed2.c
+index 0adf695..f80f0c2 100644
+--- a/src/setspeed2.c
++++ b/src/setspeed2.c
+@@ -21,7 +21,7 @@
+ 
+ #include <sys/ioctl.h>
+ #include <asm/ioctls.h>
+-#include <asm/termbits.h>
++#include <asm-generic/termbits.h>
+ 
+ int setspeed2(int fd, int baudrate)
+ {
+-- 
+2.26.2
+
-- 
2.26.2

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

* [Buildroot] [PATCH] package/tio: fix build with termio redefinition
  2020-05-11 14:26 [Buildroot] [PATCH] package/tio: fix build with termio redefinition Vadym Kochan
@ 2020-05-15 21:22 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2020-05-15 21:22 UTC (permalink / raw)
  To: buildroot

On Mon, 11 May 2020 17:26:02 +0300
Vadym Kochan <vadim4j@gmail.com> wrote:

> Include termbits.h from asm-generic/ which does not have termio
> definition which is already defined by sys/ioctl.h -> ioctl-types.h
> 
> Same approach is also used by flashrom tool.
> 
> Fixes: http://autobuild.buildroot.net/results/076d5f166631450d25f25916381f0bfd6f1d58da
> 
> Signed-off-by: Vadym Kochan <vadim4j@gmail.com>

A similar change was already submitted upstream by Fabrice Fontaine:

  https://github.com/tio/tio/pull/98/commits/7a84120f7bfbe698fa8050953b7a3e7a7dc63ca0

And it was submitted to Buildroot, and it was already rejected. Indeed,
including <asm-generic/...> headers from user-space is bad.

See some discussion in the picocom source code at
https://github.com/npat-efault/picocom/blob/master/termbits2.h#L37 for
more details about this issue.

Unfortunately, it doesn't seem like there is an easy fix available,
short of replicating what picocom did.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2020-05-15 21:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-11 14:26 [Buildroot] [PATCH] package/tio: fix build with termio redefinition Vadym Kochan
2020-05-15 21:22 ` Thomas Petazzoni

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