Meson bug in detection of 64 atomics

Started by Юрий Соколовabout 1 year ago3 messages
#1Юрий Соколов
y.sokolov@postgrespro.ru
1 attachment(s)

Hi.

I found meson fails to detect 64 GCC atomics. Looks like check was drafted but never synced with “configure”.

Patch that syncs meson check to configure’s one attached. It fixes the issue at least on my computer (Mac M1).

——

regards
Yura Sokolov aka funny-falcon

Attachments:

meson-build.diffapplication/octet-stream; name=meson-build.diff; x-unix-mode=0644Download
diff --git a/meson.build b/meson.build
index fdc7b21273..cfd654d291 100644
--- a/meson.build
+++ b/meson.build
@@ -2101,7 +2101,7 @@ __sync_val_compare_and_swap(&val, 0, 37);'''},
   {'name': 'HAVE_GCC__SYNC_INT64_CAS',
    'desc': '__sync_val_compare_and_swap(int64)',
    'test': '''
-INT64 val = 0;
+int64_t val = 0;
 __sync_val_compare_and_swap(&val, 0, 37);'''},
 
   {'name': 'HAVE_GCC__ATOMIC_INT32_CAS',
@@ -2114,13 +2114,14 @@ __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_REL
   {'name': 'HAVE_GCC__ATOMIC_INT64_CAS',
    'desc': ' __atomic_compare_exchange_n(int64)',
    'test': '''
-INT64 val = 0;
-INT64 expect = 0;
+int64_t val = 0;
+int64_t expect = 0;
 __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);'''},
 ]
 
 foreach check : atomic_checks
   test = '''
+#include <stdint.h>
 int main(void)
 {
 @0@
#2Yura Sokolov
y.sokolov@postgrespro.ru
In reply to: Юрий Соколов (#1)
Re: Meson bug in detection of 64 atomics

<div dir="auto">I see: Thomas Munro just missed this place in commit on 2024.12.04&nbsp;<div><pre style="font-style: normal; font-weight: 400; letter-spacing: normal; text-indent: 0px; text-transform: none; word-spacing: 0px; text-decoration: none; white-space: pre-wrap; font-family: monospace; color: rgb(0, 0, 0);">Use &lt;stdint.h&gt; and &lt;inttypes.h&gt; for c.h integers.</pre></div></div><div dir="auto"><div dir="auto"><a href="https://github.com/postgres/postgres/commit/962da900ac8f0927f1af2fd811ca67fa163c873a.patch&quot;&gt;https://github.com/postgres/postgres/commit/962da900ac8f0927f1af2fd811ca67fa163c873a&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Вт, 7 янв. 2025 г. в 01:29, Юрий Соколов &lt;y.sokolov@postgrespro.ru&gt;:<br></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; padding-left: 1ex; border-left-color: rgb(204, 204, 204);">Hi.
<br>
<br>I found meson fails to detect 64 GCC atomics. Looks like check was drafted but never synced with “configure”.
<br>
<br>Patch that syncs meson check to configure’s one attached. It fixes the issue at least on my computer (Mac M1).
<br>
<br>——
<br>
<br>regards
<br>Yura Sokolov aka funny-falcon</blockquote></div></div>

#3Thomas Munro
thomas.munro@gmail.com
In reply to: Yura Sokolov (#2)
Re: Meson bug in detection of 64 atomics

On Wed, Jan 8, 2025 at 2:40 AM Yura Sokolov <y.sokolov@postgrespro.ru> wrote:

I see: Thomas Munro just missed this place in commit on 2024.12.04

Use <stdint.h> and <inttypes.h> for c.h integers.

https://github.com/postgres/postgres/commit/962da900ac8f0927f1af2fd811ca67fa163c873a

Вт, 7 янв. 2025 г. в 01:29, Юрий Соколов <y.sokolov@postgrespro.ru>:

I found meson fails to detect 64 GCC atomics. Looks like check was drafted but never synced with “configure”.

Patch that syncs meson check to configure’s one attached. It fixes the issue at least on my computer (Mac M1).

Oops. Right. Pushed, thanks!