From a09bf579443860f0b4a4ddd0810f0a05c892752b Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Wed, 23 Jul 2025 19:48:00 -0400 Subject: [PATCH] meson: Always use -fno-strict-aliasing and -fno-strict-overflow SPA does not respect the C strict aliasing rules at all, so any code that uses it must be built with -fno-strict-aliasing. Furthermore, there is code in SPA that compares pointers that point to different objects, so -fno-strict-overflow is also needed. --- meson.build | 1 + spa/meson.build | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 472b97705..40c1e4d28 100644 --- a/meson.build +++ b/meson.build @@ -81,6 +81,7 @@ pkgconfig = import('pkgconfig') common_flags = [ '-fvisibility=hidden', '-fno-strict-aliasing', + '-fno-strict-overflow', '-Werror=suggest-attribute=format', '-Wsign-compare', '-Wpointer-arith', diff --git a/spa/meson.build b/spa/meson.build index 1137adf60..f8acaec6a 100644 --- a/spa/meson.build +++ b/spa/meson.build @@ -32,7 +32,7 @@ pkgconfig.generate(filebase : 'lib@0@'.format(spa_name), subdirs : spa_name, description : 'Simple Plugin API', version : spaversion, - extra_cflags : '-D_REENTRANT', + extra_cflags : ['-D_REENTRANT', '-fno-strict-aliasing', '-fno-strict-overflow'], variables : ['plugindir=${libdir}/@0@'.format(spa_name)], uninstalled_variables : ['plugindir=${prefix}/spa/plugins'], )