From 17a17c3f89f9858bfa5df1b37c88c319de8d7c1d Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 15 Sep 2025 14:30:30 +0200 Subject: [PATCH] panvk: do not export needless symbols This might be a bit overly careful, but it seems like a good idea to use both mechanisms to avoid accidental symbol leakage. I also don't think it matters much in practice, because all sane applications use the the Vulkan loader, and that shouldn't forward these symbols anyway. While we're at it, let's wire up a test so we notice if this stops working. Acked-by: Boris Brezillon Part-of: --- src/panfrost/vulkan/meson.build | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/panfrost/vulkan/meson.build b/src/panfrost/vulkan/meson.build index 49319e1bfbc..4dbc997ca56 100644 --- a/src/panfrost/vulkan/meson.build +++ b/src/panfrost/vulkan/meson.build @@ -164,6 +164,7 @@ foreach arch : [6, 7, 10, 12, 13] idep_libpan_per_arch[arch.to_string()], ], c_args : [no_override_init_args, panvk_flags, '-DPAN_ARCH=@0@'.format(arch)], + gnu_symbol_visibility : 'hidden', ) endforeach @@ -213,10 +214,24 @@ libvulkan_panfrost = shared_library( idep_mesautil, ], c_args : [no_override_init_args, panvk_flags], - link_args : [ld_args_bsymbolic, ld_args_gc_sections, ld_args_build_id], + link_args : [vulkan_icd_link_args, ld_args_bsymbolic, ld_args_gc_sections, ld_args_build_id], + gnu_symbol_visibility : 'hidden', install : true, ) +if with_symbols_check + test( + 'panvk symbols check', + symbols_check, + args : [ + '--lib', libvulkan_panfrost, + '--symbols-file', vulkan_icd_symbols, + symbols_check_args, + ], + suite : ['panfrost'], + ) +endif + panfrost_icd = custom_target( 'panfrost_icd', input : [vk_icd_gen, vk_api_xml],