[PATCH] gdb: add openembedded patches
Rosen Penev
rosenp at gmail.com
Sat Nov 28 01:47:01 EST 2020
Update to musl 1.2.0 removes sgidefs.h. This causes various compilation
issues. Add patches from openembedded to fix.
Remove uClibc-ng patch. The bug was actually with libstdc++ which was
fixed in 1647790ae6202bd70b199e2aa44f8eb43e8d3af1
Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
package/devel/gdb/Makefile | 2 +-
.../devel/gdb/patches/130-uclibc-fix.patch | 11 -------
package/devel/gdb/patches/140-sgidefs.patch | 30 +++++++++++++++++
package/devel/gdb/patches/150-mips64.patch | 32 +++++++++++++++++++
4 files changed, 63 insertions(+), 12 deletions(-)
delete mode 100644 package/devel/gdb/patches/130-uclibc-fix.patch
create mode 100644 package/devel/gdb/patches/140-sgidefs.patch
create mode 100644 package/devel/gdb/patches/150-mips64.patch
diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile
index 17b2bb8481..64ccef1129 100644
--- a/package/devel/gdb/Makefile
+++ b/package/devel/gdb/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=gdb
PKG_VERSION:=10.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/gdb
diff --git a/package/devel/gdb/patches/130-uclibc-fix.patch b/package/devel/gdb/patches/130-uclibc-fix.patch
deleted file mode 100644
index a4c339ebe0..0000000000
--- a/package/devel/gdb/patches/130-uclibc-fix.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/gdb/dwarf2/index-write.c
-+++ b/gdb/dwarf2/index-write.c
-@@ -777,7 +777,7 @@ public:
- gdb_assert (m_abbrev_table.empty ());
- const size_t name_count = m_name_to_value_set.size ();
- m_bucket_table.resize
-- (std::pow (2, std::ceil (std::log2 (name_count * 4 / 3))));
-+ (std::pow (2, std::ceil (log2 (name_count * 4 / 3))));
- m_hash_table.reserve (name_count);
- m_name_table_string_offs.reserve (name_count);
- m_name_table_entry_offs.reserve (name_count);
diff --git a/package/devel/gdb/patches/140-sgidefs.patch b/package/devel/gdb/patches/140-sgidefs.patch
new file mode 100644
index 0000000000..05b30f5242
--- /dev/null
+++ b/package/devel/gdb/patches/140-sgidefs.patch
@@ -0,0 +1,30 @@
+From 677b5b56135141c0d259e370aacd0e11c810aa15 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy at gmail.com>
+Date: Fri, 5 Feb 2016 14:00:00 -0800
+Subject: [PATCH] use <asm/sgidefs.h>
+
+Build fix for MIPS with musl libc
+
+The MIPS specific header <sgidefs.h> is provided by glibc and uclibc
+but not by musl. Regardless of the libc, the kernel headers provide
+<asm/sgidefs.h> which provides the same definitions, so use that
+instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy at gmail.com>
+---
+ gdb/mips-linux-nat.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -31,7 +31,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/package/devel/gdb/patches/150-mips64.patch b/package/devel/gdb/patches/150-mips64.patch
new file mode 100644
index 0000000000..65418fd290
--- /dev/null
+++ b/package/devel/gdb/patches/150-mips64.patch
@@ -0,0 +1,32 @@
+From e92f8932ef488de2a56db4299131ce6a4eb170bd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem at gmail.com>
+Date: Wed, 23 Mar 2016 06:30:09 +0000
+Subject: [PATCH] mips-linux-nat: Define _ABIO32 if not defined
+
+This helps building gdb on mips64 on musl, since
+musl does not provide sgidefs.h this define is
+only defined when GCC is using o32 ABI, in that
+case gcc emits it as built-in define and hence
+it works ok for mips32
+
+Signed-off-by: Khem Raj <raj.khem at gmail.com>
+---
+Upstream-Status: Pending
+
+ gdb/mips-linux-nat.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -42,6 +42,11 @@
+ #define PTRACE_GET_THREAD_AREA 25
+ #endif
+
++/* musl does not define and relies on compiler built-in macros for it */
++#ifndef _ABIO32
++#define _ABIO32 1
++#endif
++
+ class mips_linux_nat_target final : public linux_nat_trad_target
+ {
+ public:
--
2.28.0
More information about the openwrt-devel
mailing list