From 43354b7fbd70acf3ec0e6669336db6eafc637bd8 Mon Sep 17 00:00:00 2001 From: Simon McVittie <smcv@collabora.com> Date: Fri, 6 Aug 2021 16:29:05 +0100 Subject: [PATCH] pv-runtime: Don't rely on ld.so.cache if not using mutable sysroot We still regenerate ld.so.cache to limit the number of code paths, but we can't completely rely on it in this case for the reasons given in the comment. Signed-off-by: Simon McVittie <smcv@collabora.com> --- pressure-vessel/runtime.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pressure-vessel/runtime.c b/pressure-vessel/runtime.c index 78f9e2f98..ab75c2dd1 100644 --- a/pressure-vessel/runtime.c +++ b/pressure-vessel/runtime.c @@ -1885,6 +1885,18 @@ pv_runtime_adverb_regenerate_ld_so_cache (PvRuntime *self, "--add-ld.so-path", ld_path, NULL); + /* If we are not operating from a mutable sysroot, then we do not + * have the opportunity to delete the runtime's version of overridden + * libraries, so ldconfig will see both the provider's version and + * the runtime's version. If the runtime's version has an OS ABI tag + * and the provider's version does not, then ldconfig will prioritize + * the runtime's older version. Work around this by adding the + * provider's version to LD_LIBRARY_PATH *as well as* regenerating + * the ld.so.cache - this will not work for games that incorrectly + * reset the LD_LIBRARY_PATH, but is better than nothing! */ + if (self->mutable_sysroot == NULL) + pv_search_path_append (ldlp_after_regen, ld_path); + pv_search_path_append (ldlp_after_regen, aliases); } -- GitLab