1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
Description: make ldconfig use the built-in system paths
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.
Author: Steve Langasek <steve.langasek@linaro.org>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/736932
---
elf/ldconfig.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -62,6 +62,17 @@
#define PATH_MAX 1024
#endif
+/* 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]))
+
static const struct
{
const char *name;
@@ -1361,12 +1372,19 @@
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;
|