gdb: add upstream patches to fix musl build
PATCH 1/1 gdb: add upstream patches to fix musl build
Backported three patches from upstream to all four versions of gdb that we support.
The "skipping exited and joined thread" message only exists in 7.10.1 so that hunk is removed in the earlier versions. The ChangeLog modifications are also removed.
Fixes
http://autobuild.buildroot.net/results/e81/e8156d0b89e7157b8f10e428fc0958b0eb29e50a/
---
I could probably have left out 7.7.1 since it's deprecated, but I didn't notice that until after I had created the patches :-)
The patches have been manually edited, I haven't cherry-picked them in git (problem with cloning the repo). But I have tested all 4 versions.
--- .../0001-Add-some-casts-for-building-on-musl.patch | 90 ++++++++++++++++++++++ ...musl-Move-W_STOPCODE-to-common-gdb_wait-h.patch | 63 +++++++++++++++ package/gdb/7.10.1/0003-move-__SIGRTMIN.patch | 58 ++++++++++++++ .../0003-Add-some-casts-for-building-on-musl.patch | 72 +++++++++++++++++ ...musl-Move-W_STOPCODE-to-common-gdb_wait-h.patch | 63 +++++++++++++++ package/gdb/7.7.1/0005-move-__SIGRTMIN.patch | 58 ++++++++++++++ .../0004-Add-some-casts-for-building-on-musl.patch | 70 +++++++++++++++++ ...musl-Move-W_STOPCODE-to-common-gdb_wait-h.patch | 63 +++++++++++++++ package/gdb/7.8.2/0006-move-__SIGRTMIN.patch | 58 ++++++++++++++ .../0005-Add-some-casts-for-building-on-musl.patch | 70 +++++++++++++++++ ...musl-Move-W_STOPCODE-to-common-gdb_wait-h.patch | 63 +++++++++++++++ package/gdb/7.9.1/0007-move-__SIGRTMIN.patch | 58 ++++++++++++++ 12 files changed, 786 insertions(+) create mode 100644 package/gdb/7.10.1/0001-Add-some-casts-for-building-on-musl.patch create mode 100644 package/gdb/7.10.1/0002-musl-Move-W_STOPCODE-to-common-gdb_wait-h.patch create mode 100644 package/gdb/7.10.1/0003-move-__SIGRTMIN.patch create mode 100644 package/gdb/7.7.1/0003-Add-some-casts-for-building-on-musl.patch create mode 100644 package/gdb/7.7.1/0004-musl-Move-W_STOPCODE-to-common-gdb_wait-h.patch create mode 100644 package/gdb/7.7.1/0005-move-__SIGRTMIN.patch create mode 100644 package/gdb/7.8.2/0004-Add-some-casts-for-building-on-musl.patch create mode 100644 package/gdb/7.8.2/0005-musl-Move-W_STOPCODE-to-common-gdb_wait-h.patch create mode 100644 package/gdb/7.8.2/0006-move-__SIGRTMIN.patch create mode 100644 package/gdb/7.9.1/0005-Add-some-casts-for-building-on-musl.patch create mode 100644 package/gdb/7.9.1/0006-musl-Move-W_STOPCODE-to-common-gdb_wait-h.patch create mode 100644 package/gdb/7.9.1/0007-move-__SIGRTMIN.patch
package/gdb/7.10.1/0001-Add-some-casts-for-building-on-musl.patch new file +90 -0
@@ -0,0 +1,90 @@ +From d41401ace01c234f42697e190a2ac95991780626 Mon Sep 17 00:00:00 2001 +From: Doug Evans <[email protected]> +Date: Mon, 26 Oct 2015 13:20:12 -0700 +Subject: [PATCH] Add some casts for building on musl. + +gdb/ChangeLog: + + * linux-thread-db.c (find_new_threads_callback): Cast ti.ti_tid to + unsigned long for debug_printf. + (thread_db_pid_to_str): Ditto. + +gdb/gdbserver/ChangeLog: + + * thread-db.c (find_one_thread): Cast ti.ti_tid to unsigned long + for debug_printf. + (attach_thread, find_new_threads_callback): Ditto. + +[Arnout: removed the parts that don't apply, including ChangeLog] +Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]> +--- + gdb/ChangeLog | 5 +++++ + gdb/gdbserver/ChangeLog | 6 ++++++ + gdb/gdbserver/thread-db.c | 9 +++++---- + gdb/linux-thread-db.c | 5 +++-- + 4 files changed, 19 insertions(+), 6 deletions(-) + +diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c +index ffe722d..3df10ff 100644 +--- a/gdb/gdbserver/thread-db.c ++++ b/gdb/gdbserver/thread-db.c +@@ -278,7 +278,7 @@ find_one_thread (ptid_t ptid) + + if (debug_threads) + debug_printf ("Found thread %ld (LWP %d)\n", +- ti.ti_tid, ti.ti_lid); ++ (unsigned long) ti.ti_tid, ti.ti_lid); + + if (lwpid != ti.ti_lid) + { +@@ -319,12 +319,12 @@ attach_thread (const td_thrhandle_t *th_p, td_thrinfo_t *ti_p) + + if (debug_threads) + debug_printf ("Attaching to thread %ld (LWP %d)\n", +- ti_p->ti_tid, ti_p->ti_lid); ++ (unsigned long) ti_p->ti_tid, ti_p->ti_lid); + err = linux_attach_lwp (ptid); + if (err != 0) + { + warning ("Could not attach to thread %ld (LWP %d): %s\n", +- ti_p->ti_tid, ti_p->ti_lid, ++ (unsigned long) ti_p->ti_tid, ti_p->ti_lid, + linux_ptrace_attach_fail_reason_string (ptid, err)); + return 0; + } +@@ -392,7 +392,8 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data) + glibc PR17707. */ + if (debug_threads) + debug_printf ("thread_db: skipping exited and " +- "joined thread (0x%lx)\n", ti.ti_tid); ++ "joined thread (0x%lx)\n", ++ (unsigned long) ti.ti_tid); + return 0; + } + +diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c +index 66e9595..41db29a 100644 +--- a/gdb/linux-thread-db.c ++++ b/gdb/linux-thread-db.c +@@ -1585,7 +1585,8 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data) + if (libthread_db_debug) + fprintf_unfiltered (gdb_stdlog, + "thread_db: skipping exited and " +- "joined thread (0x%lx)\n", ti.ti_tid); ++ "joined thread (0x%lx)\n", ++ (unsigned long) ti.ti_tid); + return 0; + } + +@@ -1816,7 +1817,7 @@ thread_db_pid_to_str (struct target_ops *ops, ptid_t ptid) + + tid = thread_info->priv->tid; + snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld)", +- tid, ptid_get_lwp (ptid)); ++ (unsigned long) tid, ptid_get_lwp (ptid)); + + return buf; + } +-- +1.9.4 +
package/gdb/7.10.1/0002-musl-Move-W_STOPCODE-to-common-gdb_wait-h.patch new file +63 -0
63 lines not on this page · raw message
package/gdb/7.10.1/0003-move-__SIGRTMIN.patch new file +58 -0
58 lines not on this page · raw message
package/gdb/7.7.1/0003-Add-some-casts-for-building-on-musl.patch new file +72 -0
72 lines not on this page · raw message
package/gdb/7.7.1/0004-musl-Move-W_STOPCODE-to-common-gdb_wait-h.patch new file +63 -0
63 lines not on this page · raw message
package/gdb/7.7.1/0005-move-__SIGRTMIN.patch new file +58 -0
58 lines not on this page · raw message
package/gdb/7.8.2/0004-Add-some-casts-for-building-on-musl.patch new file +70 -0
70 lines not on this page · raw message
package/gdb/7.8.2/0005-musl-Move-W_STOPCODE-to-common-gdb_wait-h.patch new file +63 -0
63 lines not on this page · raw message
package/gdb/7.8.2/0006-move-__SIGRTMIN.patch new file +58 -0
58 lines not on this page · raw message
package/gdb/7.9.1/0005-Add-some-casts-for-building-on-musl.patch new file +70 -0
70 lines not on this page · raw message
package/gdb/7.9.1/0006-musl-Move-W_STOPCODE-to-common-gdb_wait-h.patch new file +63 -0
63 lines not on this page · raw message
package/gdb/7.9.1/0007-move-__SIGRTMIN.patch new file +58 -0
58 lines not on this page · raw message
Signature · 1 line
2.7.0
Thomas Petazzoni
AppliedPATCH 1/1 gdb: add upstream patches to fix musl build
Dear Arnout Vandecappelle (Essensium/Mind),
Quoted 7 lines · Arnout Vandecappelle (Essensium/Mind)
Backported three patches from upstream to all four versions of gdb that we support.
The "skipping exited and joined thread" message only exists in 7.10.1 so that hunk is removed in the earlier versions. The ChangeLog modifications are also removed.
Quoted 7 lines
Fixes
http://autobuild.buildroot.net/results/e81/e8156d0b89e7157b8f10e428fc0958b0eb29e50a/---
I could probably have left out 7.7.1 since it's deprecated, but I didn't notice that until after I had created the patches :-)
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com