[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Always static link in OpenLDAP 2.1?



At 01:07 AM 2002-11-12, Ganesan R wrote:
>>>>>> "Kurt" == Kurt D Zeilenga <Kurt@OpenLDAP.org> writes:
>
>> At 10:02 PM 2002-11-11, Ganesan R wrote:
>>> This effectively makes all executables static. Is this intentional?
>
>> Yes. The executables have always statically linked -lldap -llber.
>
>Hmm, that's already the case _without_ the -static to cc.

No.  Without -static -lldap and -llber, being libtool libraries,
would be dynamically linked in.

>cc -static links all external libraries statically.

  -static           do not do any dynamic linking of libtool libraries
  -all-static       do not do any dynamic linking at all

We use -static, not -all-static.

>I am sure this can't be intentional (and
>this is certainly not the case with OpenLDAP 2.0).

I just check RE20, RE21 and HEAD and see that, as intended,
-lldap and -llber are statically linked in while -lc and other
system libraries (excepting libtool libraries*) are dynamically
linked in.

* If you have libtool libraries installed, then those get
statically linked in as well.  That's likely what you are
seeing below with -lsasl.  That, IMO, is an unfortunate
side-effect.

We could remove this side-effect relatively easily by hack
libtool a bit (or by other means).

>ldapdelete is explicitly passed libldap and liblber statically, so you don't
>need -static.

Incorrect.  Remove the -static, re-make, and then use ldd(1)
to see the linking.

Kurt