[Buildroot] [PATCH 2/5] package/gdb: add support for gdb 11.x

Yann E. MORIN yann.morin.1998 at free.fr
Sun Oct 10 09:10:59 UTC 2021


Thomas, All,

On 2021-10-09 21:16 +0200, Thomas Petazzoni spake thusly:
> From: Michael Fischer <mf at go-sys.de>
> Starting from version 11.x, gdb needs the gmp library.
[--SNIP--]
> diff --git a/package/gdb/Config.in b/package/gdb/Config.in
> index 246748131e..d5ec5406fb 100644
> --- a/package/gdb/Config.in
> +++ b/package/gdb/Config.in
> @@ -54,6 +54,7 @@ config BR2_PACKAGE_GDB_DEBUGGER
>  	depends on BR2_USE_WCHAR
>  	depends on !BR2_sh
>  	depends on !BR2_csky
> +	select BR2_PACKAGE_GMP

This one looks a bit dubious...

If the host gdb is enabled, then the target gdb is the same version as
the host version. So, this configuration:

    BR2_PACKAGE_HOST_GDB=y
    BR2_PACKAGE_GDB=y
    BR2_GDB_VERSION_10=y

will yield a configuration that will force the target gmp, even though
the target gdb will not use it.

Or did I miss something?

I can fix that when applying:

    select BR2_PACKAGE_GMP if BR2_GDB_VERSION_11

The reasoning is that, BR2_GDB_VERSION_11 can only be set when the host
gdb is enabled.

So, if BR2_GDB_VERSION_11 is not set, either:

  - the host gdb is not enabled, in which case the default for the
    target gdb is 9.x (with next patch, 10.x), or

  - the host gdb is enabled, and another version is selected.

Thoughts?

Of course, that will need some refinments when we introduce gdb 12.x (if
it still needs gmp). But for now, introducing either
BR2_PACKAGE_GDB_NEEDS_GMP of BR2_PACKAGE_GDB_11_X_or_later seemed a bit
heavy-handed...

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'


More information about the buildroot mailing list