]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Update configure probes for CFLAGS needed for ARM CRC instructions.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 25 Nov 2024 17:50:17 +0000 (12:50 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 25 Nov 2024 17:50:17 +0000 (12:50 -0500)
commite266a0ed67d2fb34c41de11a7cd3f73c66765331
treeb37fb3a4e263fb6474f09051c6d8417b7b05171c
parentf979197eba77fc07c316cdb93436b3ac135222df
Update configure probes for CFLAGS needed for ARM CRC instructions.

On ARM platforms where the baseline CPU target lacks CRC instructions,
we need to supply a -march flag to persuade the compiler to compile
such instructions.  It turns out that our existing choice of
"-march=armv8-a+crc" has not worked for some time, because recent gcc
will interpret that as selecting software floating point, and then
will spit up if the platform requires hard-float ABI, as most do
nowadays.  The end result was to silently fall back to software CRC,
which isn't very desirable since in practice almost all currently
produced ARM chips do have hardware CRC.

We can fix this by using "-march=armv8-a+crc+simd" to enable the
correct ABI choice.  (This has no impact on the code actually
generated, since neither of the files we compile with this flag
does any floating-point stuff, let alone SIMD.)  Keep the test for
"-march=armv8-a+crc" since that's required for soft-float ABI,
but try that second since most platforms we're likely to build on
use hard-float.

Since this isn't working as-intended on the last several years'
worth of gcc releases, back-patch to all supported branches.

Discussion: https://postgr.es/m/4496616.iHFcN1HehY@portable-bastien
configure
configure.ac
meson.build