All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2,1/1] package/gdb: fix build of gdb on riscv
@ 2021-08-15 16:21 Fabrice Fontaine
  2021-08-19 20:53 ` [Buildroot] [PATCH v2, 1/1] " Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2021-08-15 16:21 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine

Build of gdb on riscv without host-gdb is broken since commit
4ecd247ead22a6cfb87a4ffafc4be05201328aef because BR2_GDB_VERSION_10 is
never defined if BR2_PACKAGE_HOST_GDB is not selected resulting in the
following build failure:

/bin/bash: line 0: cd: /tmp/instance-0/output-1/build/gdb-10.1/gdb/gdbserver: No such file or directory

So add a BR2_PACKAGE_GDB_TOPLEVEL hidden option as suggested by Thomas
Petazzoni.

Fixes:
 - http://autobuild.buildroot.org/results/ce47d616ee79d5f735779570ebc3b4a9c0f64c6a

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v1 -> v2 (after review of Thomas Petazzoni):
 - Add BR2_PACKAGE_GDB_TOPLEVEL

 package/gdb/Config.in.host |  9 +++++++++
 package/gdb/gdb.mk         | 11 +----------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/package/gdb/Config.in.host b/package/gdb/Config.in.host
index 9814f3a79b..0661f50233 100644
--- a/package/gdb/Config.in.host
+++ b/package/gdb/Config.in.host
@@ -93,3 +93,12 @@ config BR2_GDB_VERSION
 	default "9.2"      if BR2_GDB_VERSION_9_2 || (!BR2_PACKAGE_HOST_GDB && !BR2_riscv)
 	default "10.1"	   if BR2_GDB_VERSION_10 || (!BR2_PACKAGE_HOST_GDB && BR2_riscv)
 	depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
+
+# recent gdb versions (>= 10) have gdbserver moved at the top-level,
+# which requires a different build logic.
+config BR2_PACKAGE_GDB_TOPLEVEL
+	bool
+	default y if BR2_arc
+	default y if BR2_GDB_VERSION_10
+	default y if !BR2_PACKAGE_HOST_GDB && BR2_riscv
+	depends on BR2_PACKAGE_GDB || BR2_PACKAGE_HOST_GDB
diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index 17e10e8b16..f9010019f5 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -8,19 +8,10 @@ GDB_VERSION = $(call qstrip,$(BR2_GDB_VERSION))
 GDB_SITE = $(BR2_GNU_MIRROR)/gdb
 GDB_SOURCE = gdb-$(GDB_VERSION).tar.xz
 
-# recent gdb versions (>= 10) have gdbserver moved at the top-level,
-# which requires a different build logic.
-ifeq ($(BR2_GDB_VERSION_10),y)
-GDB_GDBSERVER_TOPLEVEL = y
-endif
-
 ifeq ($(BR2_arc),y)
 GDB_SITE = $(call github,foss-for-synopsys-dwc-arc-processors,binutils-gdb,$(GDB_VERSION))
 GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
 GDB_FROM_GIT = y
-# recent gdb versions (>= 10) have gdbserver moved at the top-level,
-# which requires a different build logic.
-GDB_GDBSERVER_TOPLEVEL = y
 endif
 
 ifeq ($(BR2_csky),y)
@@ -35,7 +26,7 @@ GDB_CPE_ID_VENDOR = gnu
 
 # On gdb < 10, if you want to build only gdbserver, you need to
 # configure only gdb/gdbserver.
-ifeq ($(BR2_PACKAGE_GDB_DEBUGGER)$(GDB_GDBSERVER_TOPLEVEL),)
+ifeq ($(BR2_PACKAGE_GDB_DEBUGGER)$(BR2_PACKAGE_GDB_TOPLEVEL),)
 GDB_SUBDIR = gdb/gdbserver
 
 # When we want to build the full gdb, or for very recent versions of
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH v2, 1/1] package/gdb: fix build of gdb on riscv
  2021-08-15 16:21 [Buildroot] [PATCH v2,1/1] package/gdb: fix build of gdb on riscv Fabrice Fontaine
@ 2021-08-19 20:53 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2021-08-19 20:53 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

On Sun, 15 Aug 2021 18:21:06 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Build of gdb on riscv without host-gdb is broken since commit
> 4ecd247ead22a6cfb87a4ffafc4be05201328aef because BR2_GDB_VERSION_10 is
> never defined if BR2_PACKAGE_HOST_GDB is not selected resulting in the
> following build failure:
> 
> /bin/bash: line 0: cd: /tmp/instance-0/output-1/build/gdb-10.1/gdb/gdbserver: No such file or directory
> 
> So add a BR2_PACKAGE_GDB_TOPLEVEL hidden option as suggested by Thomas
> Petazzoni.
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/ce47d616ee79d5f735779570ebc3b4a9c0f64c6a
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> Changes v1 -> v2 (after review of Thomas Petazzoni):
>  - Add BR2_PACKAGE_GDB_TOPLEVEL

Applied to master, thanks a lot for this new iteration!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-19 20:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-15 16:21 [Buildroot] [PATCH v2,1/1] package/gdb: fix build of gdb on riscv Fabrice Fontaine
2021-08-19 20:53 ` [Buildroot] [PATCH v2, 1/1] " Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.