Re: Defend against -ffast-math in meson builds

From: Andres Freund <andres(at)anarazel(dot)de>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Defend against -ffast-math in meson builds
Date: 2026-03-11 18:10:54
Message-ID: vjpqvlolycvkc3k6elcb3wchf7mjg6bn5ek7b352cvsnq77qln@nnjpkw3cykly
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2026-03-11 17:54:33 +0000, Bertrand Drouvot wrote:
> > But maybe we should move the
> > code-level tests out of the datetime files and into utils/float.h
> > or some such place.
>
> But still, I'm not sure the code-level guard is enough for meson. I think we
> need to put a guard in meson.build for the "oddity" described in [1]:

I think you rather need to get to the bottom of that issue.

> it compiles fine with CFLAGS="-ffast-math" CC="gcc" meson setup meson_build but
> produces issues during the regression tests.

This fails to build here as expected.

Are you sure that you actually specified it during meson setup and then didn't
reconfigure while the CFLAGs aren't specified?

> I just had a closer look and it looks like that the reason is that it's being
> added at link time:
>
> $ cat meson_build/build.ninja | grep LINK_ARGS | grep -c "ffast-math"
> 254

It's added to both, compile and link args, afaict?

andres(at)awork3:/tmp/pg-fast-math$ grep ffast-math build.ninja |awk '{print $1}'|sort|uniq -c
1679 ARGS
255 LINK_ARGS

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2026-03-11 18:10:55 Re: Make Intel's ICX compiler working
Previous Message Nathan Bossart 2026-03-11 18:09:21 Re: Speed up COPY FROM text/CSV parsing using SIMD