[PATCH v2] x86: Remove libopcodes dependency

Jan Beulich jbeulich@suse.com
Wed Nov 30 07:31:45 GMT 2022


On 29.11.2022 20:38, H.J. Lu wrote:
> On Tue, Nov 29, 2022 at 1:22 AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 29.11.2022 00:49, H.J. Lu wrote:
>>> On Thu, Nov 24, 2022 at 2:19 AM Jan Beulich <jbeulich@suse.com> wrote:
>>>> On 22.11.2022 19:19, H.J. Lu wrote:
>>>>> --- a/gas/Makefile.am
>>>>> +++ b/gas/Makefile.am
>>>>> @@ -446,6 +446,12 @@ development.exp: $(BFDDIR)/development.sh
>>>>>       $(EGREP) "(development|experimental)=" $(BFDDIR)/development.sh  \
>>>>>         | $(AWK) -F= '{ print "set " $$1 " " $$2 }' > $@
>>>>>
>>>>> +$(srcdir)/../opcodes/i386-init.h $(srcdir)/../opcodes/i386-tbl.h: \
>>>>> +     @MAINT@ $(srcdir)/../opcodes/i386-opc.tbl \
>>>>> +     $(srcdir)/../opcodes/i386-reg.tbl \
>>>>> +     $(srcdir)/../opcodes/i386-opc.h
>>>>> +     cd ../opcodes; make gen-i386-tbl
>>>>
>>>> I've made a patch to gas/Makefile.am as you have requested in reply to
>>>> my series. I will want to put that through some more testing, so I will
>>>> submit a v3 of that only a little later (and of course only unless you
>>>> submit a v2 of your patch earlier that I would also end up being okay
>>>> with). In the course of doing so I noticed a few more issues with your
>>>> change:
>>>>
>>>> For one I don't think you can put @MAINT@ on a continued line, as the
>>>> line continuation might then be hidden when @MAINT@ expands to #. The
>>>> list of dependencies wants expressing via a variable, which would then
>>>> be used immediately after @MAINT@ without any line continuation
>>>> following.
>>>
>>> Fixed.
>>
>> No, the same problem is still there. You either need to use a very long
>> line, or you need to introduce a variable holding the list of prereqs,
>> like I've done in my series.
> 
> I got
> 
> $(srcdir)/../opcodes/i386-init.h $(srcdir)/../opcodes/i386-tbl.h:

Note the missing line continuation here.

> $(srcdir)/../opcodes/i386-opc.tbl \
>         $(srcdir)/../opcodes/i386-reg.tbl \
>         $(srcdir)/../opcodes/i386-opc.h \
>         $(srcdir)/../opcodes/i386-gen.c
>         $(MAKE) -C ../opcodes gen-i386-tbl

I have no idea what make makes of this standalone list of filenames.
Without the line continuation these wouldn't be dependencies of the
two named generated files.

> and
> 
> $(srcdir)/../opcodes/i386-init.h $(srcdir)/../opcodes/i386-tbl.h: #
> $(srcdir)/../opcodes/i386-opc.tbl \
>         $(srcdir)/../opcodes/i386-reg.tbl \
>         $(srcdir)/../opcodes/i386-opc.h \
>         $(srcdir)/../opcodes/i386-gen.c
>         $(MAKE) -C ../opcodes gen-i386-tbl

Again these aren't dependencies of the two named generated files.

> I didn't run into any problems.

I'm surprised.

>> One further request at least for consideration: In my v3 I've moved
>> the inclusion of opcodes/i386-tbl.h quite a bit further down in
>> tc-i386.c, as I think it's preferable that way (not introducing the
>> static arrays earlier than necessary).
> 
> Does it make any differences?

It is simply more logical to introduce definitions (not just
declarations) not among the ordinary set of #include-s. And it keeps
related things closer together.

Jan


More information about the Binutils mailing list