diff options
author | Simon Marchi <simark@simark.ca> | 2024-12-04 21:29:52 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-12-04 21:29:52 +0100 |
commit | 0225ef625554f270552ec5bacf5cd7039a7e8632 (patch) | |
tree | b9ce55bb5e331caa19756d3ca60424fb1fe08de2 /gdb/source.c | |
parent | c719eb2872a89b4ba4a12dbecf774f78762abccb (diff) | |
download | binutils-0225ef625554f270552ec5bacf5cd7039a7e8632.zip binutils-0225ef625554f270552ec5bacf5cd7039a7e8632.tar.gz binutils-0225ef625554f270552ec5bacf5cd7039a7e8632.tar.bz2 |
[gdb/build] Fix build breaker on mingw-w64
The mingw-w64 build breaks currently:
...
In file included from gdb/cli/cli-cmds.c:58:
gdbsupport/eintr.h: In function ‘pid_t gdb::waitpid(pid_t, int*, int)’:
gdbsupport/eintr.h:77:35: error: ‘::waitpid’ has not been declared; \
did you mean ‘gdb::waitpid’?
77 | return gdb::handle_eintr (-1, ::waitpid, pid, wstatus, options);
| ^~~~~~~
| gdb::waitpid
gdbsupport/eintr.h:75:1: note: ‘gdb::waitpid’ declared here
75 | waitpid (pid_t pid, int *wstatus, int options)
| ^~~~~~~
...
This is a regression since commit 658a03e9e85 ("[gdbsupport] Add
gdb::{waitpid,read,write,close}"), which moved the use of ::waitpid from
run_under_shell, where it was used conditionally:
...
#if defined(CANT_FORK) || \
(!defined(HAVE_WORKING_VFORK) && !defined(HAVE_WORKING_FORK))
...
#else
...
int ret = gdb::handle_eintr (-1, ::waitpid, pid, &status, 0);
...
to gdb::waitpid, where it's used unconditionally:
...
inline pid_t
waitpid (pid_t pid, int *wstatus, int options)
{
return gdb::handle_eintr (-1, ::waitpid, pid, wstatus, options);
}
...
Likewise for ::wait.
Guard these uses with HAVE_WAITPID and HAVE_WAIT.
Reproduced and tested by doing a mingw-w64 cross-build on x86_64-linux.
Reported-By: Simon Marchi <simark@simark.ca>
Co-Authored-By: Tom de Vries <tdevries@suse.de>
Diffstat (limited to 'gdb/source.c')
0 files changed, 0 insertions, 0 deletions