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

Re: how to compile an "all-in-one" binary for ldapsearch ?



Hi,

Thank you for your help, because I am not familar with tools like libtool.
But until now, no success using "make LTFLAGS=-static"
size of ldapsearch binary is always about 181 Ko long.

on http://www.gnu.org/software/libtool/manual.html I've found the
"-all-static" flag

I've tried it, ldapsearch binary is then about 1,2 Mo (same as the
libsasl2.a library)
but I can't run this binary !
bash returns "./ldapsearch cannot execute binary file"
during the "make LTFLAGS=-all-static" step an error message
(see last line on report below) appears about
a problem with  the elf-strtab.c


=============== output extract from make LFTFLAGS=-all-static ==========
  Entering subdirectory clients
make[1]: Entering directory `/usr/local/openldap-2.1.5/clients'
Making all in /usr/local/openldap-2.1.5/clients
  Entering subdirectory tools
make[2]: Entering directory `/usr/local/openldap-2.1.5/clients/tools'
cc -g -O2 -I../../include        -I../../include
-I/usr/local/BerkeleyDB.4.0/include
-I/usr/local/BerkeleyDB.4.0/include  -c -o ldapsearch.o ldapsearch.c
../../build/mkversion -v "2.1.5" ldapsearch > ldsversion.c
cc -g -O2 -I../../include        -I../../include
-I/usr/local/BerkeleyDB.4.0/include
-I/usr/local/BerkeleyDB.4.0/include  -c -o ldsversion.o ldsversion.c
/bin/sh /usr/local/openldap-2.1.5/libtool --mode=link cc -static -g
-O2  -L/usr/local/BerkeleyDB.4.0/lib  -all-static -o ldapsearch
ldapsearch.o ldsversion.o ../../libraries/libldif/libldif.a
../../libraries/liblutil/liblutil.a ../../libraries/libldif/libldif.a
../../libraries/libldap/libldap.la ../../libraries/liblber/liblber.la
-lsasl2  -lssl -lcrypto    -lresolv -ldl
cc -g -O2 -static -o ldapsearch ldapsearch.o ldsversion.o
-L/usr/local/BerkeleyDB.4.0/lib ../../libraries/libldif/libldif.a
../../libraries/liblutil/liblutil.a ../../libraries/libldif/libldif.a
../../libraries/libldap/.libs/libldap.a
/usr/local/openldap-2.1.5/libraries/liblber/.libs/liblber.a -lresolv
-L/usr/local/lib -L/lib/security/lib -lresolv -lresolv
../../libraries/liblber/.libs/liblber.a /usr/local/lib/libsasl2.so
-lresolv -lresolv -lssl -lcrypto -lresolv -ldl -Wl,--rpath
-Wl,/usr/local/lib -Wl,--rpath -Wl,/usr/local/lib
/usr/bin/ld: BFD 2.11.92.0.12 20011121 assertion fail elf-strtab.c:262

=============== output extract from make LFTFLAGS=-all-static ==========

----- Original Message -----
From: "Howard Chu" <hyc@highlandsun.com>
To: "'Jacques Landru'" <landru@enic.fr>; <openldap-software@OpenLDAP.org>
Cc: <cyrus-sasl@lists.andrew.cmu.edu>
Sent: Friday, October 11, 2002 6:01 PM
Subject: RE: how to compile an "all-in-one" binary for ldapsearch ?


> Delete your ldap/clients/tools binaries and remake them with
> make LTFLAGS=-static
> to make libtool ignore any shared libraries and just use static ones.
>
>   -- Howard Chu
>   Chief Architect, Symas Corp.       Director, Highland Sun
>   http://www.symas.com               http://highlandsun.com/hyc
>   Symas: Premier OpenSource Development and Support
>
> -----Original Message-----
> From: owner-openldap-software@OpenLDAP.org
> [mailto:owner-openldap-software@OpenLDAP.org]On Behalf Of Jacques Landru
>
> Hi,
>
> I am trying to build an "all-in-one" binary for ldapsearch tool with all
SASL
> mechanisms embedded in the binary.
>
> Cyrus SASL 2.1.7 has been built with the --with-static-sasl switch, so I
have
> an libsasl2.a (about 1,2 Mo) in /usr/local/lib
>
> But when I try to build openldap with --enable-static, no success to
obtain
> the static ldapsearch binary (about 181 ko).
> When I try to use this ldapsearch tool, no SASL mechanism is avalaible.
>
> I run configure with this parameters :
>
>
>
>
>
./configure --with-cyrus-sasl --enable-spasswd --enable-monitor --enable-sta
t
> ic --disable-shared --disable-slapd --disable-slurpd
>
> In the make step  output it seems that it is always linked with
libsasl2.so
> and not with libsasl2.a. All other libraries are in the ".a" form.
>
> What's wrong or missing in the configure step ?
> is there a way to use a --with-staticsasl switch  like in cyrus-sasl or
> cyrus-imapd building operation ?
>
> Any idea ?
>
> Thanks
>
> Jacques Landru
>
>
>     -----oOo-----
>  Jacques Landru
>    mel:  landru@enic.fr
>    web:  http://www.enic.fr/people/landru
>    tel:  (+33) 3 2033 5556
>    fax:  (+33) 3 2033 5598
>
>  E.N.I.C. Telecom Lille I
>  Cite scientifique, rue G. Marconi
>  59658 VILLENEUVE D'ASCQ  Cedex
>   web: http://www.enic.fr
>   Tel: (+33) 3 2033 5577
>   Fax: (+33) 3 2033 5599
>     -----oOo-----
>
>