Re: About gmp and mpfr dependencies for gdb building

Andrew Pinski via Gdb
2025-03-13T20:38:06Z

On Thu, Mar 13, 2025 at 1:31 PM Tom Tromey <tom@tromey.com> wrote:
>
> > For the gmp and mpfr dependency libs, is it possible to provide an
> > option to enable/disable the gmp and mpfr instead of forcely enabling
> > them when building gdb?
>
> Not currently.
>
> You could probably try to implement it. One way might be to replace the
> use of GMP with a custom wide-int implementation; or with (assuming
> IIRC) the slower single-header GMP implementation. Not sure about MPFR.
>
> Probably use of wide-int in gdb is just going to grow due to 128-bit
> ints becoming more common.

Well and BitInt increases the wide-int even further past the 128bit
wide length too.
GCC has its own wide-int implementation which might be useful to pull
into GDB if needed. It is used for BitInt and wide integer too.

MPFR might be hard to replace for floating point types are hard to
emulate exactly.
GCC does have some code to do some but most of the folding (except for
simple things) are handled via MPFR also.

Thanks,
Andrew Pinski

>
> thanks,
> Tom