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 1vkQfD-00F0ua-0e for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Jan 2026 17:46:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vkQfC-009n7l-0o for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Jan 2026 17:46:10 +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 1vkQfB-009n7d-3B for pgsql-hackers@lists.postgresql.org; Mon, 26 Jan 2026 17:46:10 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vkQf7-00000000Zsu-1pti for pgsql-hackers@lists.postgresql.org; Mon, 26 Jan 2026 17:46:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 60QHjb8f190705; Mon, 26 Jan 2026 12:45:37 -0500 From: Tom Lane To: Peter Eisentraut cc: Srirama Kucherlapati , "pgsql-hackers@lists.postgresql.org" , Heikki Linnakangas , Tristan Partin , AIX PG user Subject: Re: AIX support In-reply-to: References: <61d9ecc8-da4e-487a-9774-838b044cda4d@eisentraut.org> Comments: In-reply-to Peter Eisentraut message dated "Mon, 26 Jan 2026 13:22:04 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <190703.1769449537.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 26 Jan 2026 12:45:37 -0500 Message-ID: <190704.1769449537@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > Ok, that patch set looks pretty reasonable now. > Can you confirm that this is the complete patch set required for AIX = > support? > What version of AIX are you testing with? > What compilers are you testing with? I tried to build HEAD with 0001-Support-for-AIX.pg19.v11.patch on the GCC compile farm (cfarm119.cfarm.net, which is running AIX 7.3); I used gcc 13.3.0. I observed the following problems: * The patch's changes to configure do not match those to configure.ac. I used configure as-patched, so I don't know if it'd work after re-running autoconf. * In my tree, mkldexport.sh was created without execute permissions, causing a build failure. I see that the patch says new file mode 100755 so this is arguably the fault of the rather hoary version of patch(1) that cfarm119 has. I mention it mainly to remind the eventual committer to make sure mkldexport.sh is committed with the correct permissions. * I got this: In file included from ../../../../src/include/postgres.h:48, from pgstat_slru.c:18: pgstat_slru.c:60:11: warning: no previous prototype for 'pgstat_count_slru= _truncate64' [-Wmissing-prototypes] 60 | CppConcat(pgstat_count_slru_,stat)(int slru_idx) \ | ^~~~~~~~~~~~~~~~~~ ../../../../src/include/c.h:429:41: note: in definition of macro 'CppConca= t' 429 | #define CppConcat(x, y) x##y | ^ pgstat_slru.c:84:1: note: in expansion of macro 'PGSTAT_COUNT_SLRU' 84 | PGSTAT_COUNT_SLRU(truncate) | ^~~~~~~~~~~~~~~~~ and then ld: 0711-317 ERROR: Undefined symbol: .pgstat_count_slru_truncate On investigation, this is happening because has #define truncate truncate64 which causes "PGSTAT_COUNT_SLRU(truncate)" to expand as "pgstat_count_slru_truncate64", which is not the name declared in pgstat.h. An even more unfortunate result is that the "truncate" field in PgStat_SLRUStats might actually be named "truncate64", depending on whether was read before pgstat.h. I got around that by partially reverting eccba079c2ea: diff --git a/src/backend/utils/activity/pgstat_slru.c b/src/backend/utils/= activity/pgstat_slru.c index 2190f388eae..4d8ad3f20fc 100644 --- a/src/backend/utils/activity/pgstat_slru.c +++ b/src/backend/utils/activity/pgstat_slru.c @@ -81,7 +81,11 @@ PGSTAT_COUNT_SLRU(blocks_written) PGSTAT_COUNT_SLRU(flush) = /* pgstat_count_slru_truncate */ -PGSTAT_COUNT_SLRU(truncate) +void +pgstat_count_slru_truncate(int slru_idx) +{ + get_slru_entry(slru_idx)->truncate +=3D 1; +} I didn't have to make any other changes, so it seems that we are currently consistent about always reading first, but this seems terribly fragile. We probably need some more-invasive answer, like changing both the function and field name to "trunc" or something like that. * I also got some warnings: auth.c: In function 'auth_peer': auth.c:1877:13: warning: implicit declaration of function 'getpeereid' [-W= implicit-function-declaration] 1877 | if (getpeereid(port->sock, &uid, &gid) !=3D 0) pg_locale_libc.c: In function 'wchar2char': pg_locale_libc.c:1243:26: warning: implicit declaration of function 'wcsto= mbs_l'; did you mean 'wcstombs'? [-Wimplicit-function-declaration] 1243 | result =3D wcstombs_l(to, from, tolen, loc); fe-connect.c: In function 'PQconnectPoll': fe-connect.c:3598:45: warning: implicit declaration of function 'getpeerei= d'; did you mean 'getpwuid'? [-Wimplicit-function-declaration] 3598 | if (getpeereid(conn->sock,= &uid, &gid) !=3D 0) These did not break the build (so the functions do exist...) but they need to be fixed. After all that I was able to get through "make" and "make install", but testing failed immediately: bash-5.3$ initdb exec(): 0509-036 Cannot load program initdb because of the following error= s: 0509-022 Cannot load module /home/tgl/testversion/lib/libpq.a(libp= q.so.5). 0509-150 Dependent module libgcc_s.a(shr.o) could not be loaded. 0509-022 Cannot load module libgcc_s.a(shr.o). 0509-026 System error: A file or directory in the path name does n= ot exist. So there's something wrong with the make rules for using libpq.so. I do not know anything about AIX, so I can't debug this. I was unable to test the meson patches, because meson isn't installed on this machine. I haven't actually read the patch, so don't take this as an endorsement of the changes otherwise. regards, tom lane