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

Thomas Petazzoni thomas.petazzoni at bootlin.com
Sun Aug 15 15:57:43 UTC 2021


On Fri, 13 Aug 2021 16:26:26 +0200
Fabrice Fontaine <fontaine.fabrice at gmail.com> wrote:

> +# 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


While I understand the idea, I'm not entirely sure it's the most
logical way. What about instead changing the current:

ifeq ($(BR2_GDB_VERSION_10),y)
GDB_GDBSERVER_TOPLEVEL = y
endif

by:

ifeq ($(GDB_VERSION_10),10.1)
GDB_GDBSERVER_TOPLEVEL = y
endif

This way, it really expresses what we want: gdb version 10.x require a
different build logic.

Alternatively, we could do a hidden Config.in boolean:

config BR2_PACKAGE_GDB_TOPLEVEL
	bool
	default y if BR2_GDB_VERSION_10
	default y if !BR2_PACKAGE_HOST_GDB && BR2_riscv

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the buildroot mailing list