Re: [PATCH] Enable GDB build with in-tree GMP and MPFR

Bernd Edlinger
2020-12-01T19:29:26Z

On 11/18/20 9:14 AM, Bernd Edlinger wrote:
> On 11/18/20 4:44 AM, Joel Brobecker wrote:
>>> this enables GDB build with in-tree GMP and MPFR.
>>>
>>> This updated version of my patch added support for in-tree MPFR.
>>>
>>> While there is no preexisting --with-gmp configure option in gdb,
>>> this leaves the current --with-mpfr=yes/no/auto as it is, since it seems
>>> to work by accident. The top level config script thinks "no" is
>>> a DIR, and skips the detection of in-tree MPFR in that case, while
>>> gdb honors --with-mpfr=no, so that is what's expected.
>>>
>>> The in-tree build works only when no --with-mpfr and no
>>> --with-gmp is given. While it does not advertise --with-gmp-prefix=DIR
>>> and/or --with-mpfr-prefix=DIR with "./configure --help", I'll leave that
>>> for another patch.
>>
>> I think we better sort the discrepancy between GCC and GDB
>> if we can, but this is going to take time. From what you were
>> explaining before, I believe you can separate this part of
>> your patch (adding the above to GDB's configury) from the part
>> where you're adding support for in-tree building?
>>
>
>
> 99% of the top-level configury is already there, but it needs
> still a dependency between gdb and (in-tree) gmp / mpfr,
> and pass the options where to find gmp and mpfr to gdb,
> I don't know how to actually resolve the differences ATM.
> If the top-level configure script advertises GDB-style options
> It will at least have to translate them for in-tree MPFR,
> MPC, and ISL.
>
> I believe this change is just the bare minimum and will not
> cause additional incompatibilities with GCC.
>
>
>>> Tested on x86_64-pc-linux-gnu and cross-build for arm.
>>> Is it OK for the trunk?
>>
>> These are changes in areas I am not familiar with, and wouldn't
>> have very much time to look into. I talked to Tom yesterday,
>> and he kindly agreed to take a look.
>>
>>> From 503435680f463cf5ed060ce32b902051cb19e801 Mon Sep 17 00:00:00 2001
>>> From: Bernd Edlinger <bernd.edlinger@hotmail.de>
>>> Date: Sun, 15 Nov 2020 15:37:22 +0100
>>> Subject: [PATCH] Enable GDB build with in-tree GMP and MPFR
>>>
>>> With this patch GDB can be built with in-tree GMP and/or
>>> MPFR. This works also for cross-builds.
>>>
>>> All that is needed, is a sym-link in the source tree,
>>> like this:
>>>
>>> gmp -> ../gmp-6.1.0
>>> mpfr -> ../mpfr-3.1.4
>>>
>>> 2020-11-15 Bernd Edlinger <bernd.edlinger@hotmail.de>
>>>
>>> * Makefile.def: Prepare for GDB build with intree GMP.
>>> * Makefile.in: Regenerate.
>>
>> I got the answer about approval for toplevel tree changes; we're still
>> keeping in sync with GCC. However, Tom said that these kinds of changes
>> are OK to discuss and eventually push locally, before we bring them
>> to GCC next. It's better the other way around, but discussing them
>> here is also an option, because it's a minor change taking advantage
>> of infrastructure that's already in place.
>>
>> In this particular instance, I would indeed _not_ rush discussing
>> with GCC, in case the tie with GDB affects the changes we would need
>> in toplevel.
>>
>
> Yep, agreed.
>

So, can this patch be applied ?

I would really like to be able to build gdb with in-tree gmp / mpfr,
just as it works for gcc.

Thanks
Bernd.