mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 0/1] gnulib fixes for m4 and coreutils for glibc-2.28
@ 2018-08-22 17:33 Rouven Czerwinski
  2018-08-22 17:33 ` [ptxdist] [PATCH 1/1] m4/coreutil: add gnulib patches for GLibc-2.28 Rouven Czerwinski
  2018-08-23 10:09 ` [ptxdist] [PATCH v2] " Rouven Czerwinski
  0 siblings, 2 replies; 5+ messages in thread
From: Rouven Czerwinski @ 2018-08-22 17:33 UTC (permalink / raw)
  To: ptxdist; +Cc: Rouven Czerwinski

This adds the necessary patches to let m4 and coreutils compile with glibc-2.28.
These can be removed again if both packages have new releases which contain the
necessary patches for gnulib.

I can split the commit again if needed.

Greetings,
Rouven Czerwinski

Rouven Czerwinski (1):
  m4/coreutil: add gnulib patches for GLibc-2.28

 ...adjust-to-glibc-2.28-libio.h-removal.patch | 164 ++++++++++++++++++
 patches/coreutils-8.29/series                 |   4 +
 ...adjust-to-glibc-2.28-libio.h-removal.patch | 136 +++++++++++++++
 patches/m4-1.4.18/series                      |   4 +
 4 files changed, 308 insertions(+)
 create mode 100644 patches/coreutils-8.29/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
 create mode 100644 patches/coreutils-8.29/series
 create mode 100644 patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
 create mode 100644 patches/m4-1.4.18/series

-- 
2.18.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* [ptxdist] [PATCH 1/1] m4/coreutil: add gnulib patches for GLibc-2.28
  2018-08-22 17:33 [ptxdist] [PATCH 0/1] gnulib fixes for m4 and coreutils for glibc-2.28 Rouven Czerwinski
@ 2018-08-22 17:33 ` Rouven Czerwinski
  2018-08-22 21:10   ` Uwe Kleine-König
  2018-08-23  5:45   ` Denis OSTERLAND
  2018-08-23 10:09 ` [ptxdist] [PATCH v2] " Rouven Czerwinski
  1 sibling, 2 replies; 5+ messages in thread
From: Rouven Czerwinski @ 2018-08-22 17:33 UTC (permalink / raw)
  To: ptxdist; +Cc: Rouven Czerwinski, Rouven Czerwinski

From: Rouven Czerwinski <rouven@czerwinskis.de>

This adds the neceassry patches for m4 ad coreutils to compile with glibc-2.28.
These can be removed when new releases are available.

This version is manually applied for both packages from
4af4a4a71827c0bc5e0ec67af23edef4f15cee8e
in the upstream gnulib repository.

Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
 ...adjust-to-glibc-2.28-libio.h-removal.patch | 164 ++++++++++++++++++
 patches/coreutils-8.29/series                 |   4 +
 ...adjust-to-glibc-2.28-libio.h-removal.patch | 136 +++++++++++++++
 patches/m4-1.4.18/series                      |   4 +
 4 files changed, 308 insertions(+)
 create mode 100644 patches/coreutils-8.29/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
 create mode 100644 patches/coreutils-8.29/series
 create mode 100644 patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
 create mode 100644 patches/m4-1.4.18/series

