Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/gzip/, app-arch/gzip/files/
Date: Sun, 14 Oct 2018 10:52:40
Message-Id: 1539514346.4952386d936a48aba253b0b850cea4a245298a8e.slyfox@gentoo
1 commit: 4952386d936a48aba253b0b850cea4a245298a8e
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 14 10:51:53 2018 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 14 10:52:26 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4952386d
7
8 app-arch/gzip: fix build failure against glibc-2.28, bug #663928
9
10 Adopted gnulib's upstream patch:
11 http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=4af4a4a71827c0bc5e0ec67af23edef4f15cee8e
12
13 Closes: https://bugs.gentoo.org/663928
14 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
15 Package-Manager: Portage-2.3.51, Repoman-2.3.11
16
17 .../gzip/files/gzip-1.9-gnulib-glibc-2.28.patch | 134 +++++++++++++++++++++
18 app-arch/gzip/gzip-1.9.ebuild | 1 +
19 2 files changed, 135 insertions(+)
20
21 diff --git a/app-arch/gzip/files/gzip-1.9-gnulib-glibc-2.28.patch b/app-arch/gzip/files/gzip-1.9-gnulib-glibc-2.28.patch
22 new file mode 100644
23 index 00000000000..20039b9f0d2
24 --- /dev/null
25 +++ b/app-arch/gzip/files/gzip-1.9-gnulib-glibc-2.28.patch
26 @@ -0,0 +1,134 @@
27 +fix build failure against glibc-2.28
28 +
29 +https://bugs.gentoo.org/663928
30 +
31 +Adopted gnulib's upstream patch:
32 +
33 +From 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e Mon Sep 17 00:00:00 2001
34 +From: Paul Eggert <eggert@×××××××.edu>
35 +Date: Mon, 5 Mar 2018 10:56:29 -0800
36 +Subject: [PATCH] fflush: adjust to glibc 2.28 libio.h removal
37 +MIME-Version: 1.0
38 +Content-Type: text/plain; charset=UTF-8
39 +Content-Transfer-Encoding: 8bit
40 +
41 +Problem reported by Daniel P. Berrangé in:
42 +https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
43 +* lib/fflush.c (clear_ungetc_buffer_preserving_position)
44 +(disable_seek_optimization, rpl_fflush):
45 +* lib/fpurge.c (fpurge):
46 +* lib/freadahead.c (freadahead):
47 +* lib/freading.c (freading):
48 +* lib/fseeko.c (fseeko):
49 +* lib/fseterr.c (fseterr):
50 +Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
51 +* lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
52 +Define if not already defined.
53 +---
54 + lib/fflush.c | 6 +++---
55 + lib/fpurge.c | 2 +-
56 + lib/freading.c | 2 +-
57 + lib/fseeko.c | 4 ++--
58 + lib/fseterr.c | 2 +-
59 + lib/stdio-impl.h | 6 ++++++
60 +
61 +--- a/lib/fflush.c
62 ++++ b/lib/fflush.c
63 +@@ -33,7 +33,7 @@
64 + #undef fflush
65 +
66 +
67 +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
68 ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
69 +
70 + /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
71 + static void
72 +@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
73 +
74 + #endif
75 +
76 +-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
77 ++#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
78 +
79 + # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
80 + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
81 +@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
82 + if (stream == NULL || ! freading (stream))
83 + return fflush (stream);
84 +
85 +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
86 ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
87 +
88 + clear_ungetc_buffer_preserving_position (stream);
89 +
90 +--- a/lib/fpurge.c
91 ++++ b/lib/fpurge.c
92 +@@ -62,7 +62,7 @@ fpurge (FILE *fp)
93 + /* Most systems provide FILE as a struct and the necessary bitmask in
94 + <stdio.h>, because they need it for implementing getc() and putc() as
95 + fast macros. */
96 +-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
97 ++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
98 + fp->_IO_read_end = fp->_IO_read_ptr;
99 + fp->_IO_write_ptr = fp->_IO_write_base;
100 + /* Avoid memory leak when there is an active ungetc buffer. */
101 +--- a/lib/freading.c
102 ++++ b/lib/freading.c
103 +@@ -31,7 +31,7 @@ freading (FILE *fp)
104 + /* Most systems provide FILE as a struct and the necessary bitmask in
105 + <stdio.h>, because they need it for implementing getc() and putc() as
106 + fast macros. */
107 +-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
108 ++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
109 + return ((fp->_flags & _IO_NO_WRITES) != 0
110 + || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
111 + && fp->_IO_read_base != NULL));
112 +--- a/lib/fseeko.c
113 ++++ b/lib/fseeko.c
114 +@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int whence)
115 + #endif
116 +
117 + /* These tests are based on fpurge.c. */
118 +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
119 ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
120 + if (fp->_IO_read_end == fp->_IO_read_ptr
121 + && fp->_IO_write_ptr == fp->_IO_write_base
122 + && fp->_IO_save_base == NULL)
123 +@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int whence)
124 + return -1;
125 + }
126 +
127 +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
128 ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
129 + fp->_flags &= ~_IO_EOF_SEEN;
130 + fp->_offset = pos;
131 + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
132 +--- a/lib/fseterr.c
133 ++++ b/lib/fseterr.c
134 +@@ -29,7 +29,7 @@ fseterr (FILE *fp)
135 + /* Most systems provide FILE as a struct and the necessary bitmask in
136 + <stdio.h>, because they need it for implementing getc() and putc() as
137 + fast macros. */
138 +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
139 ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
140 + fp->_flags |= _IO_ERR_SEEN;
141 + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
142 + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
143 +--- a/lib/stdio-impl.h
144 ++++ b/lib/stdio-impl.h
145 +@@ -18,6 +18,12 @@
146 + the same implementation of stdio extension API, except that some fields
147 + have different naming conventions, or their access requires some casts. */
148 +
149 ++/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
150 ++ problem by defining it ourselves. FIXME: Do not rely on glibc
151 ++ internals. */
152 ++#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
153 ++# define _IO_IN_BACKUP 0x100
154 ++#endif
155 +
156 + /* BSD stdio derived implementations. */
157 +
158 +--
159 +2.19.1
160 +
161
162 diff --git a/app-arch/gzip/gzip-1.9.ebuild b/app-arch/gzip/gzip-1.9.ebuild
163 index d8bd176b4ea..8b9d2dcb48b 100644
164 --- a/app-arch/gzip/gzip-1.9.ebuild
165 +++ b/app-arch/gzip/gzip-1.9.ebuild
166 @@ -18,6 +18,7 @@ IUSE="pic static"
167
168 PATCHES=(
169 "${FILESDIR}/${PN}-1.3.8-install-symlinks.patch"
170 + "${FILESDIR}/${PN}-1.9-gnulib-glibc-2.28.patch"
171 )
172
173 src_configure() {