Bug 307 - configure fails to add -ldl (RedHat specfile)
Summary: configure fails to add -ldl (RedHat specfile)
Status: CLOSED WORKSFORME
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: -current
Hardware: ix86 Linux
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-28 00:26 AEST by Andreas Metzler
Modified: 2004-04-14 12:24 AEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Metzler 2002-06-28 00:26:09 AEST
Hello,
Rebuilding openssh-3.4p1-1.src.rpm on both RedHat 6.2 and RedHat 7.3 fails:

----------------------------------
i386-redhat-linux-gcc -o ssh ssh.o sshconnect.o sshconnect1.o sshconnect2.o sshtty.o readconf.o clientloop.o -L. -Lopenbsd-compat/  -lssh 
-lopenbsd-compat -lutil -lz -lnsl /usr/lib/libcrypto.a
/usr/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
dso_dlfcn.o(.text+0x8a): undefined reference to `dlopen'
dso_dlfcn.o(.text+0xe8): undefined reference to `dlclose'
/usr/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
dso_dlfcn.o(.text+0x18c): undefined reference to `dlclose'
/usr/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
dso_dlfcn.o(.text+0x239): undefined reference to `dlsym'
/usr/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
dso_dlfcn.o(.text+0x309): undefined reference to `dlsym'
collect2: ld returned 1 exit status
make: *** [ssh] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.46927 (%build)
----------------------------------

I do not know why configure does not add -ldl to LD_FLAGS, I _have_ installed glibc-devel, and
-----------------------
ls -l /lib/libdl* /usr/lib/libdl*
-rwxr-xr-x    1 root     root        11728 Jun 18 16:13 /lib/libdl-2.2.5.so
lrwxrwxrwx    1 root     root           14 Jun 27 13:54 /lib/libdl.so.2 -> libdl-2.2.5.so
-rw-r--r--    1 root     root         6820 Jun 18 16:13 /usr/lib/libdl.a
lrwxrwxrwx    1 root     root           20 Jun 27 13:55 /usr/lib/libdl.so -> ../../lib/libdl.so.2
-----------------------

Adding --with-libs=-ldl to the call of configure hotfixes the problem, but imvvvvho ./configure is broken.
                thanks, cu andreas
Comment 1 Jim Knoble 2002-06-28 04:44:53 AEST
'-ldl' is generally not necessary to build OpenSSH unless you're building
against a version of OpenSSL that includes the "engine" for smart cards, etc.
(that is, for example, openssl-engine-0.9.6d instead of openssl-0.9.6d).  If
that's the library you're compiling against, then you need '-ldl' because of
OpenSSL, not because of OpenSSH.  The only way for OpenSSH's ./configure to
detect that OpenSSL needs '-ldl' is for OpenSSL to provide a pkgconfig
<http://www.freedesktop.org/software/pkgconfig/> thingy that explains what
OpenSSL's linktime needs are.  Since openssl(-engine)?-0.9.6d doesn't provide
that, you need to do so manually.  If there's nothing in OpenSSL's documentation
that explains OpenSSL's linktime needs, then please file a bug report with
OpenSSL.
Comment 2 Damien Miller 2002-09-10 22:22:25 AEST
Are you using a non-standard OpenSSL? The RPM compiles fine on 7.3 for me.
Comment 3 Darren Tucker 2003-05-08 22:27:26 AEST
Works for me too (RH8, openssh-3.6.1p2, openssl-0.9.6b-33).

Please re-open if you have more info about the openssl version.
Comment 4 Damien Miller 2004-04-14 12:24:18 AEST
Mass change of RESOLVED bugs to CLOSED