Skip to contentSkip to conversation

package/gdb: bump to version 9.2

PATCH Superseded Romain Naour 2 participants 4 messages Aug 5, 2020 – Aug 17, 2020

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/gdb: bump to version 9.2

From: Maxim Kochetkov <[email protected]>

The in-tree build restriction has been added after the move of gnulib to top level [1] [2]. This restriction has been added as a workaround a build issue with gdbserver that still use it's own copy of gnulib.

gnulib is configured a second time if we build in-tree gdb and gdbserver:
configure: error: source directory already configured; run "make distclean" there first
configure: error: .././../../gnulib/configure failed for build-gnulib-gdbserver
configure: error: ./configure failed for gdbserver

Use the same pre-configure-hook as gcc package.

Older gdb version support building out of tree even if it's not required.

There is no in-tree build restriction of we only build gdbserver for the target.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=73cc72729a184f00bf6fc4d74684a8516ba6b683
[2] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=043a0010933a6b55081535ecaf7fde9cc1491be0

See:
https://sourceware.org/pipermail/gdb-announce/2020/000122.html
https://sourceware.org/pipermail/gdb-announce/2020/000123.html

[Romain:
- add in-tree build support
- improve commit log]

---
 ...e-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch | 55 ++++++++++++++++
 ...-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch | 43 +++++++++++++
 package/gdb/9.2/0003-use-asm-sgidefs.h.patch  | 40 ++++++++++++
 .../0004-gdbserver-fix-build-for-m68k.patch   | 62 +++++++++++++++++++
 ...fork-inferior-include-linux-ptrace.h.patch | 53 ++++++++++++++++
 package/gdb/Config.in.host                    |  4 ++
 package/gdb/gdb.hash                          |  1 +
 package/gdb/gdb.mk                            | 23 ++++++-
 8 files changed, 280 insertions(+), 1 deletion(-)
 create mode 100644 package/gdb/9.2/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
 create mode 100644 package/gdb/9.2/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch
 create mode 100644 package/gdb/9.2/0003-use-asm-sgidefs.h.patch
 create mode 100644 package/gdb/9.2/0004-gdbserver-fix-build-for-m68k.patch
 create mode 100644 package/gdb/9.2/0005-nat-fork-inferior-include-linux-ptrace.h.patch
package/gdb/9.2/0001-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch new file +55 -0
new file mode 100644
index 0000000000..ab8dc626f0
@@ -0,0 +1,55 @@
+From 72ee19f54fd35595465b2e35eccf1f3d65fe21c6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 6 Aug 2016 17:32:50 -0700
+Subject: [PATCH] ppc/ptrace: Define pt_regs uapi_pt_regs on !GLIBC systems
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+Signed-off-by: Thomas Petazzoni <[email protected]>
+[Rebase on gdb 8.3]
+Signed-off-by: Romain Naour <[email protected]>
+---
+ gdb/gdbserver/linux-ppc-low.c | 6 ++++++
+ gdb/nat/ppc-linux.h           | 6 ++++++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
+index 1b695e53fe9..1978347c02c 100644
+--- a/gdb/gdbserver/linux-ppc-low.c
++++ b/gdb/gdbserver/linux-ppc-low.c
+@@ -23,7 +23,13 @@
+ #include "elf/common.h"
+ #include <sys/uio.h>
+ #include <elf.h>
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++#endif
+ 
+ #include "arch/ppc-linux-common.h"
+ #include "arch/ppc-linux-tdesc.h"
+diff --git a/gdb/nat/ppc-linux.h b/gdb/nat/ppc-linux.h
+index f1561b3b357..40399361c09 100644
+--- a/gdb/nat/ppc-linux.h
++++ b/gdb/nat/ppc-linux.h
+@@ -18,7 +18,13 @@
+ #ifndef NAT_PPC_LINUX_H
+ #define NAT_PPC_LINUX_H
+ 
++#if !defined(__GLIBC__)
++# define pt_regs uapi_pt_regs
++#endif
+ #include <asm/ptrace.h>
++#if !defined(__GLIBC__)
++# undef pt_regs
++#endif
+ #include <asm/cputable.h>
+ 
+ /* This sometimes isn't defined.  */
+-- 
+2.21.0
+
package/gdb/9.2/0002-sh-ptrace-Define-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch new file +43 -0

