From 6fb00c9095d4d3e072236fb2b18917c7807c80e9 Mon Sep 17 00:00:00 2001 From: stenstorp Date: Wed, 19 Sep 2018 14:13:58 +0930 Subject: [PATCH] m4: fix building with glibc2.28 --- srcpkgs/m4/patches/gnulib-freadahead.patch | 11 +++++++++++ srcpkgs/m4/patches/gnulib-stdio-impl.patch | 14 ++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 srcpkgs/m4/patches/gnulib-freadahead.patch create mode 100644 srcpkgs/m4/patches/gnulib-stdio-impl.patch diff --git a/srcpkgs/m4/patches/gnulib-freadahead.patch b/srcpkgs/m4/patches/gnulib-freadahead.patch new file mode 100644 index 00000000000..96c58f49254 --- /dev/null +++ b/srcpkgs/m4/patches/gnulib-freadahead.patch @@ -0,0 +1,11 @@ +--- lib/freadahead.c ++++ 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/srcpkgs/m4/patches/gnulib-stdio-impl.patch b/srcpkgs/m4/patches/gnulib-stdio-impl.patch new file mode 100644 index 00000000000..73421c8f989 --- /dev/null +++ b/srcpkgs/m4/patches/gnulib-stdio-impl.patch @@ -0,0 +1,14 @@ +--- lib/stdio-impl.h ++++ 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. */