Module: Mesa Branch: main Commit: be9953ac2ca9ee39bbd93edb468dd7cfaa4824eb URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=be9953ac2ca9ee39bbd93edb468dd7cfaa4824eb
Author: Janne Grunau <[email protected]> Date: Sat Nov 18 12:23:26 2023 +0100 gallium: Avoid empty version scripts in pipe-loader Meson produces version scripts with an empty global node for disabled drivers. This is reported as syntax error by the linker. The root cause of the problem is that the version scripts are accumulated in the out of foreach `pipe_loader_link_args` variable although they should be only used once for their driver specific loader library. Fixes build errors when some of the drivers are disabled like on arm64 which disables i915 due to missing dependencies. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10166 Fixes: 667de678a06 ("gallium: Fix undefined symbols in version scripts") Signed-off-by: Janne Grunau <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26268> --- src/gallium/targets/pipe-loader/meson.build | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gallium/targets/pipe-loader/meson.build b/src/gallium/targets/pipe-loader/meson.build index ee34d79492b..b288c2c73ac 100644 --- a/src/gallium/targets/pipe-loader/meson.build +++ b/src/gallium/targets/pipe-loader/meson.build @@ -80,11 +80,13 @@ foreach x : pipe_loaders pipe_sym = configure_file(input : 'pipe.sym.in', output : 'pipe_@[email protected]'.format(x[1]), configuration : pipe_sym_config) + cur_pipe_loader_link_args = pipe_loader_link_args + cur_pipe_loader_link_deps = pipe_loader_link_deps if with_ld_version_script - pipe_loader_link_args += [ + cur_pipe_loader_link_args += [ '-Wl,--version-script', join_paths(meson.current_build_dir(), 'pipe_@[email protected]'.format(x[1])) ] - pipe_loader_link_deps += pipe_sym + cur_pipe_loader_link_deps += pipe_sym endif if x[0] @@ -94,8 +96,8 @@ foreach x : pipe_loaders c_args : [pipe_loader_comp_args, '-DPIPE_LOADER_DYNAMIC=1'], cpp_args : [pipe_loader_comp_args], gnu_symbol_visibility : 'hidden', - link_args : pipe_loader_link_args, - link_depends : pipe_loader_link_deps, + link_args : cur_pipe_loader_link_args, + link_depends : cur_pipe_loader_link_deps, include_directories : pipe_loader_incs, link_with : [pipe_loader_link_with, x[3]], dependencies : [idep_mesautil, idep_nir, dep_thread, x[2]],
