From 709004563b200a6b9456143de9722d99f4c5054b Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Sun, 15 Aug 2021 18:21:06 +0200 Subject: [PATCH] package/gdb: fix build of gdb on riscv 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 Signed-off-by: Thomas Petazzoni --- 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 56943267bb..142bf1458a 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.2" 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