[PATCH] meson: Adjust check for __int128_t

Richard Henderson posted 1 patch 11 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230523223844.719056-1-richard.henderson@linaro.org
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Thomas Huth <thuth@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
meson.build | 2 --
1 file changed, 2 deletions(-)
[PATCH] meson: Adjust check for __int128_t
Posted by Richard Henderson 11 months, 2 weeks ago
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(-)

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
-- 
2.34.1
Re: [PATCH] meson: Adjust check for __int128_t
Posted by Paolo Bonzini 11 months, 2 weeks ago
Queued, thanks.

Paolo
Re: [PATCH] meson: Adjust check for __int128_t
Posted by Peter Maydell 11 months, 2 weeks ago
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
Re: [PATCH] meson: Adjust check for __int128_t
Posted by Paolo Bonzini 11 months, 2 weeks ago
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
Re: [PATCH] meson: Adjust check for __int128_t
Posted by Peter Maydell 11 months, 2 weeks ago
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
Re: [PATCH] meson: Adjust check for __int128_t
Posted by Paolo Bonzini 11 months, 2 weeks ago
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