On Sun, Feb 25, 2024 at 04:34:47PM +0200, Heikki Linnakangas wrote: > I agree with Andres though, that unless someone raises their hand and > volunteers to properly maintain the AIX support, we should drop it.
There's no way forward in which AIX support stops doing net harm. Even if AIX enthusiasts intercepted would-be buildfarm failures and fixed them before buildfarm.postgresql.org could see them, the damage from the broader community seeing the AIX-specific code would outweigh the benefits of AIX support. I've now disabled the animals for v17+, though each may do one more run before picking up the disable. My upthread observation about xcoff section alignment was a red herring. gcc populates symbol-level alignment, and section-level alignment is unnecessary if symbol-level alignment is correct. The simplest workaround for $SUBJECT AIX failure would be to remove the "const", based on the results of the attached test program. The pg_prewarm.c var is like al4096_static in the outputs below, hence the lack of trouble there. The bulk_write.c var is like al4096_static_const_initialized. ==== gcc 8.3.0 al4096 4096 @ 0x11000c000 (mod 0) al4096_initialized 4096 @ 0x110000fd0 (mod 4048 - BUG) al4096_const 4096 @ 0x11000f000 (mod 0) al4096_const_initialized 4096 @ 0x10000cd00 (mod 3328 - BUG) al4096_static 4096 @ 0x110005000 (mod 0) al4096_static_initialized 4096 @ 0x110008000 (mod 0) al4096_static_const 4096 @ 0x100000c10 (mod 3088 - BUG) al4096_static_const_initialized 4096 @ 0x100003c10 (mod 3088 - BUG) ==== xlc 12.01.0000.0000 al4096 4096 @ 0x110008000 (mod 0) al4096_initialized 4096 @ 0x110004000 (mod 0) al4096_const 4096 @ 0x11000b000 (mod 0) al4096_const_initialized 4096 @ 0x100007000 (mod 0) al4096_static 4096 @ 0x11000e000 (mod 0) al4096_static_initialized 4096 @ 0x110001000 (mod 0) al4096_static_const 4096 @ 0x110011000 (mod 0) al4096_static_const_initialized 4096 @ 0x1000007d0 (mod 2000 - BUG) ==== ibm-clang 17.1.1.2 al4096 4096 @ 0x110001000 (mod 0) al4096_initialized 4096 @ 0x110004000 (mod 0) al4096_const 4096 @ 0x100001000 (mod 0) al4096_const_initialized 4096 @ 0x100005000 (mod 0) al4096_static 4096 @ 0x110008000 (mod 0) al4096_static_initialized 4096 @ 0x11000b000 (mod 0) al4096_static_const 4096 @ 0x100009000 (mod 0) al4096_static_const_initialized 4096 @ 0x10000d000 (mod 0)
#include <stdio.h> #include <stdint.h> /* add a byte so the compiler has to go out of its way to achieve alignment for consecutive instances */ typedef union PGIOAlignedBlock { __attribute__((aligned(4096))) char data[1 + 8192]; double force_align_d; uint64_t force_align_i64; } PGIOAlignedBlock; char pad; /* with and without each of: static, const, initializer */ PGIOAlignedBlock al4096; PGIOAlignedBlock al4096_initialized = {{0}}; const PGIOAlignedBlock al4096_const; const PGIOAlignedBlock al4096_const_initialized = {{0}}; static PGIOAlignedBlock al4096_static; static PGIOAlignedBlock al4096_static_initialized = {{0}}; static const PGIOAlignedBlock al4096_static_const; static const PGIOAlignedBlock al4096_static_const_initialized = {{0}}; /* in case last position is special */ static const PGIOAlignedBlock last; static const PGIOAlignedBlock last_initialized = {{0}}; #define DUMP(want_align, var) dump_internal(#var, (want_align), &(var)) static void dump_internal(const char *ident, unsigned want_align, const void *addr) { unsigned mod = (uintptr_t) addr % want_align; printf("%-32s %4u @ 0x%p (mod %u%s)\n", ident, want_align, addr, mod, mod ? " - BUG" : ""); } int main(int argc, char **argv) { DUMP(4096, al4096); DUMP(4096, al4096_initialized); DUMP(4096, al4096_const); DUMP(4096, al4096_const_initialized); DUMP(4096, al4096_static); DUMP(4096, al4096_static_initialized); DUMP(4096, al4096_static_const); DUMP(4096, al4096_static_const_initialized); return 0; }