[Pkg-openldap-devel] Problem building current pkg-openldap trunk (revision 948) on x86-64
Kyle Moffett
mrmacman_g4 at mac.com
Fri Dec 21 21:30:03 UTC 2007
Hi!
I'm currently tinkering with deploying a "cn=config"-using OpenLDAP
system and was trying to get the SVN trunk of the Debian pkg-openldap
tree (openldap 2.4.7) to build on my X86-64 systems. For reference,
the URL is:
svn://svn.debian.org/pkg-openldap/openldap/trunk
http://svn.debian.org/wsvn/pkg-openldap/openldap/trunk
Unfortunately I get the following error towards the end of the compile:
cc -shared .libs/init.o .libs/search.o .libs/close.o .libs/
config.o .libs/bind.o .libs/compare.o .libs/modify.o .libs/
add.o .libs/modrdn.o .libs/delete.o .libs/version.o -L/usr/local/
lib /usr/lib/perl/5.8/auto/DynaLoader/DynaLoader.a -L/usr/lib/perl/
5.8/CORE -lperl -ldl -lm -lpthread -lcrypt -L/home/build/pkg-openldap/
trunk/debian/install/usr/lib -L/usr/lib -lldap_r -llber -Wl,-E -Wl,-
soname -Wl,back_perl-2.4.so.2 -o .libs/back_perl-2.4.so.2.0.3
/usr/bin/ld: /usr/local/lib/libldap_r.a(thr_posix.o): relocation
R_X86_64_32 against `a local symbol' can not be used when making a
shared object; recompile with -fPIC
/usr/local/lib/libldap_r.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
libtool: install: error: relink `back_perl.la' with the above command
before installing it
make[4]: *** [install-mod] Error 1
make[4]: Leaving directory `/home/build/pkg-openldap/trunk/debian/
build/servers/slapd/back-perl'
make[3]: *** [install-slapd] Error 1
make[3]: Leaving directory `/home/build/pkg-openldap/trunk/debian/
build/servers/slapd'
make[2]: *** [install-common] Error 1
make[2]: Leaving directory `/home/build/pkg-openldap/trunk/debian/
build/servers'
make[1]: *** [install-common] Error 1
make[1]: Leaving directory `/home/build/pkg-openldap/trunk/debian/build'
make: *** [install-stamp] Error 2
dpkg-buildpackage: failure: fakeroot debian/rules binary gave error
exit status 2
build at ares:~/pkg-openldap/trunk$
This appears to be caused by a Debian-specific patch to force
libldap_r to link directly against version libpthread symbols, so
that when those symbols change in the future (as they have once
already on Alpha systems) libldap won't break. As far as I can tell,
this patch is also applicable to the upstream OpenLDAP sources for
the same reason. Specifically, the patch is:
--- trunk.orig/libraries/libldap_r/Makefile.in
+++ trunk/libraries/libldap_r/Makefile.in
@@ -56,7 +56,7 @@
XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
XXXLIBS = $(LTHREAD_LIBS)
NT_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS)
-UNIX_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS)
+UNIX_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS) $
(LTHREAD_LIBS)
.links : Makefile
@for i in $(XXSRCS); do \
According to several websites the solution is to build the static
libraries with "-fPIC" on x86-64, however this has performance
implications on other platforms:
http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3
http://bugs.mysql.com/bug.php?id=18091
First I tried adding "--with-pic" to debian/configure.options (passed
to ./configure), but that died in the same place with the same
error. Secondly I attempted to compile using "--disable-static" in
order to force dynamic libraries, however this caused "libslapi.a" to
not be built, which meant that the various overlays and backends did
not compile (they appear to require libslapi.a as opposed to being
optionally dynamically linked).
Any advice or patches (preferably patches) on the subject will be
much appreciated. I'm going to continue attempting to get this to
work, even if it means copying the static libslapi.a to somewhere
safe, rebuilding with --disable-static, and copying it to wherever
the build-system expects it.
Cheers,
Kyle Moffett
More information about the Pkg-openldap-devel
mailing list