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 <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30328>
This commit is contained in:
Mike Blumenkrantz
2024-07-23 14:30:09 -04:00
committed by Marge Bot
parent 098e660a58
commit 9b7bb6cc9f
4 changed files with 2 additions and 6 deletions

View File

@@ -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

View File

@@ -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',
)

View File

@@ -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

View File

@@ -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