"so.n" part removed in "external" clause
Original Reporter info from Mantis: mse
-
Reporter name: Martin Schreiber
Original Reporter info from Mantis: mse
- Reporter name: Martin Schreiber
Description:
"so.n" part in "external" clause is removed in library name which makes it impossible to pick up the correct library version in a binding unit.
For example a binding unit made for the version with the SONAME "libX11.so.6",
"
function XLoadQueryFont(para1:PDisplay; para2:Pchar):PXFontStruct;
cdecl; external 'libX11.so.6';
"
inserts
"
INPUT(
-lX11
)
"
in the linker script -> the filename is "libX11.so" which is not available by default and if available it could be a wrong version and therefore puts the wrong SONAME into the binary.
Correctly
"
INPUT(
-l:libX11.so.6
)
"
should be in linker script instead. If you want to keep the erroneous behaviour treat a leading colon as start of a filename as ld does:
"
function XLoadQueryFont(para1:PDisplay; para2:Pchar):PXFontStruct;
cdecl; external ':libX11.so.6';
"
would insert
"
INPUT(
-l:libX11.so.6
)
"
in linker script.
man ld:
"<br/>
-l namespec
--library=namespec
Add the archive or object file specified by namespec to the list of
files to link. This option may be used any number of times. If
namespec is of the form :filename, ld will search the library path
for a file called filename, otherwise it will search the library
path for a file called libnamespec.a.
[...]
"
See also
https://www.mail-archive.com/mseide-msegui-talk%40lists.sourceforge.net/msg11386.html
Mantis conversion info:
- Mantis ID: 32367
- OS: Linux
- Version: 3.0.2
- Monitored by: » mse (Martin Schreiber), » ggeldenhuys (Graeme Geldenhuys), » @fredvs (fredvs)