binutils/binutils: do not fwd declare struct stat (2.22).
For canadian cross to host i686-mingw32 fwd declaring
struct stat is not possible.
Instead #include <sys/stat.h>
Signed-off-by: Titus von Boxberg <titus@v9g.de>
Message-Id: <417a15d4277913841ddd.1353100974@tschetwerikow.boxberg.lan>
Patchwork-Id: 199733
1 fix from upstream for building with newer kernel headers
3 From a7f9ca9cb797d653dc7919538e1dfa0c26010331 Mon Sep 17 00:00:00 2001
4 From: tschwinge <tschwinge>
5 Date: Wed, 21 Mar 2012 13:43:50 +0000
6 Subject: [PATCH] struct siginfo vs. siginfo_t
9 * amd64-linux-nat.c (amd64_linux_siginfo_fixup): Use siginfo_t instead
11 * arm-linux-nat.c (arm_linux_stopped_data_address): Likewise.
12 * ia64-linux-nat.c (ia64_linux_stopped_data_address): Likewise.
13 * linux-nat.c (linux_nat_siginfo_fixup, siginfo_fixup)
14 (linux_xfer_siginfo, linux_nat_set_siginfo_fixup)
15 (linux_nat_get_siginfo): Likewise.
16 * linux-nat.h (struct lwp_info, linux_nat_set_siginfo_fixup)
17 (linux_nat_get_siginfo): Likewise.
18 * linux-tdep.c (linux_get_siginfo_type): Likewise.
19 * ppc-linux-nat.c (ppc_linux_stopped_data_address): Likewise.
20 * procfs.c (gdb_siginfo_t): Likewise.
23 * linux-arm-low.c (arm_stopped_by_watchpoint): Use siginfo_t instead of
25 * linux-low.c (siginfo_fixup, linux_xfer_siginfo): Likewise.
26 * linux-x86-low.c (x86_siginfo_fixup): Likewise.
27 * linux-low.h: Include <signal.h>.
28 (struct siginfo): Remove forward declaration.
29 (struct linux_target_ops) <siginfo_fixup>: Use siginfo_t instead of
32 gdb/ChangeLog | 15 +++++++++++++++
33 gdb/amd64-linux-nat.c | 4 ++--
34 gdb/arm-linux-nat.c | 2 +-
35 gdb/gdbserver/ChangeLog | 11 +++++++++++
36 gdb/gdbserver/linux-arm-low.c | 2 +-
37 gdb/gdbserver/linux-low.c | 10 +++++-----
38 gdb/gdbserver/linux-low.h | 5 ++---
39 gdb/gdbserver/linux-x86-low.c | 4 ++--
40 gdb/ia64-linux-nat.c | 2 +-
41 gdb/linux-nat.c | 16 ++++++++--------
42 gdb/linux-nat.h | 6 +++---
43 gdb/ppc-linux-nat.c | 2 +-
45 13 files changed, 53 insertions(+), 28 deletions(-)
47 diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
48 index f954483..5ebba3a 100644
49 --- a/gdb/amd64-linux-nat.c
50 +++ b/gdb/amd64-linux-nat.c
51 @@ -731,13 +731,13 @@ siginfo_from_compat_siginfo (siginfo_t *to, compat_siginfo_t *from)
55 -amd64_linux_siginfo_fixup (struct siginfo *native, gdb_byte *inf, int direction)
56 +amd64_linux_siginfo_fixup (siginfo_t *native, gdb_byte *inf, int direction)
58 /* Is the inferior 32-bit? If so, then do fixup the siginfo
60 if (gdbarch_addr_bit (get_frame_arch (get_current_frame ())) == 32)
62 - gdb_assert (sizeof (struct siginfo) == sizeof (compat_siginfo_t));
63 + gdb_assert (sizeof (siginfo_t) == sizeof (compat_siginfo_t));
66 compat_siginfo_from_siginfo ((struct compat_siginfo *) inf, native);
67 diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
68 index c5ce21c..f9f6ba5 100644
69 --- a/gdb/arm-linux-nat.c
70 +++ b/gdb/arm-linux-nat.c
71 @@ -1137,7 +1137,7 @@ arm_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw,
73 arm_linux_stopped_data_address (struct target_ops *target, CORE_ADDR *addr_p)
75 - struct siginfo *siginfo_p = linux_nat_get_siginfo (inferior_ptid);
76 + siginfo_t *siginfo_p = linux_nat_get_siginfo (inferior_ptid);
77 int slot = siginfo_p->si_errno;
79 /* This must be a hardware breakpoint. */
80 diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
81 index ff2437d..01208ef 100644
82 --- a/gdb/gdbserver/linux-arm-low.c
83 +++ b/gdb/gdbserver/linux-arm-low.c
84 @@ -631,7 +631,7 @@ static int
85 arm_stopped_by_watchpoint (void)
87 struct lwp_info *lwp = get_thread_lwp (current_inferior);
88 - struct siginfo siginfo;
91 /* We must be able to set hardware watchpoints. */
92 if (arm_linux_get_hw_watchpoint_count () == 0)
93 diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
94 index d2d4c1d..4734f15 100644
95 --- a/gdb/gdbserver/linux-low.c
96 +++ b/gdb/gdbserver/linux-low.c
97 @@ -4779,7 +4779,7 @@ linux_qxfer_osdata (const char *annex,
98 layout of the inferiors' architecture. */
101 -siginfo_fixup (struct siginfo *siginfo, void *inf_siginfo, int direction)
102 +siginfo_fixup (siginfo_t *siginfo, void *inf_siginfo, int direction)
106 @@ -4791,9 +4791,9 @@ siginfo_fixup (struct siginfo *siginfo, void *inf_siginfo, int direction)
110 - memcpy (siginfo, inf_siginfo, sizeof (struct siginfo));
111 + memcpy (siginfo, inf_siginfo, sizeof (siginfo_t));
113 - memcpy (inf_siginfo, siginfo, sizeof (struct siginfo));
114 + memcpy (inf_siginfo, siginfo, sizeof (siginfo_t));
118 @@ -4802,8 +4802,8 @@ linux_xfer_siginfo (const char *annex, unsigned char *readbuf,
119 unsigned const char *writebuf, CORE_ADDR offset, int len)
122 - struct siginfo siginfo;
123 - char inf_siginfo[sizeof (struct siginfo)];
125 + char inf_siginfo[sizeof (siginfo_t)];
127 if (current_inferior == NULL)
129 diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h
130 index 677d261..3aeae70 100644
131 --- a/gdb/gdbserver/linux-low.h
132 +++ b/gdb/gdbserver/linux-low.h
134 #ifdef HAVE_THREAD_DB_H
135 #include <thread_db.h>
139 #include "gdb_proc_service.h"
141 @@ -46,8 +47,6 @@ struct regset_info
142 extern struct regset_info target_regsets[];
147 struct process_info_private
149 /* Arch-specific additions. */
150 @@ -109,7 +108,7 @@ struct linux_target_ops
151 Returns true if any conversion was done; false otherwise.
152 If DIRECTION is 1, then copy from INF to NATIVE.
153 If DIRECTION is 0, copy from NATIVE to INF. */
154 - int (*siginfo_fixup) (struct siginfo *native, void *inf, int direction);
155 + int (*siginfo_fixup) (siginfo_t *native, void *inf, int direction);
157 /* Hook to call when a new process is created or attached to.
158 If extra per-process architecture-specific data is needed,
159 diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
160 index ed1f8a8..b466b5d 100644
161 --- a/gdb/gdbserver/linux-x86-low.c
162 +++ b/gdb/gdbserver/linux-x86-low.c
163 @@ -918,13 +918,13 @@ siginfo_from_compat_siginfo (siginfo_t *to, compat_siginfo_t *from)
167 -x86_siginfo_fixup (struct siginfo *native, void *inf, int direction)
168 +x86_siginfo_fixup (siginfo_t *native, void *inf, int direction)
171 /* Is the inferior 32-bit? If so, then fixup the siginfo object. */
172 if (register_size (0) == 4)
174 - if (sizeof (struct siginfo) != sizeof (compat_siginfo_t))
175 + if (sizeof (siginfo_t) != sizeof (compat_siginfo_t))
176 fatal ("unexpected difference in siginfo");
179 diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
180 index 8773195..19b827f 100644
181 --- a/gdb/ia64-linux-nat.c
182 +++ b/gdb/ia64-linux-nat.c
183 @@ -637,7 +637,7 @@ static int
184 ia64_linux_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p)
187 - struct siginfo *siginfo_p;
188 + siginfo_t *siginfo_p;
189 struct regcache *regcache = get_current_regcache ();
191 siginfo_p = linux_nat_get_siginfo (inferior_ptid);
192 diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
193 index f80c0c1..d81d55e 100644
194 --- a/gdb/linux-nat.c
195 +++ b/gdb/linux-nat.c
196 @@ -188,7 +188,7 @@ static void (*linux_nat_prepare_to_resume) (struct lwp_info *);
197 /* The method to call, if any, when the siginfo object needs to be
198 converted between the layout returned by ptrace, and the layout in
199 the architecture of the inferior. */
200 -static int (*linux_nat_siginfo_fixup) (struct siginfo *,
201 +static int (*linux_nat_siginfo_fixup) (siginfo_t *,
205 @@ -4232,7 +4232,7 @@ linux_nat_mourn_inferior (struct target_ops *ops)
206 layout of the inferiors' architecture. */
209 -siginfo_fixup (struct siginfo *siginfo, gdb_byte *inf_siginfo, int direction)
210 +siginfo_fixup (siginfo_t *siginfo, gdb_byte *inf_siginfo, int direction)
214 @@ -4244,9 +4244,9 @@ siginfo_fixup (struct siginfo *siginfo, gdb_byte *inf_siginfo, int direction)
218 - memcpy (siginfo, inf_siginfo, sizeof (struct siginfo));
219 + memcpy (siginfo, inf_siginfo, sizeof (siginfo_t));
221 - memcpy (inf_siginfo, siginfo, sizeof (struct siginfo));
222 + memcpy (inf_siginfo, siginfo, sizeof (siginfo_t));
226 @@ -4256,8 +4256,8 @@ linux_xfer_siginfo (struct target_ops *ops, enum target_object object,
227 const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
230 - struct siginfo siginfo;
231 - gdb_byte inf_siginfo[sizeof (struct siginfo)];
233 + gdb_byte inf_siginfo[sizeof (siginfo_t)];
235 gdb_assert (object == TARGET_OBJECT_SIGNAL_INFO);
236 gdb_assert (readbuf || writebuf);
237 @@ -5266,7 +5266,7 @@ linux_nat_set_new_thread (struct target_ops *t,
240 linux_nat_set_siginfo_fixup (struct target_ops *t,
241 - int (*siginfo_fixup) (struct siginfo *,
242 + int (*siginfo_fixup) (siginfo_t *,
246 @@ -5285,7 +5285,7 @@ linux_nat_set_prepare_to_resume (struct target_ops *t,
249 /* Return the saved siginfo associated with PTID. */
252 linux_nat_get_siginfo (ptid_t ptid)
254 struct lwp_info *lp = find_lwp_pid (ptid);
255 diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h
256 index c9878d9..d87f0cf 100644
257 --- a/gdb/linux-nat.h
258 +++ b/gdb/linux-nat.h
259 @@ -78,7 +78,7 @@ struct lwp_info
261 /* Non-zero si_signo if this LWP stopped with a trap. si_addr may
262 be the address of a hardware watchpoint. */
263 - struct siginfo siginfo;
266 /* STOPPED_BY_WATCHPOINT is non-zero if this LWP stopped with a data
268 @@ -184,7 +184,7 @@ void linux_nat_set_new_thread (struct target_ops *, void (*) (struct lwp_info *)
269 that ptrace returns, and the layout in the architecture of the
271 void linux_nat_set_siginfo_fixup (struct target_ops *,
272 - int (*) (struct siginfo *,
273 + int (*) (siginfo_t *,
277 @@ -198,7 +198,7 @@ void linux_nat_set_prepare_to_resume (struct target_ops *,
278 void linux_nat_switch_fork (ptid_t new_ptid);
280 /* Return the saved siginfo associated with PTID. */
281 -struct siginfo *linux_nat_get_siginfo (ptid_t ptid);
282 +siginfo_t *linux_nat_get_siginfo (ptid_t ptid);
284 /* Compute and return the processor core of a given thread. */
285 int linux_nat_core_of_thread_1 (ptid_t ptid);
286 diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
287 index 1bd157b..9bd11fd 100644
288 --- a/gdb/ppc-linux-nat.c
289 +++ b/gdb/ppc-linux-nat.c
290 @@ -2218,7 +2218,7 @@ ppc_linux_thread_exit (struct thread_info *tp, int silent)
292 ppc_linux_stopped_data_address (struct target_ops *target, CORE_ADDR *addr_p)
294 - struct siginfo *siginfo_p;
295 + siginfo_t *siginfo_p;
297 siginfo_p = linux_nat_get_siginfo (inferior_ptid);
299 diff --git a/gdb/procfs.c b/gdb/procfs.c
300 index 903621d..cb4bc7c 100644
303 @@ -266,7 +266,7 @@ typedef struct sigaction gdb_sigaction_t;
304 #ifdef HAVE_PR_SIGINFO64_T
305 typedef pr_siginfo64_t gdb_siginfo_t;
307 -typedef struct siginfo gdb_siginfo_t;
308 +typedef siginfo_t gdb_siginfo_t;
311 /* On mips-irix, praddset and prdelset are defined in such a way that