Hello,
I'm trying to run something linked with libldap on a glibc-2.5 system on a glibc-2.3 linux system and the loader compains about not having the right versions of sys_errlist and sys_nerr.
Why does libldap need these symbols?
$ objdump -T libldap-2.3.so.0 | grep sys_ 0000000000000000 DO *UND* 0000000000000004 GLIBC_2.4 sys_nerr 0000000000000000 DO *UND* 0000000000000420 GLIBC_2.4 sys_errlist
From looking at config.log, configure finds strerror just fine.
Is there any way to get rid of these symbols?
Of all the symbols in all the libraries that make up my project these are the only two GLIBC_2.4 or above symbols. If I can get rid of them, my code should run on the glibc-2.3 system.
Mike
On Tue, 29 Apr 2008 13:22:06 -0400 Michael B Allen miallen@ioplex.com wrote:
Hello,
I'm trying to run something linked with libldap on a glibc-2.5 system on a glibc-2.3 linux system and the loader compains about not having the right versions of sys_errlist and sys_nerr.
Why does libldap need these symbols?
$ objdump -T libldap-2.3.so.0 | grep sys_ 0000000000000000 DO *UND* 0000000000000004 GLIBC_2.4 sys_nerr 0000000000000000 DO *UND* 0000000000000420 GLIBC_2.4 sys_errlist
From looking at config.log, configure finds strerror just fine.
Is there any way to get rid of these symbols?
Of all the symbols in all the libraries that make up my project these are the only two GLIBC_2.4 or above symbols. If I can get rid of them, my code should run on the glibc-2.3 system.
I've narrowed it down to the TRACE macro in libraries/libldap/os-ip.c. If I #define TRACE as nothing my code loads ok on the glibc-2.3 system and all is well.
My guess is it looks like sock_errstr is evaluating to STRERROR and somehow that macro is using the offending symbols.
Mike
Michael B Allen writes:
Why does libldap need these symbols?
STRERROR() needs either sys_errlist + sys_nerr or strerror(), and it prefers the former since the latter may not be thread-safe. (Ought to switch to use strerror_r() when someone feels like using time on it, but...)
If you run configure on a system with sys_errlist, it'll use that. To prevent it, run make distclean to get rid of the old build and then (I think)
./configure --<your config params> ol_cv_have_sys_errlist=no
Or distclean and then run configure on a system without the offending symbols.
On Tue, 29 Apr 2008 21:42:30 +0200 Hallvard B Furuseth h.b.furuseth@usit.uio.no wrote:
Michael B Allen writes:
Why does libldap need these symbols?
STRERROR() needs either sys_errlist + sys_nerr or strerror(), and it prefers the former since the latter may not be thread-safe. (Ought to switch to use strerror_r() when someone feels like using time on it, but...)
If you run configure on a system with sys_errlist, it'll use that. To prevent it, run make distclean to get rid of the old build and then (I think)
./configure --<your config params> ol_cv_have_sys_errlist=no
That didn't work. Any other idea as to how to turn off sys_errlist through configure? I know very little about autoconf.
Mike
On Tue, 29 Apr 2008 21:42:30 +0200 Hallvard B Furuseth h.b.furuseth@usit.uio.no wrote:
Michael B Allen writes:
Why does libldap need these symbols?
STRERROR() needs either sys_errlist + sys_nerr or strerror(), and it prefers the former since the latter may not be thread-safe. (Ought to switch to use strerror_r() when someone feels like using time on it, but...)
If you run configure on a system with sys_errlist, it'll use that. To prevent it, run make distclean to get rid of the old build and then (I think)
./configure --<your config params> ol_cv_have_sys_errlist=no
Actually it's ol_cv_dcl_sys_errlist=no but it breaks the compile:
In file included from /usr/include/stdio.h:754, from /usr/include/resolv.h:64, from ../../include/ac/socket.h:56, from util-int.c:32: /usr/include/bits/sys_errlist.h:27: error: expected identifier or '(' before numeric constant /usr/include/bits/sys_errlist.h:28: error: expected identifier or '(' before 'char' /usr/include/bits/sys_errlist.h:28: error: expected ')' before numeric constant make[2]: *** [util-int.lo] Error 1 make[2]: Leaving directory `/var/ioplex/openldap-2.3.39/libraries/libldap' make[1]: *** [all-common] Error 1 make[1]: Leaving directory `/var/ioplex/openldap-2.3.39/libraries' make: *** [all-common] Error 1
I'm just going to disable TRACE in os-ip.c.
Hoping you convert to strerror_r one day ...
Thanks, Mike