Skip to contentSkip to conversation

package/linux-serial-test: fix build on MIPS

PATCH New Fabrice Fontaine 3 participants 5 messages Nov 9, 2019 – Nov 10, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/linux-serial-test: fix build on MIPS

Fixes:
- http://autobuild.buildroot.org/results/86e06fdcaa91dca682651736162e9e743329412c

---
 ...t.c-fix-missing-CMSPAR-define-on-MIP.patch | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 package/linux-serial-test/0001-linux-serial-test.c-fix-missing-CMSPAR-define-on-MIP.patch
package/linux-serial-test/0001-linux-serial-test.c-fix-missing-CMSPAR-define-on-MIP.patch new file +54 -0
new file mode 100644
index 0000000000..fe5a1c6813
@@ -0,0 +1,54 @@
+From c34767aa22623a21369f1464c52fc4635895223c Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 8 Nov 2019 18:25:35 +0100
+Subject: [PATCH] linux-serial-test.c: fix missing CMSPAR define on MIPS
+
+This patch is an adaptation of
+https://git.busybox.net/buildroot/diff/package/freerdp/0003-add-missing-define.patch?id=78cd32631e959e04b1a2f18be7b0757e21482438
+
+linux-serial-test.c uses CMSPAR, which is defined by glibc in
+bits/termios.h.
+
+glibc has two flavours of bits/termios.h: a generic one and an
+architecture-specific one. When installing, glibc will install the
+architecture-specific file if it exists, otherwise it installs the
+generic file. Only Alpha, MIPS, PPC and Sparc have their own
+bits/termios.h.
+
+The generic bits/termios.h, as well as the Alpha, PPC and Sparc flavours
+do define CMSPAR. However, the MIPS flavour does not define it.
+
+Define CMSPAR to the value from the generic value, which is also the
+value known to the Linux kernel for MIPS.
+
+Fixes:
+ - http://autobuild.buildroot.org/results/1350cc46dcb285772b1a4c90aec6ba38fdb11e3c
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Upstream status: https://github.com/cbrake/linux-serial-test/pull/20]
+---
+ linux-serial-test.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/linux-serial-test.c b/linux-serial-test.c
+index 5e7504e..0d4a919 100644
+--- a/linux-serial-test.c
++++ b/linux-serial-test.c
+@@ -17,6 +17,14 @@
+ #include <linux/serial.h>
+ #include <errno.h>
+ 
++/* 
++ * glibc for MIPS has its own bits/termios.h which does not define
++ * CMSPAR, so we vampirise the value from the generic bits/termios.h
++ */
++#ifndef CMSPAR
++#define CMSPAR 010000000000
++#endif
++
+ // command line args
+ int _cl_baud = 0;
+ char *_cl_port = NULL;
+-- 
+2.23.0
+
Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/1 package/linux-serial-test: fix build on MIPS

Hi Fabrice,

Quoted 5 lines · Fabrice Fontaine

Fixes:
- http://autobuild.buildroot.org/results/86e06fdcaa91dca682651736162e9e743329412c

Could you also submit a PR upstream?

Thanks.

Regards.
Yegor

Quoted 68 lines
---
 ...t.c-fix-missing-CMSPAR-define-on-MIP.patch | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 package/linux-serial-test/0001-linux-serial-test.c-fix-missing-CMSPAR-define-on-MIP.patch
package/linux-serial-test/0001-linux-serial-test.c-fix-missing-CMSPAR-define-on-MIP.patch new file +54 -1
new file mode 100644
index 0000000000..fe5a1c6813
@@ -0,0 +1,54 @@
+From c34767aa22623a21369f1464c52fc4635895223c Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 8 Nov 2019 18:25:35 +0100
+Subject: [PATCH] linux-serial-test.c: fix missing CMSPAR define on MIPS
+
+This patch is an adaptation of
+https://git.busybox.net/buildroot/diff/package/freerdp/0003-add-missing-define.patch?id=78cd32631e959e04b1a2f18be7b0757e21482438
+
+linux-serial-test.c uses CMSPAR, which is defined by glibc in
+bits/termios.h.
+
+glibc has two flavours of bits/termios.h: a generic one and an
+architecture-specific one. When installing, glibc will install the
+architecture-specific file if it exists, otherwise it installs the
+generic file. Only Alpha, MIPS, PPC and Sparc have their own
+bits/termios.h.
+
+The generic bits/termios.h, as well as the Alpha, PPC and Sparc flavours
+do define CMSPAR. However, the MIPS flavour does not define it.
+
+Define CMSPAR to the value from the generic value, which is also the
+value known to the Linux kernel for MIPS.
+
+Fixes:
+ - http://autobuild.buildroot.org/results/1350cc46dcb285772b1a4c90aec6ba38fdb11e3c
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Upstream status: https://github.com/cbrake/linux-serial-test/pull/20]
+---
+ linux-serial-test.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/linux-serial-test.c b/linux-serial-test.c
+index 5e7504e..0d4a919 100644
+--- a/linux-serial-test.c
++++ b/linux-serial-test.c
+@@ -17,6 +17,14 @@
+ #include <linux/serial.h>
+ #include <errno.h>
+
++/*
++ * glibc for MIPS has its own bits/termios.h which does not define
++ * CMSPAR, so we vampirise the value from the generic bits/termios.h
++ */
++#ifndef CMSPAR
++#define CMSPAR 010000000000
++#endif
++
+ // command line args
+ int _cl_baud = 0;
+ char *_cl_port = NULL;
+--
+2.23.0
+
--

