From patchwork Thu Mar 17 23:09:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Langasek X-Patchwork-Id: 662 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:44:30 -0000 Delivered-To: patches@linaro.org Received: by 10.151.46.5 with SMTP id y5cs54316ybj; Thu, 17 Mar 2011 16:10:03 -0700 (PDT) Received: by 10.142.161.11 with SMTP id j11mr225344wfe.208.1300403402397; Thu, 17 Mar 2011 16:10:02 -0700 (PDT) Received: from becquer.dodds.net (becquer.dodds.net [207.224.24.209]) by mx.google.com with ESMTP id w38si2157748wfh.91.2011.03.17.16.10.01; Thu, 17 Mar 2011 16:10:01 -0700 (PDT) Received-SPF: pass (google.com: domain of vorlon@dodds.net designates 207.224.24.209 as permitted sender) client-ip=207.224.24.209; Authentication-Results: mx.google.com; spf=pass (google.com: domain of vorlon@dodds.net designates 207.224.24.209 as permitted sender) smtp.mail=vorlon@dodds.net Received: from virgil.dodds.net (unknown [192.168.15.11]) by becquer.dodds.net (Postfix) with ESMTPA id AD54D251D9 for ; Thu, 17 Mar 2011 16:09:59 -0700 (PDT) Received: by virgil.dodds.net (Postfix, from userid 1000) id 7E42B40001; Thu, 17 Mar 2011 16:09:56 -0700 (PDT) Resent-From: Steve Langasek Resent-Date: Thu, 17 Mar 2011 16:09:56 -0700 Resent-Message-ID: <20110317230956.GA32240@virgil.dodds.net> Resent-To: patches@linaro.org Date: Thu, 17 Mar 2011 16:09:15 -0700 From: Steve Langasek To: debian-glibc@lists.debian.org Subject: multiarch support: ldconfig needs to look at system paths Message-ID: <20110317230915.GB20460@virgil.dodds.net> Mail-Followup-To: Steve Langasek , debian-glibc@lists.debian.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Hi all, After converting Ubuntu natty to use multiarch paths, I've gotten reports that only the multiarch directories are included in ldconfig's cache. The reason for this is that ldconfig has a different view of the system paths than ld.so itself does. The attached patch remedies this by bringing ldconfig's view into line with that of ld.so. 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 Bug-Ubuntu: https://bugs.launchpad.net/bugs/736932 Index: trunk/elf/ldconfig.c =================================================================== --- trunk.orig/elf/ldconfig.c +++ trunk/elf/ldconfig.c @@ -59,6 +59,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])) + static const struct { const char *name; @@ -1353,12 +1364,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;