Re: [PATCH v2 1/2] Introduce "gdb/configure.nat" (and delete "gdb/config/*/*.mh" files)

Pedro Alves
2017-05-17T14:03:27Z

On 05/06/2017 03:04 PM, Sergio Durigan Junior wrote:
> On Friday, May 05 2017, Pedro Alves wrote:
>
>>>>> diff --git a/gdb/config/i386/i386gnu.mh b/gdb/config/i386/i386gnu-extra.mh
>>>>> similarity index 58%
>>>>> rename from gdb/config/i386/i386gnu.mh
>>>>> rename to gdb/config/i386/i386gnu-extra.mh
>>>>
>>>> Why the "extra" rename ? If anything, I'd expect i386gnu.mh -> i386gnu.mn?
>>>
>>> git showed this as a rename, but it's really a new file.
>>
>> That's kind of stretching it. :-)
>
> Well, my intention from the beginning was to introduce this as a new
> file. I'm not stretching it my intention :-).
>
>>> i386gnu.mh is
>>> gone, like every other previous *.mh file. Instead of using the old
>>> name, I decided to add the "-extra" suffix to make it explicit that the
>>> file contains only extra definitions, and is not the only thing taken
>>> into account for this native target.
>>
>> I find the "extra" redundant -- the way I see it, some targets have a
>> makefile fragment file that needs to be glued into the Makefile,
>> others don't. There's no "main fragment, and then maybe some other/extra ones".
>
> OK, I see your rationale now. In my previous understanding, the main
> fragment was being generated from configure.nat, which is just a
> copy-and-paste from the old *.mh files.

And I see yours now.

> But one could also argue that
> there's not actual fragment there, since we just have variables being
> AC_SUBST'ed.

Right, that's not what is usually called a fragment. Note that Makefile
"fragments" are a well known term in the GNU toolchain's build
machinery . See e.g., old GCC docs describing their fragment files:

https://gcc.gnu.org/onlinedocs/gcc-2.95.2/gcc_19.html

>
>>> I initially disagree with your proposal to rename it to i386gnu.mn, so
>>> I'm keeping it this way.
>>
>> Why do you disagree? ".mh" obviously meant "makefile + host",
>> but the fragment file is now described as being about the
>> native target. Hence, "makefile + native => .mn".
>
> Ahhh. You're not going to believe it, but until now I was not linking
> the fact that ".mh" meant "makefile + host". I obviously agree that the
> new extension should be .mn.

:-)

Note this is described in the internal's manual urls I pointed at
before:

https://sourceware.org/gdb/wiki/Internals%20Adding-a-New-Host
https://sourceware.org/gdb/wiki/Internals%20Native-Debugging

"MaintainerÂ’s note: The .mh suffix is because this file originally contained Makefile fragments for hosting GDB on machine xyz. While the file is no longer used for this purpose, the .mh suffix remains. Perhaps someone will eventually rename these fragments so that they have a .mn suffix."

These pages are now in need of an update.

Thanks,
Pedro Alves