diff --git a/patches/coreutils-8.29/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch b/patches/coreutils-8.29/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
new file mode 100644
index 000000000..651335917
--- /dev/null
+++ b/patches/coreutils-8.29/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
@@ -0,0 +1,164 @@
+From: Rouven Czerwinski <rouven@czerwinskis.de>
+Date: Wed, 22 Aug 2018 17:22:23 +0200
+Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
+
+---
+ lib/fflush.c     | 6 +++---
+ lib/fpending.c   | 2 +-
+ lib/freadahead.c | 2 +-
+ lib/freading.c   | 2 +-
+ lib/freadptr.c   | 2 +-
+ lib/freadseek.c  | 2 +-
+ lib/fseeko.c     | 4 ++--
+ lib/fseterr.c    | 2 +-
+ lib/stdio-impl.h | 6 ++++++
+ 9 files changed, 17 insertions(+), 11 deletions(-)
+
+diff --git a/lib/fflush.c b/lib/fflush.c
+index 4e65692644b1..c16da5fdcf23 100644
+--- a/lib/fflush.c
++++ b/lib/fflush.c
+@@ -33,7 +33,7 @@
+ #undef fflush
+ 
+ 
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ 
+ /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
+ static void
+@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
+ 
+ #endif
+ 
+-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
++#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
+ 
+ # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
+   if (stream == NULL || ! freading (stream))
+     return fflush (stream);
+ 
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ 
+   clear_ungetc_buffer_preserving_position (stream);
+ 
+diff --git a/lib/fpending.c b/lib/fpending.c
+index 5811a4a74750..9e21a165e220 100644
+--- a/lib/fpending.c
++++ b/lib/fpending.c
+@@ -32,7 +32,7 @@ __fpending (FILE *fp)
+   /* Most systems provide FILE as a struct and the necessary bitmask in
+      <stdio.h>, because they need it for implementing getc() and putc() as
+      fast macros.  */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   return fp->_IO_write_ptr - fp->_IO_write_base;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+diff --git a/lib/freadahead.c b/lib/freadahead.c
+index f335f041ee5e..e7cb77b6722b 100644
+--- a/lib/freadahead.c
++++ b/lib/freadahead.c
+@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
+ size_t
+ freadahead (FILE *fp)
+ {
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   if (fp->_IO_write_ptr > fp->_IO_write_base)
+     return 0;
+   return (fp->_IO_read_end - fp->_IO_read_ptr)
+diff --git a/lib/freading.c b/lib/freading.c
+index 78140d27bfef..c9d33449e948 100644
+--- a/lib/freading.c
++++ b/lib/freading.c
+@@ -31,7 +31,7 @@ freading (FILE *fp)
+   /* Most systems provide FILE as a struct and the necessary bitmask in
+      <stdio.h>, because they need it for implementing getc() and putc() as
+      fast macros.  */
+-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   return ((fp->_flags & _IO_NO_WRITES) != 0
+           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
+               && fp->_IO_read_base != NULL));
+diff --git a/lib/freadptr.c b/lib/freadptr.c
+index e4cc0b02fba2..aba8dd5964fc 100644
+--- a/lib/freadptr.c
++++ b/lib/freadptr.c
+@@ -29,7 +29,7 @@ freadptr (FILE *fp, size_t *sizep)
+   size_t size;
+ 
+   /* Keep this code in sync with freadahead!  */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   if (fp->_IO_write_ptr > fp->_IO_write_base)
+     return NULL;
+   size = fp->_IO_read_end - fp->_IO_read_ptr;
+diff --git a/lib/freadseek.c b/lib/freadseek.c
+index fcecba6829c5..98726f845f88 100644
+--- a/lib/freadseek.c
++++ b/lib/freadseek.c
+@@ -36,7 +36,7 @@ freadptrinc (FILE *fp, size_t increment)
+   /* Keep this code in sync with freadptr!  */
+ #if HAVE___FREADPTRINC              /* musl libc */
+   __freadptrinc (fp, increment);
+-#elif defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#elif defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   fp->_IO_read_ptr += increment;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+diff --git a/lib/fseeko.c b/lib/fseeko.c
+index d0f24d8a838f..0ae2b153cff5 100644
+--- a/lib/fseeko.c
++++ b/lib/fseeko.c
+@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
+ #endif
+ 
+   /* These tests are based on fpurge.c.  */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   if (fp->_IO_read_end == fp->_IO_read_ptr
+       && fp->_IO_write_ptr == fp->_IO_write_base
+       && fp->_IO_save_base == NULL)
+@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
+           return -1;
+         }
+ 
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+       fp->_flags &= ~_IO_EOF_SEEN;
+       fp->_offset = pos;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+diff --git a/lib/fseterr.c b/lib/fseterr.c
+index 739e5453d04e..d998619771f3 100644
+--- a/lib/fseterr.c
++++ b/lib/fseterr.c
+@@ -29,7 +29,7 @@ fseterr (FILE *fp)
+   /* Most systems provide FILE as a struct and the necessary bitmask in
+      <stdio.h>, because they need it for implementing getc() and putc() as
+      fast macros.  */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   fp->_flags |= _IO_ERR_SEEN;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
+index 329801ad23b0..eeaabab66b2f 100644
+--- a/lib/stdio-impl.h
++++ b/lib/stdio-impl.h
+@@ -18,6 +18,12 @@
+    the same implementation of stdio extension API, except that some fields
+    have different naming conventions, or their access requires some casts.  */
+ 
++/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
++   problem by defining it ourselves.  FIXME: Do not rely on glibc
++   internals.  */
++#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
++# define _IO_IN_BACKUP 0x100
++#endif
+ 
+ /* BSD stdio derived implementations.  */
+ 
diff --git a/patches/coreutils-8.29/series b/patches/coreutils-8.29/series
new file mode 100644
index 000000000..c9993f086
--- /dev/null
+++ b/patches/coreutils-8.29/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
+# b03bed9248af170f04892265a5918d5b  - git-ptx-patches magic
diff --git a/patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch b/patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
new file mode 100644
index 000000000..0a11b87d6
--- /dev/null
+++ b/patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
@@ -0,0 +1,136 @@
+From: Rouven Czerwinski <rouven@czerwinskis.de>
+Date: Wed, 22 Aug 2018 16:58:36 +0200
+Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
+
+---
+ lib/fflush.c     | 6 +++---
+ lib/fpending.c   | 2 +-
+ lib/fpurge.c     | 2 +-
+ lib/freadahead.c | 2 +-
+ lib/freading.c   | 2 +-
+ lib/fseeko.c     | 4 ++--
+ lib/stdio-impl.h | 6 ++++++
+ 7 files changed, 15 insertions(+), 9 deletions(-)
+
+diff --git a/lib/fflush.c b/lib/fflush.c
+index ef2a7f1237ee..787790d09031 100644
+--- a/lib/fflush.c
++++ b/lib/fflush.c
+@@ -33,7 +33,7 @@
+ #undef fflush
+ 
+ 
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ 
+ /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
+ static void
+@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
+ 
+ #endif
+ 
+-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
++#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
+ 
+ # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
+   if (stream == NULL || ! freading (stream))
+     return fflush (stream);
+ 
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ 
+   clear_ungetc_buffer_preserving_position (stream);
+ 
+diff --git a/lib/fpending.c b/lib/fpending.c
+index ce93604e518f..9fe7ffb2f615 100644
+--- a/lib/fpending.c
++++ b/lib/fpending.c
+@@ -32,7 +32,7 @@ __fpending (FILE *fp)
+   /* Most systems provide FILE as a struct and the necessary bitmask in
+      <stdio.h>, because they need it for implementing getc() and putc() as
+      fast macros.  */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   return fp->_IO_write_ptr - fp->_IO_write_base;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+diff --git a/lib/fpurge.c b/lib/fpurge.c
+index 53ee68c37efc..7cba3a37bef2 100644
+--- a/lib/fpurge.c
++++ b/lib/fpurge.c
+@@ -62,7 +62,7 @@ fpurge (FILE *fp)
+   /* Most systems provide FILE as a struct and the necessary bitmask in
+      <stdio.h>, because they need it for implementing getc() and putc() as
+      fast macros.  */
+-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   fp->_IO_read_end = fp->_IO_read_ptr;
+   fp->_IO_write_ptr = fp->_IO_write_base;
+   /* Avoid memory leak when there is an active ungetc buffer.  */
+diff --git a/lib/freadahead.c b/lib/freadahead.c
+index cfc969b4cffd..5e43e13af727 100644
+--- a/lib/freadahead.c
++++ b/lib/freadahead.c
+@@ -25,7 +25,7 @@
+ size_t
+ freadahead (FILE *fp)
+ {
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   if (fp->_IO_write_ptr > fp->_IO_write_base)
+     return 0;
+   return (fp->_IO_read_end - fp->_IO_read_ptr)
+diff --git a/lib/freading.c b/lib/freading.c
+index 05cb0b80999d..f1da5b958b5e 100644
+--- a/lib/freading.c
++++ b/lib/freading.c
+@@ -31,7 +31,7 @@ freading (FILE *fp)
+   /* Most systems provide FILE as a struct and the necessary bitmask in
+      <stdio.h>, because they need it for implementing getc() and putc() as
+      fast macros.  */
+-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   return ((fp->_flags & _IO_NO_WRITES) != 0
+           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
+               && fp->_IO_read_base != NULL));
+diff --git a/lib/fseeko.c b/lib/fseeko.c
+index 0c01c4fd08c1..0601619d80a2 100644
+--- a/lib/fseeko.c
++++ b/lib/fseeko.c
+@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
+ #endif
+ 
+   /* These tests are based on fpurge.c.  */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   if (fp->_IO_read_end == fp->_IO_read_ptr
+       && fp->_IO_write_ptr == fp->_IO_write_base
+       && fp->_IO_save_base == NULL)
+@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
+           return -1;
+         }
+ 
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+       fp->_flags &= ~_IO_EOF_SEEN;
+       fp->_offset = pos;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
+index 766d6936590f..75fe3ade4237 100644
+--- a/lib/stdio-impl.h
++++ b/lib/stdio-impl.h
+@@ -18,6 +18,12 @@
+    the same implementation of stdio extension API, except that some fields
+    have different naming conventions, or their access requires some casts.  */
+ 
++/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
++   problem by defining it ourselves.  FIXME: Do not rely on glibc
++   internals.  */
++#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
++# define _IO_IN_BACKUP 0x100
++#endif
+ 
+ /* BSD stdio derived implementations.  */
+ 
diff --git a/patches/m4-1.4.18/series b/patches/m4-1.4.18/series
new file mode 100644
index 000000000..c9993f086
--- /dev/null
+++ b/patches/m4-1.4.18/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
+# b03bed9248af170f04892265a5918d5b  - git-ptx-patches magic
-- 
2.18.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH 1/1] m4/coreutil: add gnulib patches for GLibc-2.28
  2018-08-22 17:33 ` [ptxdist] [PATCH 1/1] m4/coreutil: add gnulib patches for GLibc-2.28 Rouven Czerwinski
@ 2018-08-22 21:10   ` Uwe Kleine-König
  2018-08-23  5:45   ` Denis OSTERLAND
  1 sibling, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2018-08-22 21:10 UTC (permalink / raw)
  To: ptxdist; +Cc: Rouven Czerwinski, Rouven Czerwinski

Hello Rouven,

On Wed, Aug 22, 2018 at 07:33:23PM +0200, Rouven Czerwinski wrote:
> From: Rouven Czerwinski <rouven@czerwinskis.de>
> 
> This adds the neceassry patches for m4 ad coreutils to compile with glibc-2.28.

s/neceassry/necessary/ s/ad/and/

Cheers,
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH 1/1] m4/coreutil: add gnulib patches for GLibc-2.28
  2018-08-22 17:33 ` [ptxdist] [PATCH 1/1] m4/coreutil: add gnulib patches for GLibc-2.28 Rouven Czerwinski
  2018-08-22 21:10   ` Uwe Kleine-König
@ 2018-08-23  5:45   ` Denis OSTERLAND
  1 sibling, 0 replies; 5+ messages in thread
