Skip to contentSkip to conversation

package/wvstreams: add patch to fix build with C99 compilers

PATCH New Jörg Krause 3 participants 6 messages Sep 23, 2016 – Oct 14, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/wvstreams: add patch to fix build with C99 compilers

wvstreams uses a bundled version of argp. Compiling argp fails for all compilers not using the C89 standard by default:

"""
In file included from argp-fmtstream.c:35:0:
argp-namefrob.h:62:32: error: redefinition of ?argp_fmtstream_write?

 #define __argp_fmtstream_write argp_fmtstream_write
                                ^

argp-fmtstream.c:395:1: note: in expansion of macro ?__argp_fmtstream_write?
__argp_fmtstream_write (argp_fmtstream_t __fs, ^
In file included from argp-fmtstream.c:34:0:
argp-fmtstream.h:209:32: note: previous definition of ?argp_fmtstream_write? was here

 #define __argp_fmtstream_write argp_fmtstream_write
                                ^

argp-fmtstream.h:223:1: note: in expansion of macro ?__argp_fmtstream_write?
__argp_fmtstream_write (argp_fmtstream_t __fs, ^
"""

The issue is that C99 changed inline semantics. This patch takes these changes into account and allows to build the bundled argp and therefore wvstreams with non-C89-compilers.

Note, that wvstreams is not maintained anymore. Last activity was on Github was 2011, the current version 1.6.1 dates from 2009.

Fetch-from: http://review.gluster.org/6034

Fixes:
http://autobuild.buildroot.net/results/f01/f0166f030875ecaf0d757790de6361339071831e/
http://autobuild.buildroot.net/results/32b/32b4eba8c7cbe8a3b1cde2d67f1af3f913fcc292/
http://autobuild.buildroot.net/results/38f/38fefa126596c6e267ffaf0f2dd9c5e3dcf09aff/
http://autobuild.buildroot.net/results/ea2/ea223c8a4f817541f55aa36c47b159a316031bff/
.. and many more.

---
 .../0006-fix-build-with-C99-compilers.patch        | 105 +++++++++++++++++++++
 1 file changed, 105 insertions(+)
 create mode 100644 package/wvstreams/0006-fix-build-with-C99-compilers.patch