43 lines not on this page · raw message

package/gdb/9.2/0003-use-asm-sgidefs.h.patch new file +40 -0
new file mode 100644
index 0000000000..2909f62c68
@@ -0,0 +1,40 @@
+From 19a0f664809b6858e69aa98188eb739415de044c Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <[email protected]>
+Date: Sat, 30 Apr 2016 15:29:06 -0700
+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
+
+[Vincent:
+Taken from: https://sourceware.org/bugzilla/show_bug.cgi?id=21070]
+
+Signed-off-by: Andre McCurdy <[email protected]>
+Signed-off-by: Khem Raj <[email protected]>
+Signed-off-by: Vicente Olivert Riera <[email protected]>
+---
+ 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 e68ed1e4da9..bc42aa59685 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"
+-- 
+2.21.0
+
package/gdb/9.2/0004-gdbserver-fix-build-for-m68k.patch new file +62 -0

62 lines not on this page · raw message

package/gdb/9.2/0005-nat-fork-inferior-include-linux-ptrace.h.patch new file +53 -0

53 lines not on this page · raw message

package/gdb/Config.in.host +4 -0
index c5776c20e6..ab054b1596 100644
@@ -78,6 +78,9 @@ config BR2_GDB_VERSION_8_2
 config BR2_GDB_VERSION_8_3
 	bool "gdb 8.3.x"
 
+config BR2_GDB_VERSION_9_2
+	bool "gdb 9.2.x"
+
 endchoice
 
 endif
@@ -90,4 +93,5 @@ config BR2_GDB_VERSION
 	default "8.1.1"    if BR2_GDB_VERSION_8_1
 	default "8.2.1"    if BR2_GDB_VERSION_8_2 || !BR2_PACKAGE_HOST_GDB
 	default "8.3.1"    if BR2_GDB_VERSION_8_3
+	default "9.2"      if BR2_GDB_VERSION_9_2
 	depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
package/gdb/gdb.hash +1 -0
index 291c224b0f..54fe0ff2a4 100644
@@ -2,6 +2,7 @@
 sha512  7dcd5e8c90de92f577834d887b5f54edb93a07083bfe661bc46c270a6cc4919f0b348e7e2fe8ae4511298a570ef150eeefdc667ef7cf527f0cf60943177ab6c9  gdb-8.1.1.tar.xz
 sha512  2aa81cfd389bb48c35d7d9f95cc10e88b4f7ad4597bdde0f8f1fd312f60f10d9fb2cc6e5a9355227d89ff328f7feb0fc411a69394560cafeb9fa75d35d896d11  gdb-8.2.1.tar.xz
 sha512  9053a2dc6b9eb921907afbc4cecc75d635aa76df5e8c4f0e5824ccf57cb206b299c19b127fff000b65c334826ff8304a54ff6098428365a8e997cca886c39e9a  gdb-8.3.1.tar.xz
+sha512  73635f00f343117aa5e2436f1e1597099e2bfb31ef7bb162b273fa1ea282c3fa9b0f52762e70bfc7ad0334addb8d159e9ac7cbe5998ca4f755ea8cf90714d274  gdb-9.2.tar.xz
 
 # Locally calculated (fetched from Github)
 sha512  74346a2a2b2082d35377711946b12c824222005c66813d5648350b101697eac67d3d01617e1daea03e41c196c2b7b4a4b225d1ee58af91dc69731bffed0e5d51  gdb-arc-2020.03-release-gdb.tar.gz
package/gdb/gdb.mk +22 -1
index 8c74a0e2f6..300e89671b 100644
@@ -26,10 +26,20 @@ GDB_LICENSE_FILES = COPYING COPYING.LIB COPYING3 COPYING3.LIB
 # We only want gdbserver and not the entire debugger.
 ifeq ($(BR2_PACKAGE_GDB_DEBUGGER),)
 GDB_SUBDIR = gdb/gdbserver
-HOST_GDB_SUBDIR = .
 else
 GDB_DEPENDENCIES = ncurses \
 	$(if $(BR2_PACKAGE_LIBICONV),libiconv)
+GDB_SUBDIR = build
+
+# Since gdb 9, in-tree builds for GDB are not allowed anymore,
+# so we create a 'build' subdirectory in the gcc sources, and
+# build from there.
+define GDB_CONFIGURE_SYMLINK
+	mkdir -p $(@D)/$(GDB_SUBDIR)
+	ln -sf ../configure $(@D)/$(GDB_SUBDIR)/configure
+endef
+GDB_PRE_CONFIGURE_HOOKS += GDB_CONFIGURE_SYMLINK
+
 endif
 
 # For the host variant, we really want to build with XML support,
@@ -251,6 +261,17 @@ else
 HOST_GDB_CONF_OPTS += --disable-sim
 endif
 
+# Since gdb 9, in-tree builds for GDB are not allowed anymore,
+# so we create a 'build' subdirectory in the gcc sources, and
+# build from there.
+HOST_GDB_SUBDIR = build
+
+define HOST_GDB_CONFIGURE_SYMLINK
+	mkdir -p $(@D)/build
+	ln -sf ../configure $(@D)/build/configure
+endef
+HOST_GDB_PRE_CONFIGURE_HOOKS += HOST_GDB_CONFIGURE_SYMLINK
+
 # legacy $arch-linux-gdb symlink
 define HOST_GDB_ADD_SYMLINK
 	cd $(HOST_DIR)/bin && \
Signature · 1 line
2.25.4
#1 lore raw

PATCH v2 1/1 package/gdb: bump to version 9.2

Hello Romain,

Quoted 24 lines · On Wed, 5 Aug 2020 16:03:37 +0200 Romain Naour <[email protected]> wrote:

From: Maxim Kochetkov <[email protected]>

The in-tree build restriction has been added after the move of gnulib to top level [1] [2]. This restriction has been added as a workaround a build issue with gdbserver that still use it's own copy of gnulib.

gnulib is configured a second time if we build in-tree gdb and gdbserver:
configure: error: source directory already configured; run "make distclean" there first
configure: error: .././../../gnulib/configure failed for build-gnulib-gdbserver
configure: error: ./configure failed for gdbserver

Use the same pre-configure-hook as gcc package.

Older gdb version support building out of tree even if it's not required.

There is no in-tree build restriction of we only build gdbserver for the target.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=73cc72729a184f00bf6fc4d74684a8516ba6b683
[2] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=043a0010933a6b55081535ecaf7fde9cc1491be0

See:
https://sourceware.org/pipermail/gdb-announce/2020/000122.html
https://sourceware.org/pipermail/gdb-announce/2020/000123.html

Quoted 5 lines

[Romain:
- add in-tree build support
- improve commit log]

Following this, should we also do our usual dance: switch to gdb 8.3 as the default, and drop support for gdb 8.1 ?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH v2 1/1 package/gdb: bump to version 9.2

Le 05/08/2020 ? 16:26, Thomas Petazzoni a ?crit?:

Quoted 29 lines

Hello Romain,

Quoted 24 lines · On Wed, 5 Aug 2020 16:03:37 +0200 Romain Naour <[email protected]> wrote:

From: Maxim Kochetkov <[email protected]>

The in-tree build restriction has been added after the move of gnulib to top level [1] [2]. This restriction has been added as a workaround a build issue with gdbserver that still use it's own copy of gnulib.

gnulib is configured a second time if we build in-tree gdb and gdbserver:
configure: error: source directory already configured; run "make distclean" there first
configure: error: .././../../gnulib/configure failed for build-gnulib-gdbserver
configure: error: ./configure failed for gdbserver

Use the same pre-configure-hook as gcc package.

Older gdb version support building out of tree even if it's not required.

There is no in-tree build restriction of we only build gdbserver for the target.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=73cc72729a184f00bf6fc4d74684a8516ba6b683
[2] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=043a0010933a6b55081535ecaf7fde9cc1491be0

See:
https://sourceware.org/pipermail/gdb-announce/2020/000122.html
https://sourceware.org/pipermail/gdb-announce/2020/000123.html

Quoted 8 lines
Quoted 5 lines

[Romain:
- add in-tree build support
- improve commit log]

Following this, should we also do our usual dance: switch to gdb 8.3 as the default, and drop support for gdb 8.1 ?

Sure, I need to do those commit first.

Best regards,
Romain

Quoted 3 lines

Thomas

#3 lore raw

PATCH v2 1/1 package/gdb: bump to version 9.2

In reply to Romain Naour

Hello Romain, Maxim,

Quoted 24 lines · On Wed, 5 Aug 2020 16:03:37 +0200 Romain Naour <[email protected]> wrote:

From: Maxim Kochetkov <[email protected]>

The in-tree build restriction has been added after the move of gnulib to top level [1] [2]. This restriction has been added as a workaround a build issue with gdbserver that still use it's own copy of gnulib.

gnulib is configured a second time if we build in-tree gdb and gdbserver:
configure: error: source directory already configured; run "make distclean" there first
configure: error: .././../../gnulib/configure failed for build-gnulib-gdbserver
configure: error: ./configure failed for gdbserver

Use the same pre-configure-hook as gcc package.

Older gdb version support building out of tree even if it's not required.

There is no in-tree build restriction of we only build gdbserver for the target.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=73cc72729a184f00bf6fc4d74684a8516ba6b683
[2] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=043a0010933a6b55081535ecaf7fde9cc1491be0

See:
https://sourceware.org/pipermail/gdb-announce/2020/000122.html
https://sourceware.org/pipermail/gdb-announce/2020/000123.html

Quoted 5 lines

[Romain:
- add in-tree build support
- improve commit log]

I've applied to next, and also changed the default gdb version to 8.3, and dropped support for gdb 8.1.

Quoted 5 lines
 ...e-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch | 55 ++++++++++++++++
 ...-pt_-dsp-regs-uapi_pt_-dsp-regs-on-G.patch | 43 +++++++++++++
 package/gdb/9.2/0003-use-asm-sgidefs.h.patch  | 40 ++++++++++++
 .../0004-gdbserver-fix-build-for-m68k.patch   | 62 +++++++++++++++++++
 ...fork-inferior-include-linux-ptrace.h.patch | 53 ++++++++++++++++

Do you know if there is a chance to get rid of those patches at some point?

Review

Quoted 2 lines
(quoted diff) +2 -0
+# Since gdb 9, in-tree builds for GDB are not allowed anymore,
+# so we create a 'build' subdirectory in the gcc sources, and
                                                ^^^ gdb
Quoted 11 lines
package/gdb/gdb.mk +7 -0
+# build from there.
+define GDB_CONFIGURE_SYMLINK
+	mkdir -p $(@D)/$(GDB_SUBDIR)
+	ln -sf ../configure $(@D)/$(GDB_SUBDIR)/configure
+endef
+GDB_PRE_CONFIGURE_HOOKS += GDB_CONFIGURE_SYMLINK
+
 endif
 
 # For the host variant, we really want to build with XML support,

package/gdb/gdb.mk else · line 265

Quoted 5 lines
package/gdb/gdb.mk +2 -0
@@ -251,6 +261,17 @@ else
 HOST_GDB_CONF_OPTS += --disable-sim
 endif
 
+# Since gdb 9, in-tree builds for GDB are not allowed anymore,
+# so we create a 'build' subdirectory in the gcc sources, and
                                                ^^^ gdb

(I have fixed this when applying).

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com