Bug 129340 - ld does not search /etc/ld.so.conf.d/* files
Summary: ld does not search /etc/ld.so.conf.d/* files
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: 2
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-08-06 17:36 UTC by Aaron Gaudio
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version: 2.15.92.0.2-2
Clone Of:
Environment:
Last Closed: 2004-10-04 19:57:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Aaron Gaudio 2004-08-06 17:36:08 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Gecko/20040510 Galeon/1.3.14

Description of problem:
According to the ld man page, if no -rpath or -rpath-link options are
given, ld will (after exhausting a few other alternatives) search the
directories listed in /etc/ld.so.conf to find shared libraries that
other shared libraries being linked depend on.

However, in my case, /etc/ld.so.conf contains an 'include' directive
to include the files in /etc/ld.so.conf.d. ld does not appear to
understand this, and thus cannot find libraries under /usr/X11R6/lib
when I have put that directory under a file in /etc/ld.so.conf.d
rather than directly in /etc/ld.so.conf.



Version-Release number of selected component (if applicable):
binutils-2.15.90.0.3-5

How reproducible:
Always

Steps to Reproduce:
 Here is some sample code:

% cat > testgl.c << EOF
char glNewList();
 
int main() {
    glNewList();
    return 0;
}
EOF

% cc -o testgl -lGl -L/usr/X11R6/lib -lX11

Actual Results:  If you don't have /usr/X11R6/lib directly in your
ld.so.conf, this will give you an error because it can't find the
libXext.so and related shared libs that libX11 depends on. 

Expected Results:  ld will read /etc/ld.so.conf, including the files
in /etc/ld.so.conf.d (if there is an "include ld.so.conf.d/*.conf"
line in ld.so.conf). If one of those files includes the /usr/X11R6/lib
directory, the sample code should link without error or warning.

Additional info:

Comment 1 Cameron Davidson 2004-08-26 12:36:29 UTC
There is another aspect to this that I just fell over:
It breaks some configure scripts.

I was building nessus 2.0.12 (gtk2 client in nessus-core) and the
configure script generated a makefile with no X11 libs explicitly defined.
That is, the linking command in the makefile contains -L
/usr/X11R6/lib,  but no -lX11.
If /usr/X11R6/lib is in /etc/ld/so.conf then ld aparrently locates and
includes the X libs through a requirement in the gtk shared libs. (I
did not know it could do this).

On the other hand, if /usr/X11R6/lib is in a file under ld.so.conf.d
then ld cannot find it, and an explicit -lX11 is required on the
linking line. An error about each missing library is issued before all
the unresolved symbols. The -L specified path is not used in this case
but I suppose that ld is meant to behave that way.


Note You need to log in before you can comment on or make changes to this bug.