package/wvstreams/0006-fix-build-with-C99-compilers.patch new file +75 -0
new file mode 100644
index 0000000..2bd34a0
@@ -0,0 +1,105 @@
+From b2dfa011a3fdcb7d22764d143517d0fbd1c2a201 Mon Sep 17 00:00:00 2001
+From: Emmanuel Dreyfus <[email protected]>
+Date: Wed, 22 Jan 2014 14:47:23 +0100
+Subject: [PATCH] Fix build with C99 compilers
+
+wvstreams uses a bundled version of argp. Compiling argp fails for all compilers
+not using the C89 standard by default:
+
+"""
+In file included from argp-fmtstream.c:35:0:
+argp-namefrob.h:62:32: error: redefinition of ?argp_fmtstream_write?
+ #define __argp_fmtstream_write argp_fmtstream_write
+                                ^
+argp-fmtstream.c:395:1: note: in expansion of macro ?__argp_fmtstream_write?
+ __argp_fmtstream_write (argp_fmtstream_t __fs,
+ ^
+In file included from argp-fmtstream.c:34:0:
+argp-fmtstream.h:209:32: note: previous definition of ?argp_fmtstream_write? was here
+ #define __argp_fmtstream_write argp_fmtstream_write
+                                ^
+argp-fmtstream.h:223:1: note: in expansion of macro ?__argp_fmtstream_write?
+ __argp_fmtstream_write (argp_fmtstream_t __fs,
+ ^
+"""
+
+The issue is that C99 changed inline semantics. This patch allows to build
+argp with non-C89-compilers.
+
+Fetch-from: http://review.gluster.org/6034
+
+Signed-off-by: Emmanuel Dreyfus <[email protected]>
+Reviewed-by: Harshavardhana <[email protected]>
+Tested-by: Gluster Build System <[email protected]>
+
+[Adapt paths for wvstreams. Add commit message.]
+Signed-off-by: J?rg Krause <[email protected]>
+---
+
+diff --git a/argp/argp-fmtstream.c b/argp/argp-fmtstream.c
+index 7f79285..494b6b3 100644
+--- a/argp/argp-fmtstream.c
++++ b/argp/argp-fmtstream.c
+@@ -389,6 +389,7 @@
+ weak_alias (__argp_fmtstream_printf, argp_fmtstream_printf)
+ #endif
+ 
++#if __STDC_VERSION__ - 199900L < 1
+ /* Duplicate the inline definitions in argp-fmtstream.h, for compilers
+  * that don't do inlining. */
+ size_t
+@@ -471,5 +472,6 @@
+     __argp_fmtstream_update (__fs);
+   return __fs->point_col >= 0 ? __fs->point_col : 0;
+ }
++#endif /* __STDC_VERSION__ - 199900L < 1 */
+ 
+ #endif /* !ARGP_FMTSTREAM_USE_LINEWRAP */
+diff --git a/argp/argp-fmtstream.h b/argp/argp-fmtstream.h
+index e797b11..828f435 100644
+--- a/argp/argp-fmtstream.h
++++ b/argp/argp-fmtstream.h
+@@ -153,6 +153,7 @@
+ 				      __const char *__fmt, ...)
+      PRINTF_STYLE(2,3);
+ 
++#if __STDC_VERSION__ - 199900L < 1
+ extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
+ extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
+ 
+@@ -163,6 +164,7 @@
+ 				      __const char *__str, size_t __len);
+ extern size_t argp_fmtstream_write (argp_fmtstream_t __fs,
+ 				    __const char *__str, size_t __len);
++#endif /* __STDC_VERSION__ - 199900L < 1 */
+ 

+ /* Access macros for various bits of state. */
+ #define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin) +@@ -172,6 +174,7 @@
+ #define __argp_fmtstream_rmargin argp_fmtstream_rmargin
+ #define __argp_fmtstream_wmargin argp_fmtstream_wmargin
+
++#if __STDC_VERSION__ - 199900L < 1
+ /* Set __FS's left margin to LMARGIN and return the old value. */
+ extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
+ size_t __lmargin);
+@@ -193,6 +196,7 @@
+ /* Return the column number of the current output point in __FS. */
+ extern size_t argp_fmtstream_point (argp_fmtstream_t __fs);
+ extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs); ++#endif /* __STDC_VERSION__ - 199900L < 1 */
+
+ /* Internal routines. */
+ extern void _argp_fmtstream_update (argp_fmtstream_t __fs); +@@ -216,7 +220,11 @@
+ #endif
+
+ #ifndef ARGP_FS_EI
++#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
+ #define ARGP_FS_EI extern inline
++#else
++#define ARGP_FS_EI inline
++#endif
+ #endif
+
+ ARGP_FS_EI size_t

Signature · 1 line
2.10.0
#1 lore raw

PATCH 1/1 package/wvstreams: add patch to fix build with C99 compilers

Hi J?rg,

Le 23/09/2016 ? 23:42, J?rg Krause a ?crit :

Quoted 23 lines

wvstreams uses a bundled version of argp. Compiling argp fails for all compilers not using the C89 standard by default:

"""
In file included from argp-fmtstream.c:35:0:
argp-namefrob.h:62:32: error: redefinition of ?argp_fmtstream_write?

 #define __argp_fmtstream_write argp_fmtstream_write
                                ^

argp-fmtstream.c:395:1: note: in expansion of macro ?__argp_fmtstream_write?
__argp_fmtstream_write (argp_fmtstream_t __fs, ^
In file included from argp-fmtstream.c:34:0:
argp-fmtstream.h:209:32: note: previous definition of ?argp_fmtstream_write? was here

 #define __argp_fmtstream_write argp_fmtstream_write
                                ^

argp-fmtstream.h:223:1: note: in expansion of macro ?__argp_fmtstream_write?
__argp_fmtstream_write (argp_fmtstream_t __fs, ^
"""

