Re: Defend against -ffast-math in meson builds - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Defend against -ffast-math in meson builds
Date
Msg-id a9d82d5f-58c5-4252-960f-f91cb5bc5a99@eisentraut.org
Whole thread Raw
In response to Re: Defend against -ffast-math in meson builds  (Andres Freund <andres@anarazel.de>)
Responses Re: Defend against -ffast-math in meson builds
Re: Defend against -ffast-math in meson builds
List pgsql-hackers
On 11.03.26 14:43, Andres Freund wrote:
> Hi,
> 
> On 2026-03-11 11:52:28 +0000, Bertrand Drouvot wrote:
>> while working on a patch (not shared yet), I had issues with floating-point and
>> realized that we don't defend against -ffast-math in meson builds. We defend
>> against in autoconf (because we don't want fast-math optimizations [1]), so the
>> attached does the same for meson.
> 
> I don't find this (nor the autoconf check) particularly likely to be
> helpful. The most likely way the flag would unintentionally be added would be
> via the cflags of some dependency - which won't be picked up by the tests.
> 
> However we do have tests during the builds that should pick it up, in date.c
> and timestamp.c...

The existing check in configure is because certain Linux distributions 
used to compile everything with -ffast-math to be "faster", and that 
kept breaking PostgreSQL and so we wanted to stop them very early. 
These are gone, and the defenses in the code like date.c should be 
sufficient for any new attempts.  I think we could remove the check in 
configure.




pgsql-hackers by date:

Previous
From: Ayush Tiwari
Date:
Subject: Re: tid_blockno() and tid_offset() accessor functions
Next
From: shihao zhong
Date:
Subject: Re: Add missing stats_reset column to pg_stat_database_conflicts view