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 | |
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')
-rw-r--r-- | gdb/config.in | 3 | ||||
-rwxr-xr-x | gdb/configure | 1 | ||||
-rw-r--r-- | gdb/configure.ac | 1 |
3 files changed, 0 insertions, 5 deletions
diff --git a/gdb/config.in b/gdb/config.in index 187b42c..db63aea 100644 --- a/gdb/config.in +++ b/gdb/config.in @@ -586,9 +586,6 @@ /* Define to 1 if you have the <vfork.h> header file. */ #undef HAVE_VFORK_H -/* Define to 1 if you have the `waitpid' function. */ -#undef HAVE_WAITPID - /* Define to 1 if you have the <wait.h> header file. */ #undef HAVE_WAIT_H diff --git a/gdb/configure b/gdb/configure index 138c2a1..de750f4 100755 --- a/gdb/configure +++ b/gdb/configure @@ -29924,7 +29924,6 @@ for ac_func in \ sigsetmask \ ttrace \ use_default_colors \ - waitpid \ wresize \ do : diff --git a/gdb/configure.ac b/gdb/configure.ac index d638b8f..230c0be 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1389,7 +1389,6 @@ AC_CHECK_FUNCS([ \ sigsetmask \ ttrace \ use_default_colors \ - waitpid \ wresize \ ]) |