Quoted 6 lines

The issue is that C99 changed inline semantics. This patch takes these changes into account and allows to build the bundled argp and therefore wvstreams with non-C89-compilers.

Note, that wvstreams is not maintained anymore. Last activity was on Github was 2011, the current version 1.6.1 dates from 2009.

Thanks for this investigation and the fix.
Are you using wvstreams or it's for the sake of autobuilders ? I'm wondering if we should deprecate this package ? Last time I looked at it, I disabled it for musl based toolchains.

Thoughts ?

Best regards,
Romain

Quoted 129 lines

Fetch-from: http://review.gluster.org/6034

Fixes:
http://autobuild.buildroot.net/results/f01/f0166f030875ecaf0d757790de6361339071831e/
http://autobuild.buildroot.net/results/32b/32b4eba8c7cbe8a3b1cde2d67f1af3f913fcc292/
http://autobuild.buildroot.net/results/38f/38fefa126596c6e267ffaf0f2dd9c5e3dcf09aff/
http://autobuild.buildroot.net/results/ea2/ea223c8a4f817541f55aa36c47b159a316031bff/
.. and many more.

---
 .../0006-fix-build-with-C99-compilers.patch        | 105 +++++++++++++++++++++
 1 file changed, 105 insertions(+)
 create mode 100644 package/wvstreams/0006-fix-build-with-C99-compilers.patch
package/wvstreams/0006-fix-build-with-C99-compilers.patch new file +105 -0
new file mode 100644
index 0000000..2bd34a0
@@ -0,0 +1,105 @@
+From b2dfa011a3fdcb7d22764d143517d0fbd1c2a201 Mon Sep 17 00:00:00 2001
+From: Emmanuel Dreyfus <[email protected]>
+Date: Wed, 22 Jan 2014 14:47:23 +0100
+Subject: [PATCH] Fix build with C99 compilers
+
+wvstreams uses a bundled version of argp. Compiling argp fails for all compilers
+not using the C89 standard by default:
+
+"""
+In file included from argp-fmtstream.c:35:0:
+argp-namefrob.h:62:32: error: redefinition of ?argp_fmtstream_write?
+ #define __argp_fmtstream_write argp_fmtstream_write
+                                ^
+argp-fmtstream.c:395:1: note: in expansion of macro ?__argp_fmtstream_write?
+ __argp_fmtstream_write (argp_fmtstream_t __fs,
+ ^
+In file included from argp-fmtstream.c:34:0:
+argp-fmtstream.h:209:32: note: previous definition of ?argp_fmtstream_write? was here
+ #define __argp_fmtstream_write argp_fmtstream_write
+                                ^
+argp-fmtstream.h:223:1: note: in expansion of macro ?__argp_fmtstream_write?
+ __argp_fmtstream_write (argp_fmtstream_t __fs,
+ ^
+"""
+
+The issue is that C99 changed inline semantics. This patch allows to build
+argp with non-C89-compilers.
+
+Fetch-from: http://review.gluster.org/6034
+
+Signed-off-by: Emmanuel Dreyfus <[email protected]>
+Reviewed-by: Harshavardhana <[email protected]>
+Tested-by: Gluster Build System <[email protected]>
+
+[Adapt paths for wvstreams. Add commit message.]
+Signed-off-by: J?rg Krause <[email protected]>
+---
+
+diff --git a/argp/argp-fmtstream.c b/argp/argp-fmtstream.c
+index 7f79285..494b6b3 100644
+--- a/argp/argp-fmtstream.c
++++ b/argp/argp-fmtstream.c
+@@ -389,6 +389,7 @@
+ weak_alias (__argp_fmtstream_printf, argp_fmtstream_printf)
+ #endif
+ 
++#if __STDC_VERSION__ - 199900L < 1
+ /* Duplicate the inline definitions in argp-fmtstream.h, for compilers
+  * that don't do inlining. */
+ size_t
+@@ -471,5 +472,6 @@
+     __argp_fmtstream_update (__fs);
+   return __fs->point_col >= 0 ? __fs->point_col : 0;
+ }
++#endif /* __STDC_VERSION__ - 199900L < 1 */
+ 
+ #endif /* !ARGP_FMTSTREAM_USE_LINEWRAP */
+diff --git a/argp/argp-fmtstream.h b/argp/argp-fmtstream.h
+index e797b11..828f435 100644
+--- a/argp/argp-fmtstream.h
++++ b/argp/argp-fmtstream.h
+@@ -153,6 +153,7 @@
+ 				      __const char *__fmt, ...)
+      PRINTF_STYLE(2,3);
+ 
++#if __STDC_VERSION__ - 199900L < 1
+ extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
+ extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
+ 
+@@ -163,6 +164,7 @@
+ 				      __const char *__str, size_t __len);
+ extern size_t argp_fmtstream_write (argp_fmtstream_t __fs,
+ 				    __const char *__str, size_t __len);
++#endif /* __STDC_VERSION__ - 199900L < 1 */
+ 
 
