Bug 145166
Summary: | Linker search paths dropped | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Josef Spillner <josef> |
Component: | binutils | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED NOTABUG | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 3 | CC: | ivg231 |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i686 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2005-01-15 17:26:24 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Josef Spillner
2005-01-14 21:32:40 UTC
-L/usr/lib/mysql is necessary. /etc/ld.so.conf (and /etc/ld.so.conf.d/*.conf) is used for searching shared libraries (usually lib*.so.*), but that's not what linker is using when you specify -lmysqlclient on the command line. With -lmysqlclient linker is looking for lib*.so files (which are usually symlinks to lib*.so.* files, but not necessarily so and don't need to be in the same directory either). So you need to tell the linker that you want to search there and in which order to search the -L directories. On the other side, when you are linking against some shared library that has say libmysqlclient.so.10 as its dependency (DT_NEEDED dynamic tag), linker will use also /etc/ld.so.conf* to locate that shared library. This is all documented in the ld documentation, see info ld. *** Bug 145301 has been marked as a duplicate of this bug. *** Why is that so? What's the logic of this? The .so links are usually in the same folder as the actual libs, so why can't ld just search those folders like ldconfig does? Also..the man page talks about searching ld.so.conf under the -rpath-link option. Usually is not enough, it would need to be always if ld was to change behaviour. Anyway, we certainly aren't going to diverge from upstream for this documented behaviour, so it is pointless to argue about this here. |