mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-08-07 07:22:55 +03:00
Based on https://lists.gnu.org/r/coreutils/2019-08/msg00011.html . * scripts/build-older-versions/README.older-versions: Documentation * scripts/build-older-versions/build-older-versions.sh: Helper script. * scripts/build-older-versions/.gitignore: Ignore build directory. * scripts/build-older-versions/coreutils-5.0-on-glibc-2.28.diff, scripts/build-older-versions/coreutils-5.97-on-glibc-2.28.diff, scripts/build-older-versions/coreutils-6.10-on-glibc-2.28.diff, scripts/build-older-versions/coreutils-6.11-on-glibc-2.28.diff, scripts/build-older-versions/coreutils-6.12-on-glibc-2.28.diff, scripts/build-older-versions/coreutils-7.2-on-glibc-2.28.diff, scripts/build-older-versions/coreutils-8.13-on-glibc-2.28.diff, scripts/build-older-versions/coreutils-8.17-on-glibc-2.28.diff, scripts/build-older-versions/coreutils-8.18-on-glibc-2.28.diff, scripts/build-older-versions/coreutils-8.24-on-glibc-2.28.diff, scripts/build-older-versions/coreutils-8.4-on-glibc-2.28.diff: Patches.
87 lines
4.4 KiB
Diff
87 lines
4.4 KiB
Diff
diff -r -U3 coreutils-8.24/lib/freadahead.c coreutils-8.24-patched/lib/freadahead.c
|
|
--- coreutils-8.24/lib/freadahead.c 2015-06-15 23:00:37.000000000 -0600
|
|
+++ coreutils-8.24-patched/lib/freadahead.c 2019-08-01 19:47:31.412646436 -0600
|
|
@@ -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 || defined _IO_ftrylockfile || __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 -r -U3 coreutils-8.24/lib/freadptr.c coreutils-8.24-patched/lib/freadptr.c
|
|
--- coreutils-8.24/lib/freadptr.c 2015-06-15 23:00:37.000000000 -0600
|
|
+++ coreutils-8.24-patched/lib/freadptr.c 2019-08-01 19:47:31.416646500 -0600
|
|
@@ -29,7 +29,7 @@
|
|
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 || defined _IO_ftrylockfile || __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 -r -U3 coreutils-8.24/lib/freadseek.c coreutils-8.24-patched/lib/freadseek.c
|
|
--- coreutils-8.24/lib/freadseek.c 2015-06-15 23:00:37.000000000 -0600
|
|
+++ coreutils-8.24-patched/lib/freadseek.c 2019-08-01 19:47:31.416646500 -0600
|
|
@@ -36,7 +36,7 @@
|
|
/* 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 || defined _IO_ftrylockfile || __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, Android */
|
|
diff -r -U3 coreutils-8.24/lib/fseeko.c coreutils-8.24-patched/lib/fseeko.c
|
|
--- coreutils-8.24/lib/fseeko.c 2015-06-15 23:04:31.000000000 -0600
|
|
+++ coreutils-8.24-patched/lib/fseeko.c 2019-08-01 19:47:31.416646500 -0600
|
|
@@ -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 || defined _IO_ftrylockfile || __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)
|
|
diff -r -U3 coreutils-8.24/lib/fseterr.c coreutils-8.24-patched/lib/fseterr.c
|
|
--- coreutils-8.24/lib/fseterr.c 2015-06-15 23:00:37.000000000 -0600
|
|
+++ coreutils-8.24-patched/lib/fseterr.c 2019-08-01 19:47:31.416646500 -0600
|
|
@@ -29,7 +29,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 || defined _IO_ftrylockfile || __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, Android */
|
|
diff -r -U3 coreutils-8.24/lib/mountlist.c coreutils-8.24-patched/lib/mountlist.c
|
|
--- coreutils-8.24/lib/mountlist.c 2015-07-01 09:08:30.000000000 -0600
|
|
+++ coreutils-8.24-patched/lib/mountlist.c 2019-08-01 19:49:22.354401380 -0600
|
|
@@ -24,6 +24,7 @@
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <stdint.h>
|
|
+#include <sys/sysmacros.h>
|
|
|
|
#include "xalloc.h"
|
|
|
|
diff -r -U3 coreutils-8.24/lib/stdio-impl.h coreutils-8.24-patched/lib/stdio-impl.h
|
|
--- coreutils-8.24/lib/stdio-impl.h 2015-06-15 23:00:37.000000000 -0600
|
|
+++ coreutils-8.24-patched/lib/stdio-impl.h 2019-08-01 19:47:31.416646500 -0600
|
|
@@ -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. */
|