Bug 170190

Summary: Compilation failded: openldap-2.2.13-3.src.rpm
Product: Red Hat Enterprise Linux 4 Reporter: Vesselin Kolev <vlk>
Component: openldapAssignee: Jan Safranek <jsafrane>
Status: CLOSED CURRENTRELEASE QA Contact: Jay Turner <jturner>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Fixed In Version: openldap-2.2.13-7.src.rpm Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-06-04 11:05:22 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Vesselin Kolev 2005-10-08 12:40:52 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050923 Red Hat/1.0.7-1.4.1 Firefox/1.0.7

Description of problem:
Compilation failed with ouput:

./.libs/libldap.a(os-ip.o)(.text+0x811): In function `ldap_connect_to_host':
../../../libraries/libldap/os-ip.c:191: warning: `sys_errlist' is deprecated; use `strerror' or `strerror_r' instead
./.libs/libldap.a(os-ip.o)(.text+0x803):../../../libraries/libldap/os-ip.c:191: warning: `sys_nerr' is deprecated; use `strerror' or `strerror_r' instead
./.libs/libldap.a(dnssrv.o)(.text+0x563): In function `ldap_domain2hostlist':
../../../libraries/libldap/dnssrv.c:205: undefined reference to `__res_query'
./.libs/libldap.a(dnssrv.o)(.text+0x5a7):../../../libraries/libldap/dnssrv.c:234: undefined reference to `__dn_expand'
./.libs/libldap.a(dnssrv.o)(.text+0x603):../../../libraries/libldap/dnssrv.c:243: undefined reference to `__dn_expand'
./.libs/libldap.a(dnssrv.o)(.text+0x66b):../../../libraries/libldap/dnssrv.c:258: undefined reference to `__dn_expand'
collect2: ld returned 1 exit status
make[2]: *** [dntest] Error 1
make[2]: Leaving directory `/usr/src/redhat/BUILD/openldap-2.2.13/openldap-2.1.30/build-servers/libraries/libldap'
make[1]: *** [all-common] Error 1
make[1]: Leaving directory `/usr/src/redhat/BUILD/openldap-2.2.13/openldap-2.1.30/build-servers/libraries'
make: *** [all-common] Error 1

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. rpmbuild -ba openldap.spec


Additional info:

Comment 1 Vesselin Kolev 2005-10-08 14:41:35 EDT
I solve the problem. 

This is what i've changed in openldap.spec (in diff style):

--- openldap.spec.orig  2005-10-08 21:38:37.000000000 +0300
+++ openldap.spec       2005-10-08 21:38:24.000000000 +0300
@@ -267,7 +267,8 @@

 pushd openldap-%{version_20}/build-db
-LIBS=-lpthread; export LIBS
+LIBS="-lpthread -lresolv"; export LIBS
+#LIBS=-lpthread; export LIBS
 %configure \
        --disable-shared \
        --without-cyrus-sasl \
@@ -351,7 +352,8 @@
 # Build the 2.1 server tools for dumping out old on-disk databases.  This
 # requires Berkeley DB 4.3.x.
 pushd openldap-%{version_21}/build-servers
-LIBS=-lpthread; export LIBS
+LIBS="-lpthread -lresolv"; export LIBS
+#LIBS=-lpthread; export LIBS
 %configure \
        --disable-shared \
        --disable-dynamic \
@@ -370,6 +372,7 @@

 # Build the client libraries for the compat package.
 pushd openldap-%{compat_version}/build-compat
+LIBS="-lpthread -lresolv"; export LIBS
 %configure \
        --disable-slapd --disable-slurpd \
        --with-threads=posix --disable-static --enable-shared --enable-dynamic \
@@ -405,7 +408,7 @@

 # Build the servers with Kerberos support (for password checking, mainly).
-LIBS=-lpthread; export LIBS
+LIBS="-lpthread -lresolv"; export LIBS
 pushd openldap-%{version_22}/build-servers
 build \
        --enable-plugins \
@@ -432,6 +435,7 @@
 # Build clients without Kerberos password-checking support, which is only
 # useful in the server anyway, to avoid stray dependencies.
 pushd openldap-%{version_22}/build-clients
+LIBS="-lpthread -lresolv"; export LIBS
 build \
        --disable-slapd \
        --disable-slurpd \
@@ -446,6 +450,7 @@
 # Build evolution-specific clients just as we would normal clients, except with
 # a different installation directory in mind and no shared libraries.
 pushd evo-openldap-%{version_22}
+LIBS="-lpthread -lresolv"; export LIBS
 build \
        --disable-slapd \
        --disable-slurpd \

The problem is that there is no ld argument -lresolv in the original
openldap.spec file.
Comment 2 Jan Safranek 2007-06-04 11:05:22 EDT
The bug is not reproduceable with current openldap-2.2.13-7.src.rpm