[PATCH] gdb: add openembedded patches
Rosen Penev
rosenp at gmail.com
Mon Jul 20 18:31:00 EDT 2020
Update to musl 1.2.0 removes sgidefs.h. This causes various compilation
issues. Add patches from openembedded to fix.
Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
package/devel/gdb/Makefile | 2 +-
package/devel/gdb/patches/140-sgidefs.patch | 32 +++++++++++++++++++
package/devel/gdb/patches/150-mips64.patch | 35 +++++++++++++++++++++
3 files changed, 68 insertions(+), 1 deletion(-)
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 a2abf29f86..591bf962e4 100644
--- a/package/devel/gdb/Makefile
+++ b/package/devel/gdb/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=gdb
PKG_VERSION:=8.3.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/140-sgidefs.patch b/package/devel/gdb/patches/140-sgidefs.patch
new file mode 100644
index 0000000000..686db710f9
--- /dev/null
+++ b/package/devel/gdb/patches/140-sgidefs.patch
@@ -0,0 +1,32 @@
+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(-)
+
+diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
+index a36bb63..fd5c705 100644
+--- 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..49cff5a345
--- /dev/null
+++ b/package/devel/gdb/patches/150-mips64.patch
@@ -0,0 +1,35 @@
+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(+)
+
+diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
+index fd5c705..753f29d 100644
+--- 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.26.2
More information about the openwrt-devel
mailing list