meson: Improve PTRACE_O_EXITKILL presence check

The PTRACE_O_EXITKILL symbol in sys/ptrace.h is an enum member, not
a macro. The #ifdef check added to the GSubprocess test-case in
272ec5dbca will not detect it.

Use cc.has_header_symbol() to properly detect it. According to the
documentation: "Symbols here include function, variable, #define,
type definition, etc.".

Fixes: 272ec5dbca
Closes: https://gitlab.gnome.org/GNOME/glib/-/issues/3156
This commit is contained in:
Alessandro Bono 2023-10-26 09:56:53 +02:00
parent 58cce38f37
commit 168de73a73
2 changed files with 5 additions and 1 deletions

View File

@ -2006,7 +2006,7 @@ trace_children (pid_t main_child)
g_assert_no_errno (waitpid (main_child, &wstatus, 0));
g_assert_no_errno (ptrace (PTRACE_SETOPTIONS, main_child, NULL,
(PTRACE_O_TRACEFORK |
#ifdef PTRACE_O_EXITKILL
#ifdef HAVE_PTRACE_O_EXITKILL
PTRACE_O_EXITKILL |
#endif
PTRACE_O_TRACEVFORK |

View File

@ -2440,6 +2440,10 @@ with open(output, "w") as f:
enable_dtrace = true
endif
if cc.has_header_symbol('sys/ptrace.h', 'PTRACE_O_EXITKILL')
glib_conf.set('HAVE_PTRACE_O_EXITKILL', 1)
endif
# systemtap
want_systemtap = get_option('systemtap')
enable_systemtap = false