From 9b7bb6cc9fa410fb783e7a99d9eadcc31668f298 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 23 Jul 2024 14:30:09 -0400 Subject: [PATCH] gallium: install gallium-$version.so to libdir Installing this private library into the default library search path avoids needing to rely on -Wl,-rpath, which is inconsistently implemented as either DT_RUNPATH or DT_RPATH on different distributions; in particular, on distributions that implement it as DT_RPATH, it interferes with use of LD_LIBRARY_PATH and has semantics that are difficult to reason about, and is incompatible with Steam's container runtime (which has the known limitation that it only implements DT_RUNPATH and not DT_RPATH). To avoid third-party developers being tempted to link to the unstable libgallium, give it a name that varies with each Mesa release, so that there is no obvious way for third-party software to link to it. This is similar to the way the proprietary Nvidia driver sets up its similar implementation-detail libraries such as libnvidia-glcore.so.535.183.01. Fixes: 50fc7cc2 ("glx: directly link to gallium") Acked-by: Daniel Stone Part-of: --- src/egl/meson.build | 1 - src/gallium/targets/dri/meson.build | 5 ++--- src/gbm/meson.build | 1 - src/glx/meson.build | 1 - 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/egl/meson.build b/src/egl/meson.build index f590df320cf..68814270b61 100644 --- a/src/egl/meson.build +++ b/src/egl/meson.build @@ -190,7 +190,6 @@ libegl = shared_library( link_args : [ld_args_bsymbolic, ld_args_gc_sections], dependencies : [deps_for_egl, dep_dl, dep_libdrm, dep_clock, dep_thread, idep_mesautil], install : true, - install_rpath : dri_drivers_path, version : egl_lib_version, soversion : egl_lib_soversion, name_prefix : host_machine.system() == 'windows' ? 'lib' : [], # always use lib, but avoid warnings on !windows diff --git a/src/gallium/targets/dri/meson.build b/src/gallium/targets/dri/meson.build index 5b5e4e6837d..c6cc48e503d 100644 --- a/src/gallium/targets/dri/meson.build +++ b/src/gallium/targets/dri/meson.build @@ -7,7 +7,7 @@ # configure.ac) gallium_dri_c_args = [] -gallium_dri_ld_args = [] +gallium_dri_ld_args = [cc.get_supported_link_arguments('-Wl,--default-symver')] gallium_dri_link_depends = [] gallium_dri_drivers = [] @@ -23,7 +23,7 @@ if with_ld_dynamic_list endif libgallium_dri = shared_library( - 'gallium', + 'gallium-@0@'.format(meson.project_version()), files('dri_target.c'), include_directories : [ inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_util, inc_gallium_drivers, @@ -46,6 +46,5 @@ libgallium_dri = shared_library( driver_asahi, driver_crocus ], install : true, - install_dir : dri_drivers_path, name_suffix : 'so', ) diff --git a/src/gbm/meson.build b/src/gbm/meson.build index 3b55208843a..582f18385f0 100644 --- a/src/gbm/meson.build +++ b/src/gbm/meson.build @@ -45,7 +45,6 @@ libgbm = shared_library( gnu_symbol_visibility : 'hidden', version : '1.0.0', install : true, - install_rpath : dri_drivers_path, ) if with_tests diff --git a/src/glx/meson.build b/src/glx/meson.build index 41711a5113a..66dd32d996f 100644 --- a/src/glx/meson.build +++ b/src/glx/meson.build @@ -144,7 +144,6 @@ libgl = shared_library( version : gl_lib_version, darwin_versions : '4.0.0', install : true, - install_rpath : dri_drivers_path, ) if with_tests