Orbit - Package Manager - Specification/ideas

Johannes Pfau spam at example.com
Tue Jul 19 03:33:25 PDT 2011


Jacob Carlborg wrote:
>On 2011-07-19 10:16, Johannes Pfau wrote:
>> I'd have to test that, but I doubt it will work. This will help to
>> find the library at compile time, but not at runtime. The runtime
>> linker will only search in directories listed in /etc/ld.so.conf.d
>> or in the LD_LIBRARY_PATH variable. Each .so library has a 'soname'
>> embedded. If you link like in your example command the resulting
>> binary only contains the sonames of the libraries it needs, not the
>> full path. At runtime, the linker then reads that soname and
>> searches in its cache for a library with the same soname. It might
>> be possible to make this soname mechanism use absolute paths or
>> subdirectories, but this seems like a hack. Sonames are usually just
>> "libfoo.so.3" where 3 is a ABI revision. I think we'll eventually
>> have to install shared libraries exactly the way C does it, i.e all
>> in /usr/lib and using the soname versioning. But we can think about
>> that when dmd finally supports shared libraries on linux, it's not
>> important right now.
>>
>
>Oh, at runtime, didn't think of that :). The above command is only for 
>compile time. What about the linker flag "-rpath"? That seems it could 
>be used. Linux is not the only OS, it's easy to add support for
>dynamic libraries on Mac OS X. All code is already in druntime, it
>just needs to be enabled. Tango already supports this.
>

Seems like rpath could indeed work in this case. I can't find much
documentation about it though. Debian recommends not to use it:
http://wiki.debian.org/RpathIssue but I'm not sure if this problem
applies to orbit.

I'd prefer installing shared libraries system wide though. The
soname/version approach is not that bad. Your proposed package
versioning scheme could even be mapped 1:1 to the soname versions. Or
we could use libtools versioning scheme, which is similar, ('major' and
'minor' are one field, 'build' stays the same, and an additional 'age'
field is added)
http://sourceware.org/autobook/autobook/autobook_91.html

Having read more about it, i think I have to correct my previous
statement: It is possible to link to specific versions with the soname
approach. It's maybe a little more limited (You can't say: "I want to
use libfoo.so.1.2.0", You can only say: "I want to use libfoo 1.x.x",
and the linker could end up using 1.1.0, 1.2.0 ...) but it seems this
should be good enough.

-- 
Johannes Pfau



More information about the Digitalmars-d mailing list