From 423ba5d1c7e2d2958c37ba5b6be6dafe4161b333 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Mon, 6 May 2024 22:25:34 -0700 Subject: [PATCH] meson: disallow Venus debug + LTO build via GCC This is likely a GCC issue per below (always succeed with clang): |with gcc |optimization |-Db_lto=true| |- |- |- | |-Dbuildtype=plain |plain (default)|fail | |-Dbuildtype=debug |0 (default) |fail | |-Dbuildtype=debugoptimized|2 (default) |succeed | |-Dbuildtype=release |3 (default) |succeed | |-Dbuildtype=minsize |s (default) |succeed | |-Dbuildtype=custom |plain |fail | |-Dbuildtype=custom |0 |fail | |-Dbuildtype=custom |g |succeed | |-Dbuildtype=custom |1 |succeed | |-Dbuildtype=custom |2 |succeed | |-Dbuildtype=custom |3 |succeed | |-Dbuildtype=custom |s |succeed | Signed-off-by: Yiwei Zhang Acked-by: David Heidelberg Reviewed-by: Eric Engestrom Part-of: --- meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meson.build b/meson.build index a5419542c10..81d8fdf240e 100644 --- a/meson.build +++ b/meson.build @@ -2265,6 +2265,12 @@ endif # as GCC LTO drops them. See: https://bugs.freedesktop.org/show_bug.cgi?id=109391 gcc_lto_quirk = (cc.get_id() == 'gcc') ? ['-fno-lto'] : [] +# As of GCC 13.2.1, Venus build with optimization level plain/0 and LTO does not +# compile properly: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11006 +if with_virtio_vk and cc.get_id() == 'gcc' and (get_option('optimization') == '0' or get_option('optimization') == 'plain') and get_option('b_lto') == true + error('Venus does not compile properly with GCC + optimization level plain/0 + LTO.') +endif + devenv = environment() dir_compiler_nir = join_paths(meson.current_source_dir(), 'src/compiler/nir/')