+ /* Access macros for various bits of state.  */
+ #define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin)
+@@ -172,6 +174,7 @@
+ #define __argp_fmtstream_rmargin argp_fmtstream_rmargin
+ #define __argp_fmtstream_wmargin argp_fmtstream_wmargin
+ 
++#if __STDC_VERSION__ - 199900L < 1
+ /* Set __FS's left margin to LMARGIN and return the old value.  */
+ extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
+ 					  size_t __lmargin);
+@@ -193,6 +196,7 @@
+ /* Return the column number of the current output point in __FS.  */
+ extern size_t argp_fmtstream_point (argp_fmtstream_t __fs);
+ extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs);
++#endif /* __STDC_VERSION__ - 199900L < 1 */
+ 
+ /* Internal routines.  */
+ extern void _argp_fmtstream_update (argp_fmtstream_t __fs);
+@@ -216,7 +220,11 @@
+ #endif
+ 
+ #ifndef ARGP_FS_EI
++#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
+ #define ARGP_FS_EI extern inline
++#else
++#define ARGP_FS_EI inline
++#endif
+ #endif
+ 
+ ARGP_FS_EI size_t
#2 lore raw

PATCH 1/1 package/wvstreams: add patch to fix build with C99 compilers

Hi Romain,

Am 24. September 2016 10:31:57 MESZ, schrieb Romain Naour <[email protected]>:

Quoted 30 lines

Hi J?rg,

Le 23/09/2016 ? 23:42, J?rg Krause a ?crit :

Quoted 1 line

wvstreams uses a bundled version of argp. Compiling argp fails for

all

Quoted 16 lines

compilers not using the C89 standard by default:

"""
In file included from argp-fmtstream.c:35:0:
argp-namefrob.h:62:32: error: redefinition of ?argp_fmtstream_write?

 #define __argp_fmtstream_write argp_fmtstream_write
                                ^

argp-fmtstream.c:395:1: note: in expansion of macro ?__argp_fmtstream_write?
__argp_fmtstream_write (argp_fmtstream_t __fs, ^
In file included from argp-fmtstream.c:34:0:
argp-fmtstream.h:209:32: note: previous definition of ?argp_fmtstream_write? was here

 #define __argp_fmtstream_write argp_fmtstream_write
                                ^
Quoted 7 lines

argp-fmtstream.h:223:1: note: in expansion of macro ?__argp_fmtstream_write?
__argp_fmtstream_write (argp_fmtstream_t __fs, ^
"""

The issue is that C99 changed inline semantics. This patch takes

these

Quoted 1 line

changes into account and allows to build the bundled argp and

Quoted 8 lines

therefore

Quoted 4 lines

