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.
This commit is contained in:
Demi Marie Obenour 2025-07-23 19:48:00 -04:00 committed by Wim Taymans
parent 2bcc8589fa
commit a09bf57944
2 changed files with 2 additions and 1 deletions

View file

@ -81,6 +81,7 @@ pkgconfig = import('pkgconfig')
common_flags = [ common_flags = [
'-fvisibility=hidden', '-fvisibility=hidden',
'-fno-strict-aliasing', '-fno-strict-aliasing',
'-fno-strict-overflow',
'-Werror=suggest-attribute=format', '-Werror=suggest-attribute=format',
'-Wsign-compare', '-Wsign-compare',
'-Wpointer-arith', '-Wpointer-arith',

View file

@ -32,7 +32,7 @@ pkgconfig.generate(filebase : 'lib@0@'.format(spa_name),
subdirs : spa_name, subdirs : spa_name,
description : 'Simple Plugin API', description : 'Simple Plugin API',
version : spaversion, version : spaversion,
extra_cflags : '-D_REENTRANT', extra_cflags : ['-D_REENTRANT', '-fno-strict-aliasing', '-fno-strict-overflow'],
variables : ['plugindir=${libdir}/@0@'.format(spa_name)], variables : ['plugindir=${libdir}/@0@'.format(spa_name)],
uninstalled_variables : ['plugindir=${prefix}/spa/plugins'], uninstalled_variables : ['plugindir=${prefix}/spa/plugins'],
) )