Re: AIX support

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Aditya Kamath <Aditya(dot)Kamath1(at)ibm(dot)com>
Cc: Srirama Kucherlapati <sriram(dot)rk(at)in(dot)ibm(dot)com>, "peter(at)eisentraut(dot)org" <peter(at)eisentraut(dot)org>, "andres(at)anarazel(dot)de" <andres(at)anarazel(dot)de>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "hlinnaka(at)iki(dot)fi" <hlinnaka(at)iki(dot)fi>, "tristan(at)partin(dot)io" <tristan(at)partin(dot)io>, "postgres-ibm-aix(at)wwpdl(dot)vnet(dot)ibm(dot)com" <postgres-ibm-aix(at)wwpdl(dot)vnet(dot)ibm(dot)com>
Subject: Re: AIX support
Date: 2026-01-28 15:41:52
Message-ID: CA+TgmoatPGOAfL8Wa3uZ1OGXd34EKOzgm6hXSTa1swS=bbQoag@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 28, 2026 at 10:20 AM Aditya Kamath <Aditya(dot)Kamath1(at)ibm(dot)com> wrote:
> But here is the catch. It won’t pick the AIX system float.h. It will pick the Postgres "src/include/utilsfloat.h”.

PostgreSQL's header should always be included as "utils/float.h" and
the system header should always be included as "float.h" (or, well,
<float.h>, presumably). So this confusion should not exist unless the
include paths are messed up. It doesn't seem correct to me that the
include path includes src/include/utils rather than just src/include,
but I see the same thing here:

"command": "ccache clang
-Isrc/backend/utils/activity/wait_event_names.a.p -Isrc/include/utils
-I../pgsql/src/include/utils -Isrc/include -I../pgsql/src/include
-I/opt/local/include -I/opt/local/include/libxml2
-I/opt/local/libexec/openssl3/include -fdiagnostics-color=always -Wall
-Winvalid-pch -O2 -g -isysroot
/Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk
-fno-strict-aliasing -fwrapv -fexcess-precision=standard
-Wmissing-prototypes -Wpointer-arith -Werror=vla
-Werror=unguarded-availability-new -Wendif-labels
-Wmissing-format-attribute -Wcast-function-type -Wformat-security
-Wdeclaration-after-statement -Wmissing-variable-declarations
-Wno-unused-command-line-argument -Wno-compound-token-split-by-macro
-Wno-format-truncation -Wno-cast-function-type-strict -DBUILDING_DLL
-MD -MQ src/backend/utils/activity/wait_event_names.a.p/wait_event.c.o
-MF src/backend/utils/activity/wait_event_names.a.p/wait_event.c.o.d
-o src/backend/utils/activity/wait_event_names.a.p/wait_event.c.o -c
../pgsql/src/backend/utils/activity/wait_event.c",

which happens because of:

wait_event = static_library('wait_event_names',
waitevent_sources,
dependencies: [backend_code],
include_directories: include_directories('../../../include/utils'),
kwargs: internal_lib_args,
)

which happens because wait_event_funcs.c contains:

#include "wait_event_funcs_data.c"

and for some reason, that file gets placed in src/include/utils.

The attached patch, which also adjusts wait_events.c, fixes it for me.

This is kind of a good example of how you are not pursuing your goals
here in the best way possible. The issue here is legitimate, in the
sense that including src/include/utils in the include path for some
file doesn't seem legit to me. But fixing that problem by defining,
just on AIX, the same symbol that the system header defines seems like
clearly the wrong fix. What if we needed to include the actual float.h
somewhere? What if the problem also occurred on some other platform?
Please put a bit more thought into the right ways to (1) describe the
things you find to us and (2) fix them.

Thanks,

--
Robert Haas
EDB: http://www.enterprisedb.com

Attachment Content-Type Size
dont-include-include-utils.patch application/octet-stream 1.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2026-01-28 15:54:47 Re: AIX support
Previous Message Melanie Plageman 2026-01-28 15:27:45 Re: trivial designated initializers