Skip to contentSkip to conversation

gnuradio: stat.h is need for mode_t

PATCH New Gwenhael Goavec-Merou 3 participants 6 messages Aug 28, 2015 – Aug 29, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gnuradio: stat.h is need for mode_t

From: Gwenhael Goavec-Merou <[email protected]>

fix :
http://autobuild.buildroot.net/results/8e3/8e3afd5f22312f0660f631fdb82bbb64eda913fb/build-end.log

error: 'mode_t' has not been declared

---
 package/gnuradio/0002-stat_t-is-need-for-mode_t.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 package/gnuradio/0002-stat_t-is-need-for-mode_t.patch
package/gnuradio/0002-stat_t-is-need-for-mode_t.patch new file +13 -0
new file mode 100644
index 0000000..391a12f
@@ -0,0 +1,13 @@
+Index: gnuradio-3.7.5/gnuradio-runtime/include/gnuradio/logger.h.in
+===================================================================
+--- gnuradio-3.7.5.orig/gnuradio-runtime/include/gnuradio/logger.h.in
++++ gnuradio-3.7.5/gnuradio-runtime/include/gnuradio/logger.h.in
+@@ -44,6 +44,8 @@
+ 
+ #ifdef _MSC_VER
+ typedef unsigned short mode_t;
++#else
++#include <sys/stat.h>
+ #endif
+ 
+ #include <gnuradio/api.h>
Signature · 1 line
2.4.6
#1 lore raw

PATCH 1/1 gnuradio: stat.h is need for mode_t

Dear Gwenhael Goavec-Merou,

Quoted 23 lines · Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

fix :
http://autobuild.buildroot.net/results/8e3/8e3afd5f22312f0660f631fdb82bbb64eda913fb/build-end.log

error: 'mode_t' has not been declared

---
 package/gnuradio/0002-stat_t-is-need-for-mode_t.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 package/gnuradio/0002-stat_t-is-need-for-mode_t.patch
package/gnuradio/0002-stat_t-is-need-for-mode_t.patch new file +3 -0
new file mode 100644
index 0000000..391a12f
@@ -0,0 +1,13 @@
+Index: gnuradio-3.7.5/gnuradio-runtime/include/gnuradio/logger.h.in
+===================================================================
+--- gnuradio-3.7.5.orig/gnuradio-runtime/include/gnuradio/logger.h.in

package/gnuradio/0002-stat_t-is-need-for-mode_t.patch line 13

Quoted 10 lines
package/gnuradio/0002-stat_t-is-need-for-mode_t.patch new file +10 -0
++++ gnuradio-3.7.5/gnuradio-runtime/include/gnuradio/logger.h.in
+@@ -44,6 +44,8 @@
+ 
+ #ifdef _MSC_VER
+ typedef unsigned short mode_t;
++#else
++#include <sys/stat.h>
+ #endif
+ 
+ #include <gnuradio/api.h>

I cannot see that change upstream, so I will assume that you haven't backported this patch from it:

http://gnuradio.org/redmine/projects/gnuradio/repository/revisions/master/entry/gnuradio-runtime/include/gnuradio/logger.h.in

Have you tried to submit it your patch upstream? It would be nice if the upstream package is fixed as well, so we can just backport the patch from it, or even better, bump our version to one which has that problem fixed.

Regards,

Vincent.

#2 lore raw

PATCH 1/1 gnuradio: stat.h is need for mode_t

Dear Vicente Olivert Riera

Quoted 42 lines · On Fri, 28 Aug 2015 16:09:37 +0100 Vicente Olivert Riera…

Dear Gwenhael Goavec-Merou,

Quoted 26 lines · Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

fix :
http://autobuild.buildroot.net/results/8e3/8e3afd5f22312f0660f631fdb82bbb64eda913fb/build-end.log

error: 'mode_t' has not been declared

Signed-off-by: Gwenhael Goavec-Merou
<[email protected]> ---

 package/gnuradio/0002-stat_t-is-need-for-mode_t.patch | 13
+++++++++++++ 1 file changed, 13 insertions(+)
 create mode 100644

package/gnuradio/0002-stat_t-is-need-for-mode_t.patch

(quoted diff) +0 -0

b/package/gnuradio/0002-stat_t-is-need-for-mode_t.patch new file mode 100644 index 0000000..391a12f