wvstreams with non-C89-compilers.

Note, that wvstreams is not maintained anymore. Last activity was on Github was 2011, the current version 1.6.1 dates from 2009.

Thanks for this investigation and the fix.
Are you using wvstreams or it's for the sake of autobuilders ?

No, I am not using wvstreams and yes, it is for the sake of autobuilders.

Quoted 4 lines

I'm wondering if we should deprecate this package ? Last time I looked at it, I disabled it for musl based toolchains.

Thoughts ?

I am not sure which policy Buildroot follows here, but I would like to know.

J?rg

#3 lore raw

PATCH 1/1 package/wvstreams: add patch to fix build with C99 compilers

Quoted 8 lines · J?rg Krause

Hi Romain,

Am 24. September 2016 10:31:57 MESZ, schrieb Romain Naour <[email protected]>:

Quoted 3 lines

Hi J?rg,

Le 23/09/2016 ? 23:42, J?rg Krause a ?crit :

[snip]

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Note, that wvstreams is not maintained anymore. Last activity was on Github was 2011, the current version 1.6.1 dates from 2009.

Thanks for this investigation and the fix.
Are you using wvstreams or it's for the sake of autobuilders ?

Quoted 8 lines

No, I am not using wvstreams and yes, it is for the sake of autobuilders.

Quoted 4 lines

I'm wondering if we should deprecate this package ? Last time I looked at it, I disabled it for musl based toolchains.

Thoughts ?

I am not sure which policy Buildroot follows here, but I would like to know.

This is precisely the kind of situation where we start considering deprecating
a package.

In this case, wvstreams only exists for the sake of wvdial. I don't know of
many alternatives however. modem-manager is somewhat bloaty, and chat + ppp.conf is a lot more difficult.

Adding Simon, the original contributor, for a second opinion.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#4 lore raw

PATCH 1/1 package/wvstreams: add patch to fix build with C99 compilers

Hi J?rg, Arnout, All

Le 24/09/2016 ? 18:14, Arnout Vandecappelle a ?crit :

Quoted 31 lines · J?rg Krause
Quoted 8 lines

Hi Romain,

Am 24. September 2016 10:31:57 MESZ, schrieb Romain Naour <[email protected]>:

Quoted 3 lines

Hi J?rg,

Le 23/09/2016 ? 23:42, J?rg Krause a ?crit :

[snip]

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Note, that wvstreams is not maintained anymore. Last activity was on Github was 2011, the current version 1.6.1 dates from 2009.

Thanks for this investigation and the fix.
Are you using wvstreams or it's for the sake of autobuilders ?

Quoted 8 lines

No, I am not using wvstreams and yes, it is for the sake of autobuilders.

Quoted 4 lines

I'm wondering if we should deprecate this package ? Last time I looked at it, I disabled it for musl based toolchains.

Thoughts ?

I am not sure which policy Buildroot follows here, but I would like to know.

This is precisely the kind of situation where we start considering deprecating
a package.

Quoted 6 lines

In this case, wvstreams only exists for the sake of wvdial. I don't know of
many alternatives however. modem-manager is somewhat bloaty, and chat + ppp.conf is a lot more difficult.

Adding Simon, the original contributor, for a second opinion.

I build tested this patch and indeed it fix the build with gcc5. But I tested with gcc6 and it fail with a weird C++ error:

streams/wvstream.cc: In member function ?void WvStream::_build_selectinfo(IWvStream::SelectInfo&, time_t, bool, bool, bool, bool)?:
streams/wvstream.cc:910:22: error: cannot convert ?IWvStreamCallback {aka std::tr1::function<void()>}? to ?bool? in assignment

  si.wants.readable = readcb;
                      ^~~~~~
streams/wvstream.cc:911:22: error: cannot convert ?IWvStreamCallback {aka
std::tr1::function<void()>}? to ?bool? in assignment
  si.wants.writable = writecb;
                      ^~~~~~~
