Gentoo Archives: gentoo-commits

From: "Sergei Trofimovich (slyfox)" <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/gcc/4.9.4/gentoo: 95_all_asan-signal_h.patch 96_all_ucontext-to-ucontext_t.patch 97_all_no-sigaltstack.patch README.history
Date: Fri, 27 Oct 2017 22:36:06
Message-Id: 20171027223603.2F88A831@oystercatcher.gentoo.org
1 slyfox 17/10/27 22:36:03
2
3 Modified: README.history
4 Added: 95_all_asan-signal_h.patch
5 96_all_ucontext-to-ucontext_t.patch
6 97_all_no-sigaltstack.patch
7 Log:
8 gcc/4.9.4: apply patches to fix build against glibc-2.26, bug #629502
9
10 3 patches here (picked as-is from 5.4.0):
11
12 - 95_all_asan-signal_h.patch: add missing '<signal.h>' header
13 - 96_all_ucontext-to-ucontext_t.patch: change 'struct ucontext' to 'ucontext_t'
14 - 97_all_no-sigaltstack.patch: remove 'sigaltstack' usage
15
16 Bug: https://bugs.gentoo.org/629502
17
18 Revision Changes Path
19 1.3 src/patchsets/gcc/4.9.4/gentoo/README.history
20
21 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.4/gentoo/README.history?rev=1.3&view=markup
22 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.4/gentoo/README.history?rev=1.3&content-type=text/plain
23 diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.4/gentoo/README.history?r1=1.2&r2=1.3
24
25 Index: README.history
26 ===================================================================
27 RCS file: /var/cvsroot/gentoo/src/patchsets/gcc/4.9.4/gentoo/README.history,v
28 retrieving revision 1.2
29 retrieving revision 1.3
30 diff -u -r1.2 -r1.3
31 --- README.history 6 Aug 2017 14:46:49 -0000 1.2
32 +++ README.history 27 Oct 2017 22:36:03 -0000 1.3
33 @@ -1,6 +1,9 @@
34 +1.2 27 Oct 2017
35 + + 95_all_asan-signal_h.patch
36 + + 96_all_ucontext-to-ucontext_t.patch
37 + + 97_all_no-sigaltstack.patch
38 1.1 06 Aug 2017
39 + 94_all_compatibility_fix_with_perl_5.26.patch
40 -
41 1.0 14 Aug 2016
42 + 09_all_default-ssp.patch
43 + 10_all_default-fortify-source.patch
44
45
46
47 1.1 src/patchsets/gcc/4.9.4/gentoo/95_all_asan-signal_h.patch
48
49 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.4/gentoo/95_all_asan-signal_h.patch?rev=1.1&view=markup
50 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.4/gentoo/95_all_asan-signal_h.patch?rev=1.1&content-type=text/plain
51
52 Index: 95_all_asan-signal_h.patch
53 ===================================================================
54 Fix error: ‘SIGSEGV’ was not declared in this scope
55
56 https://bugs.gentoo.org/629502#c9
57 https://patchwork.ozlabs.org/patch/725596/
58
59 --- a/libsanitizer/asan/asan_linux.cc
60 +++ b/libsanitizer/asan/asan_linux.cc
61 @@ -29,6 +29,7 @@
62 #include <dlfcn.h>
63 #include <fcntl.h>
64 #include <pthread.h>
65 +#include <signal.h>
66 #include <stdio.h>
67 #include <unistd.h>
68 #include <unwind.h>
69
70
71
72 1.1 src/patchsets/gcc/4.9.4/gentoo/96_all_ucontext-to-ucontext_t.patch
73
74 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.4/gentoo/96_all_ucontext-to-ucontext_t.patch?rev=1.1&view=markup
75 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.4/gentoo/96_all_ucontext-to-ucontext_t.patch?rev=1.1&content-type=text/plain
76
77 Index: 96_all_ucontext-to-ucontext_t.patch
78 ===================================================================
79 https://bugs.gentoo.org/629502
80
81 From ecf0d1a107133c715763940c2b197aa814710e1b Mon Sep 17 00:00:00 2001
82 From: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
83 Date: Tue, 4 Jul 2017 10:25:10 +0000
84 Subject: [PATCH] Use ucontext_t not struct ucontext in linux-unwind.h files.
85
86 Current glibc no longer gives the ucontext_t type the tag struct
87 ucontext, to conform with POSIX namespace rules. This requires
88 various linux-unwind.h files in libgcc, that were previously using
89 struct ucontext, to be fixed to use ucontext_t instead. This is
90 similar to the removal of the struct siginfo tag from siginfo_t some
91 years ago.
92
93 This patch changes those files to use ucontext_t instead. As the
94 standard name that should be unconditionally safe, so this is not
95 restricted to architectures supported by glibc, or conditioned on the
96 glibc version.
97
98 Tested compilation together with current glibc with glibc's
99 build-many-glibcs.py.
100
101 * config/aarch64/linux-unwind.h (aarch64_fallback_frame_state),
102 config/alpha/linux-unwind.h (alpha_fallback_frame_state),
103 config/bfin/linux-unwind.h (bfin_fallback_frame_state),
104 config/i386/linux-unwind.h (x86_64_fallback_frame_state,
105 x86_fallback_frame_state), config/m68k/linux-unwind.h (struct
106 uw_ucontext), config/nios2/linux-unwind.h (struct nios2_ucontext),
107 config/pa/linux-unwind.h (pa32_fallback_frame_state),
108 config/sh/linux-unwind.h (sh_fallback_frame_state),
109 config/tilepro/linux-unwind.h (tile_fallback_frame_state),
110 config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Use
111 ucontext_t instead of struct ucontext.
112
113
114 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@249958 138bc75d-0d04-0410-961f-82ee72b054a4
115 ---
116 libgcc/config/aarch64/linux-unwind.h | 2 +-
117 libgcc/config/alpha/linux-unwind.h | 2 +-
118 libgcc/config/bfin/linux-unwind.h | 2 +-
119 libgcc/config/i386/linux-unwind.h | 4 ++--
120 libgcc/config/m68k/linux-unwind.h | 2 +-
121 libgcc/config/nios2/linux-unwind.h | 2 +-
122 libgcc/config/pa/linux-unwind.h | 2 +-
123 libgcc/config/sh/linux-unwind.h | 2 +-
124 libgcc/config/tilepro/linux-unwind.h | 2 +-
125 libgcc/config/xtensa/linux-unwind.h | 2 +-
126 11 files changed, 25 insertions(+), 11 deletions(-)
127
128 diff --git a/libgcc/config/aarch64/linux-unwind.h b/libgcc/config/aarch64/linux-unwind.h
129 index 86d17b1c798..909f68f7311 100644
130 --- a/libgcc/config/aarch64/linux-unwind.h
131 +++ b/libgcc/config/aarch64/linux-unwind.h
132 @@ -52,7 +52,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context *context,
133 struct rt_sigframe
134 {
135 siginfo_t info;
136 - struct ucontext uc;
137 + ucontext_t uc;
138 };
139
140 struct rt_sigframe *rt_;
141 diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h
142 index d65474fec12..9a226b195b5 100644
143 --- a/libgcc/config/alpha/linux-unwind.h
144 +++ b/libgcc/config/alpha/linux-unwind.h
145 @@ -51,7 +51,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
146 {
147 struct rt_sigframe {
148 siginfo_t info;
149 - struct ucontext uc;
150 + ucontext_t uc;
151 } *rt_ = context->cfa;
152 sc = &rt_->uc.uc_mcontext;
153 }
154 diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h
155 index 0c270e435c7..7fa95d2dc96 100644
156 --- a/libgcc/config/bfin/linux-unwind.h
157 +++ b/libgcc/config/bfin/linux-unwind.h
158 @@ -52,7 +52,7 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
159 void *puc;
160 char retcode[8];
161 siginfo_t info;
162 - struct ucontext uc;
163 + ucontext_t uc;
164 } *rt_ = context->cfa;
165
166 /* The void * cast is necessary to avoid an aliasing warning.
167 diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h
168 index e54bf73b1fd..d35fc4566ce 100644
169 --- a/libgcc/config/i386/linux-unwind.h
170 +++ b/libgcc/config/i386/linux-unwind.h
171 @@ -58,7 +58,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context,
172 if (*(unsigned char *)(pc+0) == 0x48
173 && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
174 {
175 - struct ucontext *uc_ = context->cfa;
176 + ucontext_t *uc_ = context->cfa;
177 /* The void * cast is necessary to avoid an aliasing warning.
178 The aliasing warning is correct, but should not be a problem
179 because it does not alias anything. */
180 @@ -138,7 +138,7 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
181 siginfo_t *pinfo;
182 void *puc;
183 siginfo_t info;
184 - struct ucontext uc;
185 + ucontext_t uc;
186 } *rt_ = context->cfa;
187 /* The void * cast is necessary to avoid an aliasing warning.
188 The aliasing warning is correct, but should not be a problem
189 diff --git a/libgcc/config/m68k/linux-unwind.h b/libgcc/config/m68k/linux-unwind.h
190 index fb79a4d63cd..b2f5ea4cd7c 100644
191 --- a/libgcc/config/m68k/linux-unwind.h
192 +++ b/libgcc/config/m68k/linux-unwind.h
193 @@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
194 /* <sys/ucontext.h> is unfortunately broken right now. */
195 struct uw_ucontext {
196 unsigned long uc_flags;
197 - struct ucontext *uc_link;
198 + ucontext_t *uc_link;
199 stack_t uc_stack;
200 mcontext_t uc_mcontext;
201 unsigned long uc_filler[80];
202 diff --git a/libgcc/config/nios2/linux-unwind.h b/libgcc/config/nios2/linux-unwind.h
203 index dff1c20076e..1d88afecb12 100644
204 --- a/libgcc/config/nios2/linux-unwind.h
205 +++ b/libgcc/config/nios2/linux-unwind.h
206 @@ -38,7 +38,7 @@ struct nios2_mcontext {
207
208 struct nios2_ucontext {
209 unsigned long uc_flags;
210 - struct ucontext *uc_link;
211 + ucontext_t *uc_link;
212 stack_t uc_stack;
213 struct nios2_mcontext uc_mcontext;
214 sigset_t uc_sigmask; /* mask last for extensibility */
215 diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h
216 index 01494685ea4..91575356803 100644
217 --- a/libgcc/config/pa/linux-unwind.h
218 +++ b/libgcc/config/pa/linux-unwind.h
219 @@ -80,7 +80,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
220 struct sigcontext *sc;
221 struct rt_sigframe {
222 siginfo_t info;
223 - struct ucontext uc;
224 + ucontext_t uc;
225 } *frame;
226
227 /* rt_sigreturn trampoline:
228 diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h
229 index e63091f287c..67033f06b4b 100644
230 --- a/libgcc/config/sh/linux-unwind.h
231 +++ b/libgcc/config/sh/linux-unwind.h
232 @@ -180,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
233 {
234 struct rt_sigframe {
235 siginfo_t info;
236 - struct ucontext uc;
237 + ucontext_t uc;
238 } *rt_ = context->cfa;
239 /* The void * cast is necessary to avoid an aliasing warning.
240 The aliasing warning is correct, but should not be a problem
241 diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h
242 index fd83ba7c275..e3c9ef0840d 100644
243 --- a/libgcc/config/tilepro/linux-unwind.h
244 +++ b/libgcc/config/tilepro/linux-unwind.h
245 @@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context,
246 struct rt_sigframe {
247 unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
248 siginfo_t info;
249 - struct ucontext uc;
250 + ucontext_t uc;
251 } *rt_;
252
253 /* Return if this is not a signal handler. */
254 diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h
255 index 9a67b5d2b46..98b7ea60e81 100644
256 --- a/libgcc/config/xtensa/linux-unwind.h
257 +++ b/libgcc/config/xtensa/linux-unwind.h
258 @@ -67,7 +67,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
259
260 struct rt_sigframe {
261 siginfo_t info;
262 - struct ucontext uc;
263 + ucontext_t uc;
264 } *rt_;
265
266 /* movi a2, __NR_rt_sigreturn; syscall */
267 --
268 2.14.1
269
270
271
272
273 1.1 src/patchsets/gcc/4.9.4/gentoo/97_all_no-sigaltstack.patch
274
275 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.4/gentoo/97_all_no-sigaltstack.patch?rev=1.1&view=markup
276 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/4.9.4/gentoo/97_all_no-sigaltstack.patch?rev=1.1&content-type=text/plain
277
278 Index: 97_all_no-sigaltstack.patch
279 ===================================================================
280 https://bugs.gentoo.org/629502
281
282 commit 67dce0587409353e1b6e38c4b33ed89d4ccabe5c
283 Author: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
284 Date: Fri Jul 14 09:10:45 2017 +0000
285
286 PR sanitizer/81066
287 * sanitizer_common/sanitizer_linux.h: Cherry-pick upstream r307969.
288 * sanitizer_common/sanitizer_linux.cc: Likewise.
289 * sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: Likewise.
290 * tsan/tsan_platform_linux.cc: Likewise.
291
292
293 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250200 138bc75d-0d04-0410-961f-82ee72b054a4
294
295 diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc
296 index 806fcd5e284..5b6f18602e7 100644
297 --- a/libsanitizer/sanitizer_common/sanitizer_linux.cc
298 +++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc
299 @@ -605,3 +605,2 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) {
300
301 -uptr internal_sigaltstack(const struct sigaltstack *ss,
302 - struct sigaltstack *oss) {
303 +uptr internal_sigaltstack(const void *ss, void *oss) {
304 diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.h b/libsanitizer/sanitizer_common/sanitizer_linux.h
305 index 895bfc18195..a42df576405 100644
306 --- a/libsanitizer/sanitizer_common/sanitizer_linux.h
307 +++ b/libsanitizer/sanitizer_common/sanitizer_linux.h
308 @@ -19,7 +19,6 @@
309 #include "sanitizer_platform_limits_posix.h"
310
311 struct link_map; // Opaque type returned by dlopen().
312 -struct sigaltstack;
313
314 namespace __sanitizer {
315 // Dirent structure for getdents(). Note that this structure is different from
316 @@ -28,2 +27,1 @@ struct linux_dirent;
317 -uptr internal_sigaltstack(const struct sigaltstack* ss,
318 - struct sigaltstack* oss);
319 +uptr internal_sigaltstack(const void* ss, void* oss);
320 diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
321 index 891386dc0ba..234e8c652c6 100644
322 --- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
323 +++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
324 @@ -273,7 +273,7 @@ static int TracerThread(void* argument) {
325
326 // Alternate stack for signal handling.
327 InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize);
328 - struct sigaltstack handler_stack;
329 + stack_t handler_stack;
330 internal_memset(&handler_stack, 0, sizeof(handler_stack));
331 handler_stack.ss_sp = handler_stack_memory.data();
332 handler_stack.ss_size = kHandlerStackSize;
333 diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc
334 index 2ed5718a12e..6f972ab0dd6 100644
335 --- a/libsanitizer/tsan/tsan_platform_linux.cc
336 +++ b/libsanitizer/tsan/tsan_platform_linux.cc
337 @@ -287,7 +287,7 @@ void InitializePlatform() {
338 int ExtractResolvFDs(void *state, int *fds, int nfd) {
339 #if SANITIZER_LINUX && !SANITIZER_ANDROID
340 int cnt = 0;
341 - __res_state *statp = (__res_state*)state;
342 + struct __res_state *statp = (struct __res_state*)state;
343 for (int i = 0; i < MAXNS && cnt < nfd; i++) {
344 if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
345 fds[cnt++] = statp->_u._ext.nssocks[i];