public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Luis Machado <luis.machado@arm.com>
To: Hans-Peter Nilsson <hp@axis.com>, Alan Modra <amodra@gmail.com>
Cc: binutils@sourceware.org, pedro@palves.net
Subject: Re: [PATCH] Don't define ARCH_cris for BFD64
Date: Fri, 6 May 2022 10:09:09 +0100	[thread overview]
Message-ID: <c80ab4e8-dc77-c3c4-7753-6d2ef89636fb@arm.com> (raw)
In-Reply-To: <20220506023524.A006820448@pchp3.se.axis.com>

On 5/6/22 03:35, Hans-Peter Nilsson via Binutils wrote:
>> From: Alan Modra <amodra@gmail.com>
>> Date: Fri, 6 May 2022 02:56:46 +0200
> 
>> As is often the case the truth is more complicated than it would
>> appear on the surface.
> 
> While aiming for the bigger picture is a good thing, you're
> here letting the perfect be the enemy of the good.  A
> reasonable step would be to get all targets want64=true, to
> avoid this annoying host-32/64-bit difference.
> 
>>   I think the cris support works fine with a
>> 32-bit bfd.  It's just that the cris testsuite has expressions
>> that overflow 32 bits.
>>
>> gas/testsuite/gas/cris/shexpr-1.s has this expression:
>>
>>      ((0x17<<23)+((0xfede4194/8192)<<4)+8)
>>
>> It evaluates to 0x0bff6f28 when calculating in 64 bits, but to
>> 0x0b7f6f38 when calculating in 32 bits
> 
> But seeing it as "calculating in 32 bits" is just So Wrong!
> 
> I admit I worked around this missing tracking of
> subexpression signeness and papering over the gas bug by
> just making the problem go away for *this* port.
> 
> Now 20 years down the line, when 64-bit is the norm, IMHO
> that's a preferred solution (while waiting for Someone to
> rewrite the expression bits, but it also happens to get
> host-size-uniform address output).
> 
> brgds, H-P

It does seem like trying to adjust code like this is a bit dangerous and 
may lead to some breakage that is hard to exercise.

 From a "--enable-targets=all" and GDB build's perspective, making these 
targets use a 64-bit BFD and defining disassembler functions 
conditionally according to the presence of a 32-bit BFD or 64-bit BFD 
causes some issues.

I think most of the problem lies in the fact that sim/ wants to build 
everything (all sims, for all targets), regardless of whether we're 
using a 32-bit BFD or 64-bit BFD. And that leads to undesirable build 
breakages for 32-bit builds.

If a disassembler function is not defined properly for GDB, then that 
also leads to internal errors in GDB's testsuite, as the architecture 
will be visible to GDB, and it will cycle through all of the available 
architectures doing multiple checks.

I'd expect at least a clean 32-bit build to go through, and that has 
been my goal so far. And I did notice some files were placed incorrectly 
(ones using 64-bit BFD's in the 32-bit BFD list or the other way 
around). Then again, it seems the current mechanism is to keep 
everything in sync by hand, which is a bit fragile.

  reply	other threads:[~2022-05-06  9:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04  7:56 Luis Machado
2022-05-04  8:08 ` Alan Modra
2022-05-04  8:15   ` Luis Machado
2022-05-04  8:39     ` Alan Modra
2022-05-04 14:37       ` Hans-Peter Nilsson
2022-05-04 22:37         ` Alan Modra
2022-05-05  9:01           ` Luis Machado
2022-05-05 11:11           ` Pedro Alves
2022-05-05 12:56             ` Hans-Peter Nilsson
2022-05-06  0:56             ` Alan Modra
2022-05-06  2:35               ` Hans-Peter Nilsson
2022-05-06  9:09                 ` Luis Machado [this message]
2022-05-06  9:00               ` 32-bit archs, want64=true, and gas integers (Re: [PATCH] Don't define ARCH_cris for BFD64) Pedro Alves
2022-05-06  9:55                 ` 32-bit archs, want64=true, and gas integers Jan Beulich
2022-05-06 10:01                   ` Pedro Alves
2022-05-06 10:17                     ` Jan Beulich
2022-05-06 10:43                       ` Pedro Alves
2022-05-06 11:55                         ` Jan Beulich
2022-05-06 12:04                           ` Pedro Alves
2022-05-06 14:32                         ` Hans-Peter Nilsson
2022-05-06 14:44                           ` Pedro Alves
2022-05-07 20:19                             ` Hans-Peter Nilsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c80ab4e8-dc77-c3c4-7753-6d2ef89636fb@arm.com \
    --to=luis.machado@arm.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=hp@axis.com \
    --cc=pedro@palves.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).