autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: linking against shared libraries


From: Mike Frysinger
Subject: Re: linking against shared libraries
Date: Mon, 12 Dec 2011 12:25:15 -0500
User-agent: KMail/1.13.7 (Linux/3.1.0-atsc; KDE/4.6.5; x86_64; ; )

On Monday 12 December 2011 04:02:50 Rainer Gerhards wrote:
> On Fri, Dec 9, 2011 at 5:34 PM, Mike Frysinger wrote:
> > On Friday 09 December 2011 06:21:18 Rainer Gerhards wrote:
> >> I am trying to build a program so that it does not refer to shared
> >> libraries by their version-specific name but rather a generic one. My
> >> intent is to use checkinstall to generate packages.
> >> 
> >> As a concrete example, I use some basic openssl functionality that is
> >> available in both newer and older versions of the library (without any
> >> ABI issues). In essence, it does not matter if 0.9.x or 1.0.x is used.
> >> However, after my program is built, the exact version number seems to
> >> be required. So if I build on an older system and move the binary over
> >> to the newer one, the new one complains that 0.9.x is not available
> >> (which is fine with me, because 1.0.x does nicely). And vice versa for
> >> the other direction.
> > 
> > it isn't possible to link against "libssl.so" and have that be recorded.
> >  you have to realize that the differences between them isn't simply
> > naming ... they changed because the binary interfaces between the two
> > versions changed.
> > 
> > the closest you could do is load the library with dlopen(), then use
> > dlsym() to look up specific funcs, and then hope the specific functions
> > you're using didn't actually change between versions.
> 
> Thanks, this explains the problem. So I probably need to think about
> going the dlopen()  way as I know the function has not changed, so
> from my PoV either version is well.

i don't know how portable you need to be, but libtool provides a libltdl 
helper library that hides the cross system issues that arise from libdl.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]