package/gnuradio/0002-stat_t-is-need-for-mode_t.patch new file +3 -0
@@ -0,0 +1,13 @@
+Index: gnuradio-3.7.5/gnuradio-runtime/include/gnuradio/logger.h.in
+===================================================================
+---

gnuradio-3.7.5.orig/gnuradio-runtime/include/gnuradio/logger.h.in ++++ gnuradio-3.7.5/gnuradio-runtime/include/gnuradio/logger.h.in +@@ -44,6 +44,8 @@

Quoted 9 lines

+
+ #ifdef _MSC_VER
+ typedef unsigned short mode_t;
++#else
++#include <sys/stat.h>
+ #endif
+
+ #include <gnuradio/api.h>

I cannot see that change upstream, so I will assume that you haven't backported this patch from it:

Quoted 2 lines

http://gnuradio.org/redmine/projects/gnuradio/repository/revisions/master/entry/gnuradio-runtime/include/gnuradio/logger.h.in

No it's not a backport.

Quoted 5 lines

Have you tried to submit it your patch upstream? It would be nice if the upstream package is fixed as well, so we can just backport the patch from it, or even better, bump our version to one which has that problem fixed.

No. I'm agree with you about the need to send this patch to gnuradio but, currently, I'm not sure it's a global problem with all toolchains or strictly related to musl.

Quoted 3 lines

Regards,

Vincent.

Regards,
Gwenhael.

#3 lore raw

PATCH 1/1 gnuradio: stat.h is need for mode_t

In reply to Gwenhael Goavec-Merou

Dear Gwenhael Goavec-Merou,

Quoted 8 lines · Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

fix :
http://autobuild.buildroot.net/results/8e3/8e3afd5f22312f0660f631fdb82bbb64eda913fb/build-end.log

error: 'mode_t' has not been declared

mode_t is according to the standard
(http://pubs.opengroup.org/onlinepubs/007908799/xsh/sysstat.h.html)
defined in <sys/types.h>. Can you try including <sys/types.h> instead?

If that works as well, then please submit the patch upstream: it is valid for all toolchains.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH 1/1 gnuradio: stat.h is need for mode_t

Dear Thomas Petazzoni

Quoted 8 lines · On Fri, 28 Aug 2015 19:31:46 +0200 Thomas Petazzoni…

Dear Gwenhael Goavec-Merou,

Quoted 5 lines · Gwenhael Goavec-Merou

From: Gwenhael Goavec-Merou <[email protected]>

fix :
http://autobuild.buildroot.net/results/8e3/8e3afd5f22312f0660f631fdb82bbb64eda913fb/build-end.log

Quoted 9 lines
Quoted 4 lines

error: 'mode_t' has not been declared

Signed-off-by: Gwenhael Goavec-Merou
<[email protected]>

mode_t is according to the standard
(http://pubs.opengroup.org/onlinepubs/007908799/xsh/sysstat.h.html)
defined in <sys/types.h>. Can you try including <sys/types.h> instead?

Ok It's working with sys/types.h

Quoted 3 lines

If that works as well, then please submit the patch upstream: it is valid for all toolchains.

I've checked all the autobuild for 07/2015 and 08/2015. The missing mode_t only appears if the toolchain is based on musl. I'll will, nevertheless, try to send my patch to gnuradio.

Gwenhael

#5 lore raw

PATCH 1/1 gnuradio: stat.h is need for mode_t

Hello,

Quoted 5 lines · gwenhael.goavec
Quoted 4 lines

mode_t is according to the standard
(http://pubs.opengroup.org/onlinepubs/007908799/xsh/sysstat.h.html)
defined in <sys/types.h>. Can you try including <sys/types.h> instead?

Ok It's working with sys/types.h

Good.

Quoted 5 lines
Quoted 3 lines

If that works as well, then please submit the patch upstream: it is valid for all toolchains.

I've checked all the autobuild for 07/2015 and 08/2015. The missing mode_t only appears if the toolchain is based on musl.

Yes. It's just because with uClibc and glibc, <sys/types.h> is pulled in by another header that gets included by gnuradio.

However, using mode_t without <sys/types.h> is incorrect. It happens to be working by chance with uClibc and glibc, but is not technically
correct: as the POSIX standard specifies, mode_t is defined in <sys/types.h>, so this file should be included when mode_t is used.

See
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html

So the fix of including <sys/types.h> is not musl specific at all. It makes the code more correct.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com