This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add --print-dirs option for ldconfig

On Fri, Dec 19, 2008 at 9:47 AM, Ulrich Drepper <> wrote:
> Hash: SHA1
> Dan Nicholson wrote:
>> Build tools often want to determine whether a directory is part of the
>> system linker path or not when deciding to set an RPATH during linking.
>> For glibc based systems, this involves guessing the trusted directories
>> by platform and then parsing out
> It makes no sense to base decisions like RPATHs for linking based on
> this information since it's dynamic.  Thet /etc/ file can
> change and files can be transported to machines with different settings.

I agree that taking the information statically at build time can cause
problems, but how else can you use RPATH effectively? Libtool is
already guessing this information (and not handling multiarch), which
affects a lot of packages. They even have some nasty code to handle
include statements in

# Append contents to the search path
if test -f /etc/; then
    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s
2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0;
}' < /etc/ | $SED -e 's/#.*//;/^[   ]*hwcap[
]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"

Wouldn't it be better to just have glibc tell it where it's going to
look? Even if you take the extra directories in out of the
question, you still have to do ugly platform matching to guess the
trusted directories:

I even think it's a nice little debugging tool for answering the
question: "Is the linker looking where I think it is?"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]