streams/wvstream.cc:912:25: error: cannot convert ?IWvStreamCallback {aka
std::tr1::function<void()>}? to ?bool? in assignment
  si.wants.isexception = exceptcb;
                         ^~~~~~~~

streams/wvstream.cc: In member function ?IWvStream::SelectRequest WvStream::get_select_request()?:
streams/wvstream.cc:1022:62: error: no matching function for call to ?IWvStream::SelectRequest::SelectRequest(IWvStreamCallback&, IWvStreamCallback&, IWvStreamCallback&)?

     return IWvStream::SelectRequest(readcb, writecb, exceptcb);
                                                              ^

So, let's deprecate wvdial and wvstreams.

Best regards,
Romain

Quoted 4 lines

Regards,
Arnout

#5 lore raw

PATCH 1/1 package/wvstreams: add patch to fix build with C99 compilers

Hi All,

Le 08/10/2016 ? 12:22, Romain Naour a ?crit :

Quoted 59 lines

Hi J?rg, Arnout, All

Le 24/09/2016 ? 18:14, Arnout Vandecappelle a ?crit :

Quoted 31 lines · J?rg Krause
Quoted 8 lines

Hi Romain,

Am 24. September 2016 10:31:57 MESZ, schrieb Romain Naour <[email protected]>:

Quoted 3 lines

Hi J?rg,

Le 23/09/2016 ? 23:42, J?rg Krause a ?crit :

[snip]

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Note, that wvstreams is not maintained anymore. Last activity was on Github was 2011, the current version 1.6.1 dates from 2009.

Thanks for this investigation and the fix.
Are you using wvstreams or it's for the sake of autobuilders ?

Quoted 8 lines

No, I am not using wvstreams and yes, it is for the sake of autobuilders.

Quoted 4 lines

I'm wondering if we should deprecate this package ? Last time I looked at it, I disabled it for musl based toolchains.

Thoughts ?

I am not sure which policy Buildroot follows here, but I would like to know.

This is precisely the kind of situation where we start considering deprecating
a package.

Quoted 6 lines

In this case, wvstreams only exists for the sake of wvdial. I don't know of
many alternatives however. modem-manager is somewhat bloaty, and chat + ppp.conf is a lot more difficult.

Adding Simon, the original contributor, for a second opinion.

I build tested this patch and indeed it fix the build with gcc5. But I tested with gcc6 and it fail with a weird C++ error:

streams/wvstream.cc: In member function ?void WvStream::_build_selectinfo(IWvStream::SelectInfo&, time_t, bool, bool, bool, bool)?:
streams/wvstream.cc:910:22: error: cannot convert ?IWvStreamCallback {aka std::tr1::function<void()>}? to ?bool? in assignment

  si.wants.readable = readcb;
                      ^~~~~~
streams/wvstream.cc:911:22: error: cannot convert ?IWvStreamCallback {aka
std::tr1::function<void()>}? to ?bool? in assignment
  si.wants.writable = writecb;
                      ^~~~~~~
streams/wvstream.cc:912:25: error: cannot convert ?IWvStreamCallback {aka
std::tr1::function<void()>}? to ?bool? in assignment
  si.wants.isexception = exceptcb;
                         ^~~~~~~~
Quoted 8 lines

streams/wvstream.cc: In member function ?IWvStream::SelectRequest WvStream::get_select_request()?:
streams/wvstream.cc:1022:62: error: no matching function for call to ?IWvStream::SelectRequest::SelectRequest(IWvStreamCallback&, IWvStreamCallback&, IWvStreamCallback&)?

     return IWvStream::SelectRequest(readcb, writecb, exceptcb);
                                                              ^

So, let's deprecate wvdial and wvstreams.

It's now deprecated, I'll mark this patch rejected in patchwork.

https://git.buildroot.net/buildroot/commit/?id=521cf82ad842e019c07e3a0d1c0c29c09ae00776

Best regards,
Romain

Quoted 9 lines

Best regards,
Romain

Quoted 4 lines

Regards,
Arnout