kumquat-buildroot/package/gdb/11.2/0007-fix-musl-build-on-riscv.patch
Thomas Petazzoni 8cfbda109f package/gdb: bump 11.x version to 11.2
This is a minor corrective release over GDB 11.1, fixing the following issues:

  PR sim/28302 (gdb fails to build with glibc 2.34)
  PR build/28318 (std::thread support configure check does not use
  CXX_DIALECT)
  PR gdb/28405 (arm-none-eabi: internal-error: ptid_t
  remote_target::select_thread_for_ambiguous_stop_reply(const
  target_waitstatus*): Assertion `first_resumed_thread != nullptr'
  failed)
  PR tui/28483 ([gdb/tui] breakpoint creation not displayed)
  PR build/28555 (uclibc compile failure since commit 4655f8509fd44e6efabefa373650d9982ff37fd6)
  PR rust/28637 (Rust characters will be encoded using DW_ATE_UTF)
  PR gdb/28758 (GDB 11 doesn't work correctly on binaries with a SHT_RELR (.relr.dyn) section)
  PR gdb/28785 (Support SHT_RELR (.relr.dyn) section)

Drop patch 0006-sim-filter-out-SIGSTKSZ-PR-sim-28302.patch, which was
merged upstream as commit 17d6f2152b583cdc7defafa7813b727a304bac5b.

Drop patch 0008-Fix-build-on-rhES5.patch, which was merged upstream as
commit df9ebc472a162306dee8ba6e02b99963c2babb7c?

Drop patch 0009-gdbserver-aarch64-support.patch, which was merged
upstream as commit eb79b2318066cafb75ffdce310e3bbd44f7c79e3.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-03-05 15:06:29 +01:00

61 lines
1.8 KiB
Diff

From c3fdbc0a24c83246f951ba79c7167547da979ae5 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Wed, 10 Nov 2021 23:14:54 +0100
Subject: [PATCH] fix musl build on riscv
Fix the following build failure raised with musl:
../../gdbserver/linux-riscv-low.cc: In function 'void riscv_fill_fpregset(regcache*, void*)':
../../gdbserver/linux-riscv-low.cc:140:19: error: 'ELF_NFPREG' was not declared in this scope; did you mean 'ELF_NGREG'?
140 | for (i = 0; i < ELF_NFPREG - 1; i++, regbuf += flen)
| ^~~~~~~~~~
| ELF_NGREG
musl fixed the issue with
https://git.musl-libc.org/cgit/musl/commit/?id=e5d2823631bbfebacf48e1a34ed28f28d7cb2570
Fixes:
- http://autobuild.buildroot.org/results/16b19198980ce9c81a618b3f6e8dc9fe28247a28
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
gdb/nat/riscv-linux-tdesc.c | 5 +++++
gdbserver/linux-riscv-low.cc | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/gdb/nat/riscv-linux-tdesc.c b/gdb/nat/riscv-linux-tdesc.c
index 837b1707e0f..667c013006a 100644
--- a/gdb/nat/riscv-linux-tdesc.c
+++ b/gdb/nat/riscv-linux-tdesc.c
@@ -31,6 +31,11 @@
# define NFPREG 33
#endif
+/* Work around musl breakage since version 1.1.24. */
+#ifndef ELF_NFPREG
+# define ELF_NFPREG 33
+#endif
+
/* See nat/riscv-linux-tdesc.h. */
struct riscv_gdbarch_features
diff --git a/gdbserver/linux-riscv-low.cc b/gdbserver/linux-riscv-low.cc
index 8bf97ea4aa3..1142dbc7b16 100644
--- a/gdbserver/linux-riscv-low.cc
+++ b/gdbserver/linux-riscv-low.cc
@@ -30,6 +30,11 @@
# define NFPREG 33
#endif
+/* Work around musl breakage since version 1.1.24. */
+#ifndef ELF_NFPREG
+# define ELF_NFPREG 33
+#endif
+
/* Linux target op definitions for the RISC-V architecture. */
class riscv_target : public linux_process_target
--
2.33.0