Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vT4p4-00COMW-2i for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Dec 2025 21:00:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vT4p2-00704W-30 for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Dec 2025 21:00:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vT4p2-00704O-24 for pgsql-hackers@lists.postgresql.org; Tue, 09 Dec 2025 21:00:36 +0000 Received: from lahtoruutu.iki.fi ([185.185.170.37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vT4p0-0046xg-2q for pgsql-hackers@lists.postgresql.org; Tue, 09 Dec 2025 21:00:36 +0000 Received: from [10.0.2.15] (unknown [130.41.208.2]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4dQrpk01rkz49Q3p; Tue, 09 Dec 2025 23:00:29 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1765314030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q4pFA1VEcy7hPcou1CzDi3sMb1uuwgKdUhkoq3UPpME=; b=j9jTYx5JqNMQ2tYkWByvBTXJF2zApSfpNHx066dL4Ui1a/7wSTzhsKS3I1Q268Xpu7fLI3 dZZSTQuA5T5LlBUlWzbk/DvMEJ10Hfm38J1NhchsaHEJLGNST1A9ECj1Y/KIUaCvrtKCun AEkjhsg15+BPMWVqbU43Xih+zkacZn5wvhdoWrWluYWnKh7Ru3z6RbrAAhxhbItx03jK10 5x+i3OAuu1i2gta+BR4MZnsq8KXJRA+pUjGnjzzaPgNeAWJiwFA6OpE0C0S7PnC8qFj3K4 FgWY4QG6+WLoINtA/SPaVqKkKJbq9YTOOmJUx24/q+LIx6XBGWWS/7pXjsb0Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1765314030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=q4pFA1VEcy7hPcou1CzDi3sMb1uuwgKdUhkoq3UPpME=; b=HRlseqyH5vLnQ2fGBf8ne+db+lCnI//ffKX5EAiJq9x2MhY9efKpWB5DWBhEQiy+ggLt6k W8CcozF7gcp47D64WVlXlzixoKSt9gUr8Nbgz6LcWaQ5WeZNgUKO8oKirLLmDeEL+poO3L CCEUuDxhAn1iEeoOjvdWJKcVfJsXjm7SmyaSrgQztvBkvobdm5gGWaKRz0ayYS0G+Q4Uy3 wTIzriMzu1MBSz1DLN+zC/TaEl3dEd0hxm87ZtnJACca2qIXqWjvbXYlWqbm5vqRJL/k9G pb51Ryh4SXqUvv2GMvVVPUZ18DT3fqvrb1KoyW0+kOkNz5E0u9bZ++W3xziUSA== ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=lahtoruutu; cv=none; t=1765314030; b=JJmiUtPwM6ysX/20yCFSa37NgaUt1KTGPU7IlfLvOH9HWX5ldUPgZ3LwpArQiyPp3vwvdG g6Uqf80x23d+O/9m/+cC3yjIUj9FeNZBGxTX+VIJQtGT7+jJNmx7Jt/dzfdmheBbzJQVq8 9s5ZI3W9rS9c4WIlv4sQc7lwOH1MaIl/deZZ3rh3HAyrpI7fMDk/I6Pvi0iVU2m+0bTC9i 5pa0L31J+jaeOEqNei3L2AeKqsx/P+MGqXSzneG/88fFtXTyot0Gu9NcGoGr3xxFIkQxVV PVlFMScp7+7sda46AqYRu7M7/4UHq6wgUmIJVFkw7n+EvE5P+eF4nsDbG2W4SQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi Message-ID: Date: Tue, 9 Dec 2025 23:00:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: AIX support To: Srirama Kucherlapati , AIX PG user , "pgsql-hackers@lists.postgresql.org" , Peter Eisentraut References: <794e9968-c48f-4ec3-a5f9-a7e8faca8979@eisentraut.org> <176279401378.2081919.12877701948713975661.pgcf@coridan.postgresql.org> Content-Language: en-US From: Heikki Linnakangas In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 09/12/2025 18:50, Srirama Kucherlapati wrote: > @@ -1766,9 +1785,9 @@ endforeach > # any types wider than 64 bits, as allowing MAXIMUM_ALIGNOF to exceed 8 > # would be too much of a penalty for disk and memory space. > alignof_double = cdata.get('ALIGNOF_DOUBLE') > -if cc.alignment('int64_t', args: test_c_args, prefix: '#include ') > alignof_double > - error('alignment of int64_t is greater than the alignment of double') > -endif > +#if cc.alignment('int64_t', args: test_c_args, prefix: '#include ') > alignof_double > +# error('alignment of int64_t is greater than the alignment of double') > +#endif > cdata.set('MAXIMUM_ALIGNOF', alignof_double) > > cdata.set('SIZEOF_LONG', cc.sizeof('long', args: test_c_args)) This is unfinished. > @@ -1820,7 +1839,7 @@ if cc.links(''' > if not meson.is_cross_build() > r = cc.run(''' > /* This must match the corresponding code in c.h: */ > - #if defined(__GNUC__) > + #if defined(__GNUC__) || defined(__IBMC__) > #define pg_attribute_aligned(a) __attribute__((aligned(a))) > #elif defined(_MSC_VER) > #define pg_attribute_aligned(a) __declspec(align(a)) There's a comment right there that it must match the corresponding code in c.h, but you didn't modify c.h. > + # Native memset() is faster, tested on: > + memset_loop_limit = 0 Incomplete sentence: tested on what? We talked about this before. I'm reluctant to have a special case for AIX, because I suspect this has little to do with the operating system, and more with the compiler and the CPU architecture. I could be wrong; maybe the libc memset() implementation on AIX is superior to that on linux, for example. I'd love to see thorough performance testing of MemSetAligned() vs memset() on common combinations of CPUs and libc implementations. Ideally, we can just replace MemSetAligned() with memset() everywhere. If you do such testing, please start a separate thread for that. On this thread, it will get lost with all the AIX-specific stuff. > +/* This change is required for the meson changes as the autoconf is not run and > + * to resolve the conflicts in picking the float.h details by default from the > + * postgres defined datatypes. > + */ > +#ifdef _AIX > +#ifndef PGDLLIMPORT > +#define PGDLLIMPORT > +#endif /* PGDLLIMPORT */ > +typedef float float4; > +typedef double float8; I don't understand these typedefs. What is the conflict the comment talks about? > +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L > +#define pg_noreturn _Noreturn > +#elif defined(__GNUC__) > +#define pg_noreturn __attribute__((noreturn)) > +#else > +#define pg_noreturn > +#endif Isn't this just duplicating the snippet in c.h? > +#include This is in c.h too. > src/include/storage/s_lock.h > [ switches to __sync_lock_release(lock) on all powerpc systems ] We talked about this before. > @@ -18,7 +18,8 @@ GetOptions( > > if (not( $format eq 'darwin' > or $format eq 'gnu' > - or $format eq 'win')) > + or $format eq 'win' > + or $format eq 'aix')) > { > die "$0: $format is not yet handled (only darwin, gnu, win are)\n"; > } Forgot to update the error message. I didn't review the autoconf / Makefile changes. > Apologies for the delayed response; I was occupied with other tasks. Oh no worries, I'm not in any hurry with this. On the contrary to be honest. - Heikki