[Buildroot] [PATCH 1/1] package/gdb: fix build of gdb on riscv

Fabrice Fontaine fontaine.fabrice at gmail.com
Fri Aug 13 14:26:26 UTC 2021


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

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

Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
---
 package/gdb/gdb.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/gdb/gdb.mk b/package/gdb/gdb.mk
index 17e10e8b16..152ea16401 100644
--- a/package/gdb/gdb.mk
+++ b/package/gdb/gdb.mk
@@ -29,6 +29,12 @@ GDB_SOURCE = gdb-$(GDB_VERSION).tar.gz
 GDB_FROM_GIT = y
 endif
 
+# recent gdb versions (>= 10) have gdbserver moved at the top-level,
+# which requires a different build logic.
+ifeq ($(BR2_PACKAGE_HOST_GDB):$(BR2_riscv),:y)
+GDB_GDBSERVER_TOPLEVEL = y
+endif
+
 GDB_LICENSE = GPL-2.0+, LGPL-2.0+, GPL-3.0+, LGPL-3.0+
 GDB_LICENSE_FILES = COPYING COPYING.LIB COPYING3 COPYING3.LIB
 GDB_CPE_ID_VENDOR = gnu
-- 
2.30.2



More information about the buildroot mailing list