Subject: [PATCH v1] Defend against -ffast-math in meson builds

From: Bertrand Drouvot <[email-masked]>
Date: Wed, 11 Mar 2026 10:53:06 +0000

We'are defending against -ffast-math in autoconf so this commit does the same
for meson builds.
---
 meson.build | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/meson.build b/meson.build
index 2df54409ca6..65344172368 100644
--- a/meson.build
+++ b/meson.build
@@ -2144,6 +2144,13 @@ elif cc.links('''
   cdata.set('HAVE__CPUIDEX', 1)
 endif
 
+# Defend against -ffast-math
+if not cc.compiles('''
+#ifdef __FAST_MATH__
+choke me
+#endif''', name: 'ffast-math check', args: test_c_args)
+  error('do not put -ffast-math in CFLAGS')
+endif
 
 # Defend against clang being used on x86-32 without SSE2 enabled.  As current
 # versions of clang do not understand -fexcess-precision=standard, the use of
-- 
2.34.1

--2VkJiDxXm7NNcRbl--