Gentoo Archives: gentoo-commits

From: "Andreas K. Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/sharutils/files/, app-arch/sharutils/
Date: Wed, 13 Mar 2019 11:45:52
Message-Id: 1552477528.8fb4282568824709c8509d4d22270ecab9801100.dilfridge@gentoo
1 commit: 8fb4282568824709c8509d4d22270ecab9801100
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 13 11:40:48 2019 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 13 11:45:28 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8fb42825
7
8 app-arch/sharutils: Add glibc-2.28 build fix
9
10 Bug: https://bugs.gentoo.org/672048
11 Package-Manager: Portage-2.3.62, Repoman-2.3.12
12 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
13
14 .../files/sharutils-4.15.2-glibc228.patch | 95 ++++++++++++++++++++++
15 app-arch/sharutils/sharutils-4.15.2.ebuild | 4 +-
16 2 files changed, 98 insertions(+), 1 deletion(-)
17
18 diff --git a/app-arch/sharutils/files/sharutils-4.15.2-glibc228.patch b/app-arch/sharutils/files/sharutils-4.15.2-glibc228.patch
19 new file mode 100644
20 index 00000000000..15bd682865e
21 --- /dev/null
22 +++ b/app-arch/sharutils/files/sharutils-4.15.2-glibc228.patch
23 @@ -0,0 +1,95 @@
24 +From: Santiago Vila <sanvila@××××××.org>
25 +Subject: Fix FTBFS with glibc 2.28
26 +Bug-Debian: https://bugs.debian.org/915173
27 +X-Debian-version: 1:4.15.2-4
28 +
29 +Based on this gnulib commit by Paul Eggert:
30 +
31 +https://lists.gnu.org/r/bug-gnulib/2018-03/msg00002.html
32 +
33 +--- a/lib/fflush.c
34 ++++ b/lib/fflush.c
35 +@@ -33,7 +33,7 @@
36 + #undef fflush
37 +
38 +
39 +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
40 ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
41 +
42 + /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
43 + static void
44 +@@ -72,7 +72,7 @@
45 +
46 + #endif
47 +
48 +-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
49 ++#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
50 +
51 + # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
52 + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
53 +@@ -148,7 +148,7 @@
54 + if (stream == NULL || ! freading (stream))
55 + return fflush (stream);
56 +
57 +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
58 ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
59 +
60 + clear_ungetc_buffer_preserving_position (stream);
61 +
62 +--- a/lib/fpurge.c
63 ++++ b/lib/fpurge.c
64 +@@ -62,7 +62,7 @@
65 + /* Most systems provide FILE as a struct and the necessary bitmask in
66 + <stdio.h>, because they need it for implementing getc() and putc() as
67 + fast macros. */
68 +-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
69 ++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
70 + fp->_IO_read_end = fp->_IO_read_ptr;
71 + fp->_IO_write_ptr = fp->_IO_write_base;
72 + /* Avoid memory leak when there is an active ungetc buffer. */
73 +--- a/lib/freading.c
74 ++++ b/lib/freading.c
75 +@@ -31,7 +31,7 @@
76 + /* Most systems provide FILE as a struct and the necessary bitmask in
77 + <stdio.h>, because they need it for implementing getc() and putc() as
78 + fast macros. */
79 +-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
80 ++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
81 + return ((fp->_flags & _IO_NO_WRITES) != 0
82 + || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
83 + && fp->_IO_read_base != NULL));
84 +--- a/lib/fseeko.c
85 ++++ b/lib/fseeko.c
86 +@@ -47,7 +47,7 @@
87 + #endif
88 +
89 + /* These tests are based on fpurge.c. */
90 +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
91 ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
92 + if (fp->_IO_read_end == fp->_IO_read_ptr
93 + && fp->_IO_write_ptr == fp->_IO_write_base
94 + && fp->_IO_save_base == NULL)
95 +@@ -123,7 +123,7 @@
96 + return -1;
97 + }
98 +
99 +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
100 ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
101 + fp->_flags &= ~_IO_EOF_SEEN;
102 + fp->_offset = pos;
103 + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
104 +--- a/lib/stdio-impl.h
105 ++++ b/lib/stdio-impl.h
106 +@@ -18,6 +18,12 @@
107 + the same implementation of stdio extension API, except that some fields
108 + have different naming conventions, or their access requires some casts. */
109 +
110 ++/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
111 ++ problem by defining it ourselves. FIXME: Do not rely on glibc
112 ++ internals. */
113 ++#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
114 ++# define _IO_IN_BACKUP 0x100
115 ++#endif
116 +
117 + /* BSD stdio derived implementations. */
118 +
119
120 diff --git a/app-arch/sharutils/sharutils-4.15.2.ebuild b/app-arch/sharutils/sharutils-4.15.2.ebuild
121 index 1edfe87ae80..ab637e3cd24 100644
122 --- a/app-arch/sharutils/sharutils-4.15.2.ebuild
123 +++ b/app-arch/sharutils/sharutils-4.15.2.ebuild
124 @@ -1,4 +1,4 @@
125 -# Copyright 1999-2017 Gentoo Foundation
126 +# Copyright 1999-2019 Gentoo Authors
127 # Distributed under the terms of the GNU General Public License v2
128
129 EAPI="5"
130 @@ -24,6 +24,8 @@ S=${WORKDIR}/${MY_P}
131 src_prepare() {
132 default
133
134 + epatch "${FILESDIR}/sharutils-4.15.2-glibc228.patch"
135 +
136 # Upstream is aware but thinks this isn't a bug/problem in sharutils itself
137 # See http://lists.gnu.org/archive/html/bug-gnu-utils/2013-10/msg00011.html
138 append-cflags $(test-flags-CC -Wno-error=format-security)