util: Build util/cache_ops_x86.c with -msse2
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

__builtin_ia32_clflush() requires -msse2 so we need to set -msse2 at
least for building that file.  Fortunately, there are no GPUs that
actually need userspace cache flushing that can ever be bolted onto a
pre-SSE2 x86 CPUs.

Fixes: 555881e574 ("util/cache_ops: Add some cache flush helpers")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14134
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37958>
This commit is contained in:
Faith Ekstrand 2025-10-20 09:21:37 -04:00 committed by Marge Bot
parent 3739d7a90c
commit efbecd93ba

View file

@ -188,7 +188,14 @@ libmesa_util_links = []
if host_machine.cpu_family() == 'aarch64' and cc.get_id() != 'msvc'
files_mesa_util += files('cache_ops_aarch64.c')
elif host_machine.cpu_family() in ['x86', 'x86_64'] and cc.get_id() != 'msvc'
files_mesa_util += files('cache_ops_x86.c')
libmesa_util_clflush = static_library(
'mesa_util_clflush',
['cache_ops_x86.c'],
include_directories : [inc_util],
c_args : [no_override_init_args, sse2_args],
gnu_symbol_visibility : 'hidden',
)
libmesa_util_links += [libmesa_util_clflush]
if with_clflushopt
libmesa_util_clflushopt = static_library(
'mesa_util_clflushopt',
@ -197,7 +204,7 @@ elif host_machine.cpu_family() in ['x86', 'x86_64'] and cc.get_id() != 'msvc'
c_args : [no_override_init_args] + clflushopt_args,
gnu_symbol_visibility : 'hidden',
)
libmesa_util_links += libmesa_util_clflushopt
libmesa_util_links += [libmesa_util_clflushopt]
endif
else
files_mesa_util += files('cache_ops_null.c')