Hello,
I am trying to compile OpenLDAP 2.3.39 on my sun box. Below details on my compilation environment :
SunOS 5.8 Generic_117350-49 sun4u sparc SUNW,Sun-Fire-V210 gcc : 3.4.6 binutils : 2.17 make 3.80 autoconf : 2.59 OpenSSL 0.9.8d
I try to get OpenLDAP compiled only for client usage ( binaries, libraries ), statically including GCC object files and OpenSSL libraries because these are not present on any of our Sun servers.
Below, you can find script I developped to compile this version. As you can see I disabled all what concern slapd, slurpd, Berkeley DB and I enabled SSL libraries. This is the way I usely compile my packages on SunOS platform (SQUID, ISC Bind, ...)
PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin LD_LIBRARY_PATH=/usr/local/lib PKG=openldap-2.3.39 PREFIX=/usr/local
export PATH PKG PREFIX LD_LIBRARY_PATH
/usr/bin/env \ CC="/usr/local/bin/cc" \ CXX="/usr/local/bin/c++" \ CFLAGS="-O2 -pipe" \ LDFLAGS="-L/usr/local/ssl/lib/libssl.a -L/usr/local/ssl/lib/libcrypto.a -L/usr/local/ssl/lib -L/usr/local/lib -R/usr/local/lib" \ CPPFLAGS="-I/usr/local/ssl/include -I/usr/local/include" \ AUTOCONF="/usr/local/bin/autoconf" \ AUTOHEADER="/usr/local/bin/autoheader" \ AUTOIFNAMES="/usr/local/bin/ifnames" \ AUTOM4TE="/usr/local/bin/autom4te" \ AUTORECONF="/usr/local/bin/autoreconf" \ AUTOSCAN="/usr/local/bin/autoscan" \ AUTOUPDATE="/usr/local/bin/autoupdate" \ SHELL=/bin/sh \ CONFIG_SHELL=/bin/sh \ ./configure \ --prefix=/usr/local \ --sysconfdir=/etc \ --enable-crypt \ --enable-dynamic \ --with-tls \ --with-threads=posix \ --without-cyrus-sasl \ --disable-debug \ --disable-slapd \ --disable-slurpd \ --disable-monitor \ --disable-bdb \ --disable-hdb \ --disable-relay \ --disable-glue \ --disable-syncprov make depend make make install
Now I get problems with it because binaries always give me 'Killed' message.
# /usr/local/bin/ldapsearch Killed
Concerning libraries, these ones seem to compile but not statically including ssl libraries and/or libgcc, the other ones are okay and can be linked dynamically.
# ldd /usr/local/lib/libldap.so warning: ldd: /usr/local/lib/libldap.so: is not executable libssl.so.0.9.8 => (file not found) libcrypto.so.0.9.8 => (file not found) libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 liblber-2.3.so.0 => /usr/local/openldap/lib/liblber-2.3.so.0 libresolv.so.2 => /lib/libresolv.so.2 libgen.so.1 => /lib/libgen.so.1 libnsl.so.1 => /lib/libnsl.so.1 libsocket.so.1 => /lib/libsocket.so.1 libc.so.1 => /lib/libc.so.1 libdl.so.1 => /lib/libdl.so.1 libmp.so.2 => /lib/libmp.so.2 /usr/platform/SUNW,Sun-Blade-100/lib/libc_psr.so.1
After many times, I tried to link binaries with SunOS built-in linker '/usr/ccs/bin/ld' but always get the same problem.
If you want have a look compilation with /usr/local/bin/ld, click on this link http://ks31203.kimsufi.com/openldap-2.3.39-local_ld.log
If you want have a look at compilation with /usr/ccs/bin/ld (LD="/usr/ccs/bin/ld"), click on this link http://ks31203.kimsufi.com/openldap-2.3.39-ccs_ld.log
So, finally, maybe my problem is something really stupid but I do not find the solution to get my binaries valid with requested libraries statically compiled.
Help is really appreciated in this case. Vincent.
----------------------------------------------------------------- ATTENTION: The information in this electronic mail message is private and confidential, and only intended for the addressee. Should you receive this message by mistake, you are hereby notified that any disclosure, reproduction, distribution or use of this message is strictly prohibited. Please inform the sender by reply transmission and delete the message without copying or opening it.
Messages and attachments are scanned for all viruses known. If this message contains password-protected attachments, the files have NOT been scanned for viruses by the ING mail domain. Always scan attachments before opening them. -----------------------------------------------------------------
vincent.blondel@ing.be wrote:
Hello,
I am trying to compile OpenLDAP 2.3.39 on my sun box. Below details on my compilation environment :
[...]
PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin LD_LIBRARY_PATH=/usr/local/lib PKG=openldap-2.3.39 PREFIX=/usr/local
export PATH PKG PREFIX LD_LIBRARY_PATH
/usr/bin/env \ CC="/usr/local/bin/cc" \ CXX="/usr/local/bin/c++" \ CFLAGS="-O2 -pipe" \ LDFLAGS="-L/usr/local/ssl/lib/libssl.a -L/usr/local/ssl/lib/libcrypto.a -L/usr/local/ssl/lib -L/usr/local/lib -R/usr/local/lib" \
Under LDFLAGS, you include several library directories for use at compile time (-L) but only /usr/local/lib for runtime (-R).
While you have no problems compiling, the ldd output shows that the binaries can't find the appropriate libraries when run (i.e. in runtime).
Add the ssl library path (/usr/local/ssl/lib) as a runtime library path as well and you should be OK.
By the way, if I remember correctly, -L is for directories only, in which case it makes no sense to add libssl.a or libcrypto.a with -L. If the compile process can't identify by itself which libraries it needs, which it should, these should be specified with -l (lowercase L).
For further details, your favourite search engine should be more than helpful as long as you feed it the right keywords.
Hello,
I am trying to compile OpenLDAP 2.3.39 on my sun box. Below details on my compilation environment :
[...]
PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin LD_LIBRARY_PATH=/usr/local/lib PKG=openldap-2.3.39 PREFIX=/usr/local
export PATH PKG PREFIX LD_LIBRARY_PATH
/usr/bin/env \ CC="/usr/local/bin/cc" \ CXX="/usr/local/bin/c++" \ CFLAGS="-O2 -pipe" \ LDFLAGS="-L/usr/local/ssl/lib/libssl.a -L/usr/local/ssl/lib/libcrypto.a -L/usr/local/ssl/lib -L/usr/local/lib -R/usr/local/lib" \
Under LDFLAGS, you include several library directories for use at compile time (-L) but only /usr/local/lib for runtime (-R).
While you have no problems compiling, the ldd output shows that the binaries can't find the appropriate libraries when run (i.e. in runtime).
Add the ssl library path (/usr/local/ssl/lib) as a runtime library path as well and you should be OK.
By the way, if I remember correctly, -L is for directories only, in which case it makes no sense to add libssl.a or libcrypto.a with -L. If the compile process can't identify by itself which libraries it needs, which it should, these should be specified with -l (lowercase L).
okay if we forget 5 minutes ssl part of this compilation, let we simplify the configure script with this
PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin LD_LIBRARY_PATH=/usr/local/lib PKG=openldap-2.3.39 PREFIX=/usr/local export PATH PKG PREFIX LD_LIBRARY_PATH
/usr/bin/env \ CFLAGS="-O2 -pipe" \ CPPFLAGS="-I/usr/local/include" \ LDFLAGS=" -rpath=/usr/lib:/usr/local/lib -L/usr/local/lib" \ SHELL=/bin/sh \ CONFIG_SHELL=/bin/sh \ ./configure \ --prefix=/usr/local \ --sysconfdir=/etc \ --enable-crypt \ --enable-dynamic \ --with-threads=posix \ --without-cyrus-sasl \ --disable-debug \ --disable-slapd \ --disable-slurpd \ --disable-monitor \ --disable-bdb \ --disable-hdb \ --disable-relay \ --disable-glue \ --disable-syncprov
.. and this is what I get
# ldd /usr/local/bin/ldapsearch ldd: /usr/local/bin/ldapsearch: file has insecure interpreterELF
# /usr/local/bin/ldapsearch Killed
# ldd /usr/local/lib/libldap.so liblber-2.3.so.0 => /usr/local/lib/liblber-2.3.so.0 libresolv.so.2 => /lib/libresolv.so.2 libgen.so.1 => /lib/libgen.so.1 libnsl.so.1 => /lib/libnsl.so.1 libsocket.so.1 => /lib/libsocket.so.1 libc.so.1 => /lib/libc.so.1 libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 libdl.so.1 => /lib/libdl.so.1 libmp.so.2 => /lib/libmp.so.2 /usr/platform/SUNW,Sun-Blade-100/lib/libc_psr.so.1
I also tried to modify line 'LD="/usr/ccs/bin/ld"' with 'LD="/usr/ccs/bin/ld -R/usr/local/lib"' in /usr/local/bin/libtool just to test .. always the same result. Finally I tested my compilation environment again by recompiling squid and bind that successfully compile on the same desktop and I do not get any problem.
So there seems to be something specific with OpenLDAP that give bad result. I already tested more than 50 compilation tentatives but I even do not get any idea about the problem.
Please can somebody help me because I really need to compile this package on my system for production matters and I may not get any package as is on the net.
Concerning log files, I moved them so the new place are
http://jlang.dyndns.org/openldap-2.3.39-ccs_ld.log http://jlang.dyndns.org/openldap-2.3.39-local_ld.log http://jlang.dyndns.org/openldap-2.3.39.log
Help is really appreciated.
For further details, your favourite search engine should be more than helpful as long as you feed it the right keywords.
Hello,
Did you try to hide Suns ld?
(mv /usr/ccs/bin/ld /usr/ccs/bin/ld.sun)
I know we had some problem with that.
SunOS 5.8 Generic_117350-49 sun4u sparc SUNW,Sun-Fire-V210 gcc : 3.4.6 binutils : 2.17 make 3.80 autoconf : 2.59 OpenSSL 0.9.8d
Cheers,
Claus
On Thu, Mar 20, 2008 at 3:16 PM, Kick, Claus claus.kick@siemens.com wrote:
Did you try to hide Suns ld? (mv /usr/ccs/bin/ld /usr/ccs/bin/ld.sun)
Also worth considering blastwave : http://www.blastwave.org/
Steph
On Thu, Mar 20, 2008 at 3:16 PM, Kick, Claus claus.kick@siemens.com wrote:
Did you try to hide Suns ld? (mv /usr/ccs/bin/ld /usr/ccs/bin/ld.sun)
Also worth considering blastwave : http://www.blastwave.org/
The blastwave package is what we are running in production, Solaris 10, though.
On Thu, Mar 20, 2008 at 3:16 PM, Kick, Claus claus.kick@siemens.com wrote:
Did you try to hide Suns ld? (mv /usr/ccs/bin/ld /usr/ccs/bin/ld.sun)
Also worth considering blastwave : http://www.blastwave.org/
The blastwave package is what we are running in production, Solaris 10, though.
Just as an aside, the last time somebody asked a question about Blastwave, it had some evidence of horrible breakage. (Hopefully fixed by now.)
Anyway:
I don't see how hiding ld would help. Even if it did help, it's a pretty ugly hack.
First off, if the goal is
So, finally, maybe my problem is something really stupid but I do not find the solution to get my binaries valid with requested libraries statically compiled.
If you want something compiled static, giving --enable-dynamic makes no sense. Perhaps you should try "--disable-dynamic --enable-static"? You probably also want CFLAGS/LDFLAGS set so that you bomb out instantly upon use of shared objects. Probably LDFLAGS+='-Bstatic' and CFLAGS+='-static' (you seem to be using gcc) are a good start. (I wouldn't be surprised at all if you bomb out in configure with that...which means that your issues are in your underlying environment, not the OpenLDAP build.)
Second, the only real error I've seen in this thread is:
ldd: /usr/local/bin/ldapsearch: file has insecure interpreterELF
So check your interpreter, i.e. elfdump -i /usr/local/bin/ldapsearch. If you succeeded in being statically linked, it'd return no output. (Looks like that'll return "ELF." In other words, you're dynamically linking.)
BTW, it's hard to envision a legitimate use case for the situations you've shown so far. If you're just trying to "use openldap" you almost certainly don't want to go through all this convolution to avoid dynamic linking...
openldap-software@openldap.org