2.23.0

#2 lore raw

PATCH 1/1 package/linux-serial-test: fix build on MIPS

Quoted 6 lines · Yegor Yefremov

Hi Fabrice,

Quoted 1 line · Fabrice Fontaine
Quoted 8 lines
Quoted 4 lines

Fixes:
- http://autobuild.buildroot.org/results/86e06fdcaa91dca682651736162e9e743329412c

Could you also submit a PR upstream?

OK. It's already merged. Thanks and sorry for the noise.

Yegor

Quoted 68 lines
Quoted 68 lines
---
 ...t.c-fix-missing-CMSPAR-define-on-MIP.patch | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 package/linux-serial-test/0001-linux-serial-test.c-fix-missing-CMSPAR-define-on-MIP.patch
package/linux-serial-test/0001-linux-serial-test.c-fix-missing-CMSPAR-define-on-MIP.patch new file +54 -1
new file mode 100644
index 0000000000..fe5a1c6813
@@ -0,0 +1,54 @@
+From c34767aa22623a21369f1464c52fc4635895223c Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 8 Nov 2019 18:25:35 +0100
+Subject: [PATCH] linux-serial-test.c: fix missing CMSPAR define on MIPS
+
+This patch is an adaptation of
+https://git.busybox.net/buildroot/diff/package/freerdp/0003-add-missing-define.patch?id=78cd32631e959e04b1a2f18be7b0757e21482438
+
+linux-serial-test.c uses CMSPAR, which is defined by glibc in
+bits/termios.h.
+
+glibc has two flavours of bits/termios.h: a generic one and an
+architecture-specific one. When installing, glibc will install the
+architecture-specific file if it exists, otherwise it installs the
+generic file. Only Alpha, MIPS, PPC and Sparc have their own
+bits/termios.h.
+
+The generic bits/termios.h, as well as the Alpha, PPC and Sparc flavours
+do define CMSPAR. However, the MIPS flavour does not define it.
+
+Define CMSPAR to the value from the generic value, which is also the
+value known to the Linux kernel for MIPS.
+
+Fixes:
+ - http://autobuild.buildroot.org/results/1350cc46dcb285772b1a4c90aec6ba38fdb11e3c
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Upstream status: https://github.com/cbrake/linux-serial-test/pull/20]
+---
+ linux-serial-test.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/linux-serial-test.c b/linux-serial-test.c
+index 5e7504e..0d4a919 100644
+--- a/linux-serial-test.c
++++ b/linux-serial-test.c
+@@ -17,6 +17,14 @@
+ #include <linux/serial.h>
+ #include <errno.h>
+
++/*
++ * glibc for MIPS has its own bits/termios.h which does not define
++ * CMSPAR, so we vampirise the value from the generic bits/termios.h
++ */
++#ifndef CMSPAR
++#define CMSPAR 010000000000
++#endif
++
+ // command line args
+ int _cl_baud = 0;
+ char *_cl_port = NULL;
+--
+2.23.0
+
--

2.23.0

#3 lore raw

PATCH 1/1 package/linux-serial-test: fix build on MIPS

In reply to Fabrice Fontaine
Quoted 8 lines · On Sun, 10 Nov 2019 00:13:21 +0100 Fabrice Fontaine…

Fixes:
- http://autobuild.buildroot.org/results/86e06fdcaa91dca682651736162e9e743329412c

---
 ...t.c-fix-missing-CMSPAR-define-on-MIP.patch | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 package/linux-serial-test/0001-linux-serial-test.c-fix-missing-CMSPAR-define-on-MIP.patch

Applied to master, thanks. Could you also send a patch to glibc adding the missing define to the MIPS header? Because this would be the real fix for this issue in fact.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH 1/1 package/linux-serial-test: fix build on MIPS

Hi Thomas,

Le dim. 10 nov. 2019 ? 14:16, Thomas Petazzoni
<[email protected]> a ?crit :

Quoted 13 lines
Quoted 8 lines · On Sun, 10 Nov 2019 00:13:21 +0100 Fabrice Fontaine…

Fixes:
- http://autobuild.buildroot.org/results/86e06fdcaa91dca682651736162e9e743329412c

---
 ...t.c-fix-missing-CMSPAR-define-on-MIP.patch | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 package/linux-serial-test/0001-linux-serial-test.c-fix-missing-CMSPAR-define-on-MIP.patch
Quoted 3 lines

Applied to master, thanks. Could you also send a patch to glibc adding the missing define to the MIPS header? Because this would be the real fix for this issue in fact.

glibc has been "fixed" since January 2019 with
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=6f343c1f338ca70411772309a3bbb1d67c71f419
as this commit removes the arch specific termios.h. However, uclibc-ng continues to have this issue so I'll send a patch.

Quoted 8 lines

Thanks!

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

Best Regards,

Fabrice