From: Denis OSTERLAND @ 2018-08-23  5:45 UTC (permalink / raw)
  To: ptxdist

Am Mittwoch, den 22.08.2018, 19:33 +0200 schrieb Rouven Czerwinski:
> From: Rouven Czerwinski <rouven@czerwinskis.de>
> 
> This adds the neceassry patches for m4 ad coreutils to compile with glibc-2.28.
> These can be removed when new releases are available.
> 
> This version is manually applied for both packages from
> 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e
> in the upstream gnulib repository.
> 
> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
> ---
>  ...adjust-to-glibc-2.28-libio.h-removal.patch | 164 ++++++++++++++++++
>  patches/coreutils-8.29/series                 |   4 +
>  ...adjust-to-glibc-2.28-libio.h-removal.patch | 136 +++++++++++++++
>  patches/m4-1.4.18/series                      |   4 +
>  4 files changed, 308 insertions(+)
>  create mode 100644 patches/coreutils-8.29/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
>  create mode 100644 patches/coreutils-8.29/series
>  create mode 100644 patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
>  create mode 100644 patches/m4-1.4.18/series
> 
> diff --git a/patches/coreutils-8.29/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch b/patches/coreutils-8.29/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
> new file mode 100644
> index 000000000..651335917
> --- /dev/null
> +++ b/patches/coreutils-8.29/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
> @@ -0,0 +1,164 @@
> +From: Rouven Czerwinski <rouven@czerwinskis.de>
> +Date: Wed, 22 Aug 2018 17:22:23 +0200
> +Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
A comment like "backport of 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e" should be added.
It would be great if you use the original patch message with From and Date
and add a description of your changes.
Your signed-off is missing.
> +
> +---
> + lib/fflush.c     | 6 +++---
> + lib/fpending.c   | 2 +-
> + lib/freadahead.c | 2 +-
> + lib/freading.c   | 2 +-
> diff --git a/patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch b/patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
> new file mode 100644
> index 000000000..0a11b87d6
> --- /dev/null
> +++ b/patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
> @@ -0,0 +1,136 @@
> +From: Rouven Czerwinski <rouven@czerwinskis.de>
> +Date: Wed, 22 Aug 2018 16:58:36 +0200
> +Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
same
> +
> +---
> + lib/fflush.c     | 6 +++---
> + lib/fpending.c   | 2 +-
> + lib/fpurge.c     | 2 +-
> + lib/freadahead.c | 2 +-
Regards Denis

