Bug 18506 – pragma(lib, xxx) can cause issues when library is to be found outside OS standard library search path

Status
NEW
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
FreeBSD
Creation time
2018-02-23T14:49:37Z
Last change time
2024-12-13T18:57:18Z
Assigned to
No Owner
Creator
Diederik
See also
https://github.com/dlang/tools/pull/316, https://issues.dlang.org/show_bug.cgi?id=6605
Moved to GitHub: dmd#19396 →

Comments

Comment #0 by dkgroot — 2018-02-23T14:49:37Z
standard/conventional --------------------- On BSD the /usr/local/lib directory is a conventional path to put libraries, it is however not a default path. ie: It is not searched by default when linking binaries. It normally needs to be specified manually (via LDFLAGS) when linking. However It is one of the default search paths when loading dynamic libraties (ie: ld.so) (which is a little strange but it is the way it is). Potential resolution: If you guys think we should re-use the same paths used for dynamic loading, we could parse the ldconfig settings, (via /usr/include/aout-hints.h and /usr/include/elf-hints.h), so that we can add these paths to search for -llibname / pragma(lib) during linking. Note: on bsd ldconfig uses a binary file (ie: /var/run/ld-elf.so.hints), which needs to be read using the headers mentioned above. This method differs from the way linux does work. Note: There is no way to suppress pragma(lib, "xxx") from the commandline (issue/6605), to get around the issue. Links: https://github.com/dlang/tools/pull/316 https://forum.dlang.org/post/[email protected]
Comment #1 by robert.schadek — 2024-12-13T18:57:18Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19396 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB