public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug build/31483] New: [gdb/build, postmarketos] error: 'W_EXITCODE' was not declared in this scope
@ 2024-03-14 7:53 vries at gcc dot gnu.org
2024-03-14 8:34 ` [Bug build/31483] " vries at gcc dot gnu.org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2024-03-14 7:53 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31483
Bug ID: 31483
Summary: [gdb/build, postmarketos] error: 'W_EXITCODE' was not
declared in this scope
Product: gdb
Version: unknown
Status: NEW
Severity: normal
Priority: P2
Component: build
Assignee: unassigned at sourceware dot org
Reporter: vries at gcc dot gnu.org
Target Milestone: ---
I tried building gdb and gdbserver on a postmarketos distro installation, and
ran into:
...
/home/user/gdb/src/gdbserver/linux-low.cc: In lambda function:
/home/user/gdb/src/gdbserver/linux-low.cc:1907:41: error: 'W_EXITCODE' was not
declared in this scope
1907 | mark_lwp_dead (leader_lp, W_EXITCODE (0, 0), true);
| ^~~~~~~~~~
..
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug build/31483] [gdb/build, postmarketos] error: 'W_EXITCODE' was not declared in this scope
2024-03-14 7:53 [Bug build/31483] New: [gdb/build, postmarketos] error: 'W_EXITCODE' was not declared in this scope vries at gcc dot gnu.org
@ 2024-03-14 8:34 ` vries at gcc dot gnu.org
2024-03-14 8:35 ` vries at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2024-03-14 8:34 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31483
--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
In gdbsupport/gdb_wait.h, we have:
...
#ifndef WSETEXIT
# ifdef W_EXITCODE
#define WSETEXIT(w,status) ((w) = W_EXITCODE(status,0))
# else
#define WSETEXIT(w,status) ((w) = (0 | ((status) << 8)))
# endif
#endif
...
so this should probably work:
...
diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc
index 9d5a6242803..aaa7bbc2a4c 100644
--- a/gdbserver/linux-low.cc
+++ b/gdbserver/linux-low.cc
@@ -1904,7 +1904,9 @@ linux_process_target::check_zombie_leaders ()
thread_info *leader_thread = get_lwp_thread (leader_lp);
if (report_exit_events_for (leader_thread))
{
- mark_lwp_dead (leader_lp, W_EXITCODE (0, 0), true);
+ int wstat;
+ WSETEXIT (wstat, 0);
+ mark_lwp_dead (leader_lp, wstat, true);
new_pending_event = true;
}
else
...
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug build/31483] [gdb/build, postmarketos] error: 'W_EXITCODE' was not declared in this scope
2024-03-14 7:53 [Bug build/31483] New: [gdb/build, postmarketos] error: 'W_EXITCODE' was not declared in this scope vries at gcc dot gnu.org
2024-03-14 8:34 ` [Bug build/31483] " vries at gcc dot gnu.org
@ 2024-03-14 8:35 ` vries at gcc dot gnu.org
2024-03-14 9:55 ` vries at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2024-03-14 8:35 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31483
Tom de Vries <vries at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Version|unknown |HEAD
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug build/31483] [gdb/build, postmarketos] error: 'W_EXITCODE' was not declared in this scope
2024-03-14 7:53 [Bug build/31483] New: [gdb/build, postmarketos] error: 'W_EXITCODE' was not declared in this scope vries at gcc dot gnu.org
2024-03-14 8:34 ` [Bug build/31483] " vries at gcc dot gnu.org
2024-03-14 8:35 ` vries at gcc dot gnu.org
@ 2024-03-14 9:55 ` vries at gcc dot gnu.org
2024-03-14 20:27 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2024-03-14 9:55 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31483
--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/pipermail/gdb-patches/2024-March/207254.html
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug build/31483] [gdb/build, postmarketos] error: 'W_EXITCODE' was not declared in this scope
2024-03-14 7:53 [Bug build/31483] New: [gdb/build, postmarketos] error: 'W_EXITCODE' was not declared in this scope vries at gcc dot gnu.org
` (2 preceding siblings ...)
2024-03-14 9:55 ` vries at gcc dot gnu.org
@ 2024-03-14 20:27 ` cvs-commit at gcc dot gnu.org
2024-03-14 20:28 ` vries at gcc dot gnu.org
2024-03-14 22:43 ` sam at gentoo dot org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-14 20:27 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31483
--- Comment #3 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=97e9c24c38513a69db81fe4c8206785c3a7050af
commit 97e9c24c38513a69db81fe4c8206785c3a7050af
Author: Tom de Vries <tdevries@suse.de>
Date: Thu Mar 14 21:28:44 2024 +0100
[gdb/build] Fix build on postmarketos
I tried building gdbserver on postmarketos (which is based on alpine linux,
which uses musl libc), and ran into:
...
gdbserver/linux-low.cc: In lambda function:
gdbserver/linux-low.cc:1907:41: error: \
'W_EXITCODE' was not declared in this scope
1907 | mark_lwp_dead (leader_lp, W_EXITCODE (0, 0), true);
| ^~~~~~~~~~
...
The macro W_EXITCODE is not defined in gdbsupport/gdb_wait.h.
OTOH, WSETEXIT is defined there, but unused:
...
/* These are not defined in POSIX, but are used by our programs. */
#ifndef WSETEXIT
# ifdef W_EXITCODE
#define WSETEXIT(w,status) ((w) = W_EXITCODE(status,0))
# else
#define WSETEXIT(w,status) ((w) = (0 | ((status) << 8)))
# endif
#endif
...
Fix this by dropping the WSETEXIT definition, and instead defining
W_EXITCODE.
Tested on x86_64-linux, in combination with an "#undef W_EXITCODE" to make
sure the definition is exercised.
Approved-By: Tom Tromey <tom@tromey.com>
PR build/31483
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31483
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug build/31483] [gdb/build, postmarketos] error: 'W_EXITCODE' was not declared in this scope
2024-03-14 7:53 [Bug build/31483] New: [gdb/build, postmarketos] error: 'W_EXITCODE' was not declared in this scope vries at gcc dot gnu.org
` (3 preceding siblings ...)
2024-03-14 20:27 ` cvs-commit at gcc dot gnu.org
@ 2024-03-14 20:28 ` vries at gcc dot gnu.org
2024-03-14 22:43 ` sam at gentoo dot org
5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2024-03-14 20:28 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31483
Tom de Vries <vries at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |15.1
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
Fixed.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug build/31483] [gdb/build, postmarketos] error: 'W_EXITCODE' was not declared in this scope
2024-03-14 7:53 [Bug build/31483] New: [gdb/build, postmarketos] error: 'W_EXITCODE' was not declared in this scope vries at gcc dot gnu.org
` (4 preceding siblings ...)
2024-03-14 20:28 ` vries at gcc dot gnu.org
@ 2024-03-14 22:43 ` sam at gentoo dot org
5 siblings, 0 replies; 7+ messages in thread
From: sam at gentoo dot org @ 2024-03-14 22:43 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31483
Sam James <sam at gentoo dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sam at gentoo dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-03-14 22:43 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-14 7:53 [Bug build/31483] New: [gdb/build, postmarketos] error: 'W_EXITCODE' was not declared in this scope vries at gcc dot gnu.org
2024-03-14 8:34 ` [Bug build/31483] " vries at gcc dot gnu.org
2024-03-14 8:35 ` vries at gcc dot gnu.org
2024-03-14 9:55 ` vries at gcc dot gnu.org
2024-03-14 20:27 ` cvs-commit at gcc dot gnu.org
2024-03-14 20:28 ` vries at gcc dot gnu.org
2024-03-14 22:43 ` sam at gentoo dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).