public inbox for [email protected]  
help / color / mirror / Atom feed
From: Bertrand Drouvot <[email protected]>
Subject: [PATCH v1] Defend against -ffast-math in meson builds
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--





view thread (14+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [PATCH v1] Defend against -ffast-math in meson builds
  In-Reply-To: <no-message-id-723343@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox