diff mbox series

meson: Adjust check for __int128_t

Message ID 20230523223844.719056-1-richard.henderson@linaro.org
State New
Headers show
Series meson: Adjust check for __int128_t | expand

Commit Message

Richard Henderson May 23, 2023, 10:38 p.m. UTC
Remove the signed * signed check, leaving the signed * unsigned check.
This link test runs foul of -fsanitize=undefined, where clang-11 has
an undefined reference to __muloti4 to check for signed overflow.

This failure prevents us properly detecting atomic128 support.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 meson.build | 2 --
 1 file changed, 2 deletions(-)

Comments

Peter Maydell May 24, 2023, 10:30 a.m. UTC | #1
On Tue, 23 May 2023 at 23:39, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Remove the signed * signed check, leaving the signed * unsigned check.
> This link test runs foul of -fsanitize=undefined, where clang-11 has
> an undefined reference to __muloti4 to check for signed overflow.

If you can't do a signed * signed multiply then that sounds
to me like "int128_t doesn't work on this compiler". We
specifically added this check to catch "some clang with
-fsanitize=undefined don't actually correctly compile
int128_t * int128_t" in commit 464e3671f9.

-- PMM
Paolo Bonzini May 24, 2023, 12:31 p.m. UTC | #2
Queued, thanks.

Paolo
Peter Maydell May 24, 2023, 12:33 p.m. UTC | #3
On Wed, 24 May 2023 at 13:32, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Queued, thanks.

Can you unqueue it, please? This is reverting a fix we
deliberately put in in commit 464e3671f9d5c.

thanks
-- PMM
Paolo Bonzini May 24, 2023, 12:37 p.m. UTC | #4
On 5/24/23 12:30, Peter Maydell wrote:
> On Tue, 23 May 2023 at 23:39, Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>
>> Remove the signed * signed check, leaving the signed * unsigned check.
>> This link test runs foul of -fsanitize=undefined, where clang-11 has
>> an undefined reference to __muloti4 to check for signed overflow.
> 
> If you can't do a signed * signed multiply then that sounds
> to me like "int128_t doesn't work on this compiler". We
> specifically added this check to catch "some clang with
> -fsanitize=undefined don't actually correctly compile
> int128_t * int128_t" in commit 464e3671f9.

Oops, missed this reply before queuing (and will leave the patch aside 
until the discussion is over).

As long as -fsanitize=undefined is properly covered by CI and we don't 
need int128_t * int128_t multiplication, removing the test is ok IMO, 
though perhaps it should have a comment about why it's avoided.

Paolo
Paolo Bonzini May 24, 2023, 12:41 p.m. UTC | #5
On 5/24/23 14:33, Peter Maydell wrote:
> On Wed, 24 May 2023 at 13:32, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> Queued, thanks.
> 
> Can you unqueue it, please? This is reverting a fix we
> deliberately put in in commit 464e3671f9d5c.

Yes, I have done so.

Paolo
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index ef181ff2df..865bdd8d11 100644
--- a/meson.build
+++ b/meson.build
@@ -2542,10 +2542,8 @@  has_int128 = cc.links('''
   int main (void) {
     a = a + b;
     b = a * b;
-    a = a * a;
     return 0;
   }''')
-
 config_host_data.set('CONFIG_INT128', has_int128)
 
 if has_int128