From 6af645071b6207cb8a1de82ccf162268516f02b7 Mon Sep 17 00:00:00 2001 From: Ludovico de Nittis <ludovico.denittis@collabora.com> Date: Wed, 18 Mar 2020 11:01:10 +0100 Subject: [PATCH] Bind the host's ldconfig if we already use libc from the host If we are using the host's libc, we also bind its ldconfig otherwise it's likely that the container's ldconfig will not be able to run. Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com> --- src/runtime.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/runtime.c b/src/runtime.c index c02b66e46..907c3361d 100644 --- a/src/runtime.c +++ b/src/runtime.c @@ -1058,6 +1058,7 @@ pv_runtime_use_host_graphics_stack (PvRuntime *self, g_autoptr(GString) vulkan_path = g_string_new (""); gboolean any_architecture_works = FALSE; g_autofree gchar *localedef = NULL; + g_autofree gchar *ldconfig = NULL; g_autofree gchar *dir_on_host = NULL; g_autoptr(SrtSystemInfo) system_info = srt_system_info_new (NULL); g_autoptr(SrtObjectList) egl_icds = NULL; @@ -1533,7 +1534,20 @@ pv_runtime_use_host_graphics_stack (PvRuntime *self, flatpak_bwrap_add_args (bwrap, "--symlink", target, - "/overrides/bin/localedef", + "/overrides/bin/localedef", + NULL); + } + + ldconfig = g_find_program_in_path ("ldconfig"); + + if (ldconfig == NULL) + { + g_warning ("Cannot find ldconfig in PATH"); + } + else + { + flatpak_bwrap_add_args (bwrap, + "--ro-bind", ldconfig, "/sbin/ldconfig", NULL); } } -- GitLab