From: Steve Langasek Date: Wed, 18 Jun 2025 04:49:31 +0000 (+0200) Subject: make ldconfig use the built-in system paths X-Git-Tag: archive/raspbian/2.41-9+rpi1^2~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=05a26764ebc316e0729d0d19dbcdddc504463e3a;p=glibc.git make ldconfig use the built-in system paths Bug-Ubuntu: https://bugs.launchpad.net/bugs/736932 Make ldconfig use the same view of built-in system paths that ld.so does, instead of just using SLIBDIR and LIBDIR; this corrects a failure of ldconfig to cache libraries in non-multiarch directories when building for multiarch, even though they're on the system path. Gbp-Pq: Topic any Gbp-Pq: Name local-ldconfig-multiarch.diff --- diff --git a/elf/ldconfig.c b/elf/ldconfig.c index 1432187e9..4816d3e2f 100644 --- a/elf/ldconfig.c +++ b/elf/ldconfig.c @@ -56,6 +56,17 @@ #define PACKAGE _libc_intl_domainname +/* Get the generated information about the trusted/standard directories. */ +#include "trusted-dirs.h" + +static const char system_dirs[] = SYSTEM_DIRS; +static const size_t system_dirs_len[] = +{ + SYSTEM_DIRS_LEN +}; +#define nsystem_dirs_len \ + (sizeof (system_dirs_len) / sizeof (system_dirs_len[0])) + /* List of directories to handle. */ struct dir_entry { @@ -1286,12 +1297,19 @@ main (int argc, char **argv) if (!opt_only_cline) { + const char *strp = system_dirs; + size_t idx = 0; + parse_conf (config_file, true); /* Always add the standard search paths. */ - add_system_dir (SLIBDIR); - if (strcmp (SLIBDIR, LIBDIR)) - add_system_dir (LIBDIR); + do + { + add_system_dir (strp); + strp += system_dirs_len[idx] + 1; + idx++; + } + while (idx < nsystem_dirs_len); } const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;