From efbecd93baa35b4bbeb5f370893865568a577e6e Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 20 Oct 2025 09:21:37 -0400 Subject: [PATCH] util: Build util/cache_ops_x86.c with -msse2 __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: 555881e57499 ("util/cache_ops: Add some cache flush helpers") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14134 Reviewed-by: Mel Henning Part-of: --- src/util/meson.build | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/util/meson.build b/src/util/meson.build index 5c3ac1a9b29..b7994b7e544 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -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')