Commit 25b754de authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Added compatibility patch with glibc 2.28

parent 1eef1655
all:
tar xf m4-1.4.18.tar.xz
patch -Np1 -d m4-1.4.18 < m4-1.4.18-glibc2.28_fix.patch
cd m4-1.4.18 && ./configure --build=$(CLFS_TARGET) --prefix=/usr
$(MAKE) -C m4-1.4.18
if [[ ! "$(BUILD_OPTIONS)" =~ no-tests ]] ; then \
......@@ -10,6 +11,7 @@ all:
temporary:
tar xf m4-1.4.18.tar.xz
patch -Np1 -d m4-1.4.18 < m4-1.4.18-glibc2.28_fix.patch
cd m4-1.4.18 && ./configure --prefix=/tools
$(MAKE) -C m4-1.4.18
$(MAKE) -C m4-1.4.18 install
......
......@@ -2,6 +2,9 @@
<target name="cross-m4">
<property name="makedir" value="${builddir}/m4-1.4.18"/>
<exec executable="patch" dir="${builddir}/m4-1.4.18" failonerror="true">
<arg line="-Np1 -i ${basedir}/packages/m4/m4-1.4.18-glibc2.28_fix.patch"/>
</exec>
<exec executable="tar" failonerror="true">
<arg line="xf packages/m4/m4-1.4.18.tar.xz -C ${builddir}"/>
</exec>
......
diff -uNr m4-1.4.18/lib/fflush.c m4-1.4.18-glibc2.28_fix/lib/fflush.c
--- m4-1.4.18/lib/fflush.c 2017-01-01 00:24:41.000000000 +1030
+++ m4-1.4.18-glibc2.28_fix/lib/fflush.c 2019-06-24 17:40:43.318839188 +0930
@@ -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 @@
#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 @@
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 -uNr m4-1.4.18/lib/fpending.c m4-1.4.18-glibc2.28_fix/lib/fpending.c
--- m4-1.4.18/lib/fpending.c 2017-01-01 00:24:41.000000000 +1030
+++ m4-1.4.18-glibc2.28_fix/lib/fpending.c 2019-06-24 17:40:43.319839191 +0930
@@ -32,7 +32,7 @@
/* 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 -uNr m4-1.4.18/lib/fpurge.c m4-1.4.18-glibc2.28_fix/lib/fpurge.c
--- m4-1.4.18/lib/fpurge.c 2017-01-01 00:24:41.000000000 +1030
+++ m4-1.4.18-glibc2.28_fix/lib/fpurge.c 2019-06-24 17:40:43.319839191 +0930
@@ -62,7 +62,7 @@
/* 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 -uNr m4-1.4.18/lib/freadahead.c m4-1.4.18-glibc2.28_fix/lib/freadahead.c
--- m4-1.4.18/lib/freadahead.c 2017-01-01 00:24:41.000000000 +1030
+++ m4-1.4.18-glibc2.28_fix/lib/freadahead.c 2019-06-24 17:40:43.319839191 +0930
@@ -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 -uNr m4-1.4.18/lib/freading.c m4-1.4.18-glibc2.28_fix/lib/freading.c
--- m4-1.4.18/lib/freading.c 2017-01-01 00:24:41.000000000 +1030
+++ m4-1.4.18-glibc2.28_fix/lib/freading.c 2019-06-24 17:40:43.320839194 +0930
@@ -31,7 +31,7 @@
/* 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 -uNr m4-1.4.18/lib/fseeko.c m4-1.4.18-glibc2.28_fix/lib/fseeko.c
--- m4-1.4.18/lib/fseeko.c 2017-01-01 00:24:41.000000000 +1030
+++ m4-1.4.18-glibc2.28_fix/lib/fseeko.c 2019-06-24 17:40:43.321839198 +0930
@@ -47,7 +47,7 @@
#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 @@
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 -uNr m4-1.4.18/lib/stdio-impl.h m4-1.4.18-glibc2.28_fix/lib/stdio-impl.h
--- m4-1.4.18/lib/stdio-impl.h 2017-01-01 00:24:42.000000000 +1030
+++ m4-1.4.18-glibc2.28_fix/lib/stdio-impl.h 2019-06-24 17:40:44.192841833 +0930
@@ -138,3 +138,4 @@
# define _IOERR 0x10
#endif
+#define _IO_IN_BACKUP 0x100
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment