<snip>
>>
>>
> 
> My intention with the suggestion was that the actual library be stored
> in /usr/lib64/liblua52.so (or whatever the appropriate name is), but a
> symlink used for linking be stored in /usr/lib64/lua5.2/liblua.so.  When
> you pass "-L /usr/lib64/lua5.2 -llua" to the compiler, it will find the
> file /usr/lib64/lua5.2/liblua.so and read the DT_SONAME entry in it.
> That will cause the linker to store "liblua52.so" as a DT_NEEDED entry
> in the executable.  At runtime, the runtime linker ld.so
> (/lib64/ld-linux-x86-64.so.2) will read the DT_NEEDED entry, and try to
> find the library liblua52.so, which is in /usr/lib64, so it will be
> found without any ld.so.conf tricks.  This requires no special runtime
> support, as the actual name the compiler/linker will end up storing in
> the output contains the proper version.  This means that if
> /usr/bin/binA linked to liblua51.so (via the linker finding
> /usr/lib64/lua5.1/liblua.so) and /usr/bin/binB linked to liblua52.so
> (likewise), they would both be able to find the correct libraries, as
> the DT_SONAMEs are different.
> 
> Jonathan Callen
> 

Yes, this sounds doable and should work!

Aisha

Reply via email to