Diehl Connectivity Solutions GmbH
Geschäftsführung: Horst Leonberger
Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
Nürnberg: HRB 32315
___________________________________________________________________________________________________

Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht.
Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt.
The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by
mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited. 
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* [ptxdist] [PATCH v2] m4/coreutil: add gnulib patches for GLibc-2.28
  2018-08-22 17:33 [ptxdist] [PATCH 0/1] gnulib fixes for m4 and coreutils for glibc-2.28 Rouven Czerwinski
  2018-08-22 17:33 ` [ptxdist] [PATCH 1/1] m4/coreutil: add gnulib patches for GLibc-2.28 Rouven Czerwinski
@ 2018-08-23 10:09 ` Rouven Czerwinski
  1 sibling, 0 replies; 5+ messages in thread
From: Rouven Czerwinski @ 2018-08-23 10:09 UTC (permalink / raw)
  To: ptxdist; +Cc: Rouven Czerwinski

From: Rouven Czerwinski <rouven@czerwinskis.de>

This adds the necessary patches for m4 and coreutils to compile with glibc-2.28.
These can be removed when new releases are available.

Both m4 and coreutils use an in-tree copy of gnulib which abstracts some of the
more ugly OS differences. To support the new glibc only changes in gnulib are
necessary, so the patches for both packages are nearly identical.

This version is manually applied for both packages from
4af4a4a71827c0bc5e0ec67af23edef4f15cee8e
in the upstream gnulib repository.

v2:
- fix spelling mistakes
- mention the in-tree gnulib copy to justify the single patch
from Uwe Kleine-König
- Integrate original commit message, author and date
- add backport note and my SoB
from Denis Osterland

Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
 ...adjust-to-glibc-2.28-libio.h-removal.patch | 187 ++++++++++++++++++
 patches/coreutils-8.29/series                 |   4 +
 ...adjust-to-glibc-2.28-libio.h-removal.patch | 159 +++++++++++++++
 patches/m4-1.4.18/series                      |   4 +
 4 files changed, 354 insertions(+)
 create mode 100644 patches/coreutils-8.29/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
 create mode 100644 patches/coreutils-8.29/series
 create mode 100644 patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
 create mode 100644 patches/m4-1.4.18/series

diff --git a/patches/coreutils-8.29/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch b/patches/coreutils-8.29/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
new file mode 100644
index 000000000..8a7220fa3
--- /dev/null
+++ b/patches/coreutils-8.29/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
@@ -0,0 +1,187 @@
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Thu, 8 Mar 2018 16:42:45 2018 -0800
+Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
+
+Problem reported by Daniel P. Berrangé in:
+https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
+* lib/fbufmode.c (fbufmode):
+* lib/fflush.c (clear_ungetc_buffer_preserving_position)
+(disable_seek_optimization, rpl_fflush):
+* lib/fpending.c (__fpending):
+* lib/fpurge.c (fpurge):
+* lib/freadable.c (freadable):
+* lib/freadahead.c (freadahead):
+* lib/freading.c (freading):
+* lib/freadptr.c (freadptr):
+* lib/freadseek.c (freadptrinc):
+* lib/fseeko.c (fseeko):
+* lib/fseterr.c (fseterr):
+* lib/fwritable.c (fwritable):
+* lib/fwriting.c (fwriting):
+Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
+* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
+Define if not already defined.
+
+manual backport of of4af4a4a71827c0bc5e0ec67af23edef4f15cee8e
+
+Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
+---
+ lib/fflush.c     | 6 +++---
+ lib/fpending.c   | 2 +-
+ lib/freadahead.c | 2 +-
+ lib/freading.c   | 2 +-
+ lib/freadptr.c   | 2 +-
+ lib/freadseek.c  | 2 +-
+ lib/fseeko.c     | 4 ++--
+ lib/fseterr.c    | 2 +-
+ lib/stdio-impl.h | 6 ++++++
+ 9 files changed, 17 insertions(+), 11 deletions(-)
+
+diff --git a/lib/fflush.c b/lib/fflush.c
+index 4e65692644b1..c16da5fdcf23 100644
+--- a/lib/fflush.c
++++ b/lib/fflush.c
+@@ -33,7 +33,7 @@
+ #undef fflush
+ 
+ 
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ 
+ /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
+ static void
+@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
+ 
+ #endif
+ 
+-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
++#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
+ 
+ # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
+   if (stream == NULL || ! freading (stream))
+     return fflush (stream);
+ 
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ 
+   clear_ungetc_buffer_preserving_position (stream);
+ 
+diff --git a/lib/fpending.c b/lib/fpending.c
+index 5811a4a74750..9e21a165e220 100644
+--- a/lib/fpending.c
++++ b/lib/fpending.c
+@@ -32,7 +32,7 @@ __fpending (FILE *fp)
+   /* Most systems provide FILE as a struct and the necessary bitmask in
+      <stdio.h>, because they need it for implementing getc() and putc() as
+      fast macros.  */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   return fp->_IO_write_ptr - fp->_IO_write_base;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+diff --git a/lib/freadahead.c b/lib/freadahead.c
+index f335f041ee5e..e7cb77b6722b 100644
+--- a/lib/freadahead.c
++++ b/lib/freadahead.c
+@@ -30,7 +30,7 @@ extern size_t __sreadahead (FILE *);
+ size_t
+ freadahead (FILE *fp)
+ {
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   if (fp->_IO_write_ptr > fp->_IO_write_base)
+     return 0;
+   return (fp->_IO_read_end - fp->_IO_read_ptr)
+diff --git a/lib/freading.c b/lib/freading.c
+index 78140d27bfef..c9d33449e948 100644
+--- a/lib/freading.c
++++ b/lib/freading.c
+@@ -31,7 +31,7 @@ freading (FILE *fp)
+   /* Most systems provide FILE as a struct and the necessary bitmask in
+      <stdio.h>, because they need it for implementing getc() and putc() as
+      fast macros.  */
+-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   return ((fp->_flags & _IO_NO_WRITES) != 0
+           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
+               && fp->_IO_read_base != NULL));
+diff --git a/lib/freadptr.c b/lib/freadptr.c
+index e4cc0b02fba2..aba8dd5964fc 100644
+--- a/lib/freadptr.c
++++ b/lib/freadptr.c
+@@ -29,7 +29,7 @@ freadptr (FILE *fp, size_t *sizep)
+   size_t size;
+ 
+   /* Keep this code in sync with freadahead!  */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   if (fp->_IO_write_ptr > fp->_IO_write_base)
+     return NULL;
+   size = fp->_IO_read_end - fp->_IO_read_ptr;
+diff --git a/lib/freadseek.c b/lib/freadseek.c
+index fcecba6829c5..98726f845f88 100644
+--- a/lib/freadseek.c
++++ b/lib/freadseek.c
+@@ -36,7 +36,7 @@ freadptrinc (FILE *fp, size_t increment)
+   /* Keep this code in sync with freadptr!  */
+ #if HAVE___FREADPTRINC              /* musl libc */
+   __freadptrinc (fp, increment);
+-#elif defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#elif defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   fp->_IO_read_ptr += increment;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+diff --git a/lib/fseeko.c b/lib/fseeko.c
+index d0f24d8a838f..0ae2b153cff5 100644
+--- a/lib/fseeko.c
++++ b/lib/fseeko.c
+@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
+ #endif
+ 
+   /* These tests are based on fpurge.c.  */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   if (fp->_IO_read_end == fp->_IO_read_ptr
+       && fp->_IO_write_ptr == fp->_IO_write_base
+       && fp->_IO_save_base == NULL)
+@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
+           return -1;
+         }
+ 
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+       fp->_flags &= ~_IO_EOF_SEEN;
+       fp->_offset = pos;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+diff --git a/lib/fseterr.c b/lib/fseterr.c
+index 739e5453d04e..d998619771f3 100644
+--- a/lib/fseterr.c
++++ b/lib/fseterr.c
+@@ -29,7 +29,7 @@ fseterr (FILE *fp)
+   /* Most systems provide FILE as a struct and the necessary bitmask in
+      <stdio.h>, because they need it for implementing getc() and putc() as
+      fast macros.  */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   fp->_flags |= _IO_ERR_SEEN;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
+index 329801ad23b0..eeaabab66b2f 100644
+--- a/lib/stdio-impl.h
++++ b/lib/stdio-impl.h
+@@ -18,6 +18,12 @@
+    the same implementation of stdio extension API, except that some fields
+    have different naming conventions, or their access requires some casts.  */
+ 
++/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
++   problem by defining it ourselves.  FIXME: Do not rely on glibc
++   internals.  */
++#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
++# define _IO_IN_BACKUP 0x100
++#endif
+ 
+ /* BSD stdio derived implementations.  */
+ 
diff --git a/patches/coreutils-8.29/series b/patches/coreutils-8.29/series
new file mode 100644
index 000000000..c9993f086
--- /dev/null
+++ b/patches/coreutils-8.29/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
+# b03bed9248af170f04892265a5918d5b  - git-ptx-patches magic
diff --git a/patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch b/patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
new file mode 100644
index 000000000..00b99fdd9
--- /dev/null
+++ b/patches/m4-1.4.18/0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
@@ -0,0 +1,159 @@
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Thu, 8 Mar 2018 16:42:45 2018 -0800
+Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
+
+Problem reported by Daniel P. Berrangé in:
+https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
+* lib/fbufmode.c (fbufmode):
+* lib/fflush.c (clear_ungetc_buffer_preserving_position)
+(disable_seek_optimization, rpl_fflush):
+* lib/fpending.c (__fpending):
+* lib/fpurge.c (fpurge):
+* lib/freadable.c (freadable):
+* lib/freadahead.c (freadahead):
+* lib/freading.c (freading):
+* lib/freadptr.c (freadptr):
+* lib/freadseek.c (freadptrinc):
+* lib/fseeko.c (fseeko):
+* lib/fseterr.c (fseterr):
+* lib/fwritable.c (fwritable):
+* lib/fwriting.c (fwriting):
+Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
+* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
+Define if not already defined.
+
+manual backport of of4af4a4a71827c0bc5e0ec67af23edef4f15cee8e
+
+Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
+---
+ lib/fflush.c     | 6 +++---
+ lib/fpending.c   | 2 +-
+ lib/fpurge.c     | 2 +-
+ lib/freadahead.c | 2 +-
+ lib/freading.c   | 2 +-
+ lib/fseeko.c     | 4 ++--
+ lib/stdio-impl.h | 6 ++++++
+ 7 files changed, 15 insertions(+), 9 deletions(-)
+
+diff --git a/lib/fflush.c b/lib/fflush.c
+index ef2a7f1237ee..787790d09031 100644
+--- a/lib/fflush.c
++++ b/lib/fflush.c
+@@ -33,7 +33,7 @@
+ #undef fflush
+ 
+ 
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ 
+ /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
+ static void
+@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
+ 
+ #endif
+ 
+-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
++#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
+ 
+ # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
+   if (stream == NULL || ! freading (stream))
+     return fflush (stream);
+ 
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ 
+   clear_ungetc_buffer_preserving_position (stream);
+ 
+diff --git a/lib/fpending.c b/lib/fpending.c
+index ce93604e518f..9fe7ffb2f615 100644
+--- a/lib/fpending.c
++++ b/lib/fpending.c
+@@ -32,7 +32,7 @@ __fpending (FILE *fp)
+   /* Most systems provide FILE as a struct and the necessary bitmask in
+      <stdio.h>, because they need it for implementing getc() and putc() as
+      fast macros.  */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   return fp->_IO_write_ptr - fp->_IO_write_base;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+diff --git a/lib/fpurge.c b/lib/fpurge.c
+index 53ee68c37efc..7cba3a37bef2 100644
+--- a/lib/fpurge.c
++++ b/lib/fpurge.c
+@@ -62,7 +62,7 @@ fpurge (FILE *fp)
+   /* Most systems provide FILE as a struct and the necessary bitmask in
+      <stdio.h>, because they need it for implementing getc() and putc() as
+      fast macros.  */
+-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   fp->_IO_read_end = fp->_IO_read_ptr;
+   fp->_IO_write_ptr = fp->_IO_write_base;
+   /* Avoid memory leak when there is an active ungetc buffer.  */
+diff --git a/lib/freadahead.c b/lib/freadahead.c
+index cfc969b4cffd..5e43e13af727 100644
+--- a/lib/freadahead.c
++++ b/lib/freadahead.c
+@@ -25,7 +25,7 @@
+ size_t
+ freadahead (FILE *fp)
+ {
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   if (fp->_IO_write_ptr > fp->_IO_write_base)
+     return 0;
+   return (fp->_IO_read_end - fp->_IO_read_ptr)
+diff --git a/lib/freading.c b/lib/freading.c
+index 05cb0b80999d..f1da5b958b5e 100644
+--- a/lib/freading.c
++++ b/lib/freading.c
+@@ -31,7 +31,7 @@ freading (FILE *fp)
+   /* Most systems provide FILE as a struct and the necessary bitmask in
+      <stdio.h>, because they need it for implementing getc() and putc() as
+      fast macros.  */
+-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   return ((fp->_flags & _IO_NO_WRITES) != 0
+           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
+               && fp->_IO_read_base != NULL));
+diff --git a/lib/fseeko.c b/lib/fseeko.c
+index 0c01c4fd08c1..0601619d80a2 100644
+--- a/lib/fseeko.c
++++ b/lib/fseeko.c
+@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
+ #endif
+ 
+   /* These tests are based on fpurge.c.  */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+   if (fp->_IO_read_end == fp->_IO_read_ptr
+       && fp->_IO_write_ptr == fp->_IO_write_base
+       && fp->_IO_save_base == NULL)
+@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
+           return -1;
+         }
+ 
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+       fp->_flags &= ~_IO_EOF_SEEN;
+       fp->_offset = pos;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+diff --git a/lib/stdio-impl.h b/lib/stdio-impl.h
+index 766d6936590f..75fe3ade4237 100644
+--- a/lib/stdio-impl.h
++++ b/lib/stdio-impl.h
+@@ -18,6 +18,12 @@
+    the same implementation of stdio extension API, except that some fields
+    have different naming conventions, or their access requires some casts.  */
+ 
++/* Glibc 2.28 made _IO_IN_BACKUP private.  For now, work around this
++   problem by defining it ourselves.  FIXME: Do not rely on glibc
++   internals.  */
++#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
++# define _IO_IN_BACKUP 0x100
++#endif
+ 
+ /* BSD stdio derived implementations.  */
+ 
diff --git a/patches/m4-1.4.18/series b/patches/m4-1.4.18/series
new file mode 100644
index 000000000..c9993f086
--- /dev/null
+++ b/patches/m4-1.4.18/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-fflush-adjust-to-glibc-2.28-libio.h-removal.patch
+# b03bed9248af170f04892265a5918d5b  - git-ptx-patches magic
-- 
2.18.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2018-08-23 10:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-22 17:33 [ptxdist] [PATCH 0/1] gnulib fixes for m4 and coreutils for glibc-2.28 Rouven Czerwinski
2018-08-22 17:33 ` [ptxdist] [PATCH 1/1] m4/coreutil: add gnulib patches for GLibc-2.28 Rouven Czerwinski
2018-08-22 21:10   ` Uwe Kleine-König
2018-08-23  5:45   ` Denis OSTERLAND
2018-08-23 10:09 ` [ptxdist] [PATCH v2] " Rouven Czerwinski

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