All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/tio: fix termio redefinition
@ 2019-12-27 20:45 Fabrice Fontaine
  2019-12-29 13:51 ` Thomas Petazzoni
  2019-12-29 20:43 ` Yann E. MORIN
  0 siblings, 2 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2019-12-27 20:45 UTC (permalink / raw)
  To: buildroot

Fixes:
 - http://autobuild.buildroot.org/results/1a7418b9cd11374a250f7509d5bddcc864375e1c

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...tspeed2.c-fix-redefinition-of-termio.patch | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 package/tio/0001-src-setspeed2.c-fix-redefinition-of-termio.patch

diff --git a/package/tio/0001-src-setspeed2.c-fix-redefinition-of-termio.patch b/package/tio/0001-src-setspeed2.c-fix-redefinition-of-termio.patch
new file mode 100644
index 0000000000..de47290a0d
--- /dev/null
+++ b/package/tio/0001-src-setspeed2.c-fix-redefinition-of-termio.patch
@@ -0,0 +1,45 @@
+From 7a84120f7bfbe698fa8050953b7a3e7a7dc63ca0 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Fri, 27 Dec 2019 17:41:14 +0100
+Subject: [PATCH] src/setspeed2.c: fix redefinition of termio
+
+Include ioctls.h and termbits.h from asm-generic instead of asm to avoid
+the following build failure:
+
+In file included from setspeed2.c:24:0:
+/home/naourr/work/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/asm/termbits.h:17:8: error: redefinition of 'struct termio'
+ struct termio {
+        ^~~~~~
+In file included from /home/naourr/work/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/sys/ioctl.h:29:0,
+                 from setspeed2.c:22:
+/home/naourr/work/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/bits/ioctl-types.h:36:8: note: originally defined here
+ struct termio
+        ^~~~~~
+
+Fixes:
+ - http://autobuild.buildroot.org/results/1a7418b9cd11374a250f7509d5bddcc864375e1c
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/tio/tio/pull/98]
+---
+ src/setspeed2.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/setspeed2.c b/src/setspeed2.c
+index 0adf695..6d82e66 100644
+--- a/src/setspeed2.c
++++ b/src/setspeed2.c
+@@ -20,8 +20,8 @@
+  */
+ 
+ #include <sys/ioctl.h>
+-#include <asm/ioctls.h>
+-#include <asm/termbits.h>
++#include <asm-generic/ioctls.h>
++#include <asm-generic/termbits.h>
+ 
+ int setspeed2(int fd, int baudrate)
+ {
+-- 
+2.24.0
+
-- 
2.24.0

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

* [Buildroot] [PATCH 1/1] package/tio: fix termio redefinition
  2019-12-27 20:45 [Buildroot] [PATCH 1/1] package/tio: fix termio redefinition Fabrice Fontaine
@ 2019-12-29 13:51 ` Thomas Petazzoni
  2019-12-29 20:43 ` Yann E. MORIN
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2019-12-29 13:51 UTC (permalink / raw)
  To: buildroot

Hello Fabrice,

On Fri, 27 Dec 2019 21:45:20 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> + #include <sys/ioctl.h>
> +-#include <asm/ioctls.h>
> +-#include <asm/termbits.h>
> ++#include <asm-generic/ioctls.h>
> ++#include <asm-generic/termbits.h>

Thanks for proposing a patch. While I haven't had the chance to look
for a better solution, I wanted to state that directly including an
<asm-generic/foo.h> header from user-space is generally consider a very
bad thing. Not all architectures use the asm-generic headers for all
headers, and the fact that some use asm-generic headers is an internal
implementation detail.

So, this patch feels like a (potentially incorrect) workaround more
than a proper fix.

Best regards,

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

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

* [Buildroot] [PATCH 1/1] package/tio: fix termio redefinition
  2019-12-27 20:45 [Buildroot] [PATCH 1/1] package/tio: fix termio redefinition Fabrice Fontaine
  2019-12-29 13:51 ` Thomas Petazzoni
@ 2019-12-29 20:43 ` Yann E. MORIN
  2019-12-29 22:17   ` Fabrice Fontaine
  1 sibling, 1 reply; 4+ messages in thread
From: Yann E. MORIN @ 2019-12-29 20:43 UTC (permalink / raw)
  To: buildroot

Fabrice, All,

On 2019-12-27 21:45 +0100, Fabrice Fontaine spake thusly:
> Fixes:
>  - http://autobuild.buildroot.org/results/1a7418b9cd11374a250f7509d5bddcc864375e1c
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Thanks for this patch, but I am on the same page as Thomas, so I've
marked this patch as Changes Requested on patchwork.

Regards,
Yann E. MORIN.

> ---
>  ...tspeed2.c-fix-redefinition-of-termio.patch | 45 +++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 package/tio/0001-src-setspeed2.c-fix-redefinition-of-termio.patch
> 
> diff --git a/package/tio/0001-src-setspeed2.c-fix-redefinition-of-termio.patch b/package/tio/0001-src-setspeed2.c-fix-redefinition-of-termio.patch
> new file mode 100644
> index 0000000000..de47290a0d
> --- /dev/null
> +++ b/package/tio/0001-src-setspeed2.c-fix-redefinition-of-termio.patch
> @@ -0,0 +1,45 @@
> +From 7a84120f7bfbe698fa8050953b7a3e7a7dc63ca0 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Fri, 27 Dec 2019 17:41:14 +0100
> +Subject: [PATCH] src/setspeed2.c: fix redefinition of termio
> +
> +Include ioctls.h and termbits.h from asm-generic instead of asm to avoid
> +the following build failure:
> +
> +In file included from setspeed2.c:24:0:
> +/home/naourr/work/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/asm/termbits.h:17:8: error: redefinition of 'struct termio'
> + struct termio {
> +        ^~~~~~
> +In file included from /home/naourr/work/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/sys/ioctl.h:29:0,
> +                 from setspeed2.c:22:
> +/home/naourr/work/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/bits/ioctl-types.h:36:8: note: originally defined here
> + struct termio
> +        ^~~~~~
> +
> +Fixes:
> + - http://autobuild.buildroot.org/results/1a7418b9cd11374a250f7509d5bddcc864375e1c
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +[Upstream status: https://github.com/tio/tio/pull/98]
> +---
> + src/setspeed2.c | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/src/setspeed2.c b/src/setspeed2.c
> +index 0adf695..6d82e66 100644
> +--- a/src/setspeed2.c
> ++++ b/src/setspeed2.c
> +@@ -20,8 +20,8 @@
> +  */
> + 
> + #include <sys/ioctl.h>
> +-#include <asm/ioctls.h>
> +-#include <asm/termbits.h>
> ++#include <asm-generic/ioctls.h>
> ++#include <asm-generic/termbits.h>
> + 
> + int setspeed2(int fd, int baudrate)
> + {
> +-- 
> +2.24.0
> +
> -- 
> 2.24.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 1/1] package/tio: fix termio redefinition
  2019-12-29 20:43 ` Yann E. MORIN
@ 2019-12-29 22:17   ` Fabrice Fontaine
  0 siblings, 0 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2019-12-29 22:17 UTC (permalink / raw)
  To: buildroot

Hi,

Le dim. 29 d?c. 2019 ? 21:43, Yann E. MORIN <yann.morin.1998@free.fr> a ?crit :
>
> Fabrice, All,
>
> On 2019-12-27 21:45 +0100, Fabrice Fontaine spake thusly:
> > Fixes:
> >  - http://autobuild.buildroot.org/results/1a7418b9cd11374a250f7509d5bddcc864375e1c
> >
> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
>
> Thanks for this patch, but I am on the same page as Thomas, so I've
> marked this patch as Changes Requested on patchwork.
I basically copy/pasted what is done in flashrom:
https://github.com/flashrom/flashrom/blob/ac01baa073b0f154ffd3ffdc7c9e75987f8b525c/custom_baud.c.
An other solution would be to remove the include on sys/ioctl.h but
this will produce an implicit-function-declaration warning for the
ioctl function.
>
> Regards,
> Yann E. MORIN.
>
> > ---
> >  ...tspeed2.c-fix-redefinition-of-termio.patch | 45 +++++++++++++++++++
> >  1 file changed, 45 insertions(+)
> >  create mode 100644 package/tio/0001-src-setspeed2.c-fix-redefinition-of-termio.patch
> >
> > diff --git a/package/tio/0001-src-setspeed2.c-fix-redefinition-of-termio.patch b/package/tio/0001-src-setspeed2.c-fix-redefinition-of-termio.patch
> > new file mode 100644
> > index 0000000000..de47290a0d
> > --- /dev/null
> > +++ b/package/tio/0001-src-setspeed2.c-fix-redefinition-of-termio.patch
> > @@ -0,0 +1,45 @@
> > +From 7a84120f7bfbe698fa8050953b7a3e7a7dc63ca0 Mon Sep 17 00:00:00 2001
> > +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> > +Date: Fri, 27 Dec 2019 17:41:14 +0100
> > +Subject: [PATCH] src/setspeed2.c: fix redefinition of termio
> > +
> > +Include ioctls.h and termbits.h from asm-generic instead of asm to avoid
> > +the following build failure:
> > +
> > +In file included from setspeed2.c:24:0:
> > +/home/naourr/work/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/asm/termbits.h:17:8: error: redefinition of 'struct termio'
> > + struct termio {
> > +        ^~~~~~
> > +In file included from /home/naourr/work/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/sys/ioctl.h:29:0,
> > +                 from setspeed2.c:22:
> > +/home/naourr/work/instance-0/output-1/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/bits/ioctl-types.h:36:8: note: originally defined here
> > + struct termio
> > +        ^~~~~~
> > +
> > +Fixes:
> > + - http://autobuild.buildroot.org/results/1a7418b9cd11374a250f7509d5bddcc864375e1c
> > +
> > +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> > +[Upstream status: https://github.com/tio/tio/pull/98]
> > +---
> > + src/setspeed2.c | 4 ++--
> > + 1 file changed, 2 insertions(+), 2 deletions(-)
> > +
> > +diff --git a/src/setspeed2.c b/src/setspeed2.c
> > +index 0adf695..6d82e66 100644
> > +--- a/src/setspeed2.c
> > ++++ b/src/setspeed2.c
> > +@@ -20,8 +20,8 @@
> > +  */
> > +
> > + #include <sys/ioctl.h>
> > +-#include <asm/ioctls.h>
> > +-#include <asm/termbits.h>
> > ++#include <asm-generic/ioctls.h>
> > ++#include <asm-generic/termbits.h>
> > +
> > + int setspeed2(int fd, int baudrate)
> > + {
> > +--
> > +2.24.0
> > +
> > --
> > 2.24.0
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>
> --
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'
Best Regards,

Fabrice

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

end of thread, other threads:[~2019-12-29 22:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-27 20:45 [Buildroot] [PATCH 1/1] package/tio: fix termio redefinition Fabrice Fontaine
2019-12-29 13:51 ` Thomas Petazzoni
2019-12-29 20:43 ` Yann E. MORIN
2019-12-29 22:17   ` Fabrice Fontaine

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.