Hi there, I have tried compiling OpenSSH 4.3p2 using the following steps: Upgrade OpenSSL tar xvfz openssl-0.9.8a.tar.gz cd openssl-0.9.8a ./config make make install Upgrade zlib tar xvfz zlib-1.2.3.tar.gz ./configure make test make install Upgrade OpenSSH tar xvfz openssh-4.3p2.tar.gz cd openssh-4.3p2.tar.gz ./configure --with-tcp-wrappers --with-ssl-dir=/usr/local/ssl --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc/ssh --with-md5 --with-rand-helper make Unfortunately, the make fails with the following error: gcc -o ssh ssh.o readconf.o clientloop.o sshtty.o sshconnect.o sshconnect1.o sshconnect2.o -L. -Lopenbsd-compat/ -L/usr/local/ssl/lib -lssh -lopenbsd-compat -lresolv -lcrypto -lutil -lz -lnsl -lcrypt /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x38): In function `dlfcn_load': : undefined reference to `dlopen' /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0xa0): In function `dlfcn_load': : undefined reference to `dlclose' /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0xc9): In function `dlfcn_load': : undefined reference to `dlerror' /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x13e): In function `dlfcn_unload': : undefined reference to `dlclose' /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x1f5): In function `dlfcn_bind_var': : undefined reference to `dlsym' /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x241): In function `dlfcn_bind_var': : undefined reference to `dlerror' /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x2d5): In function `dlfcn_bind_func': : undefined reference to `dlsym' /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x321): In function `dlfcn_bind_func': : undefined reference to `dlerror' collect2: ld returned 1 exit status make: *** [ssh] Error 1 Any ideas? It looks like an incompatibility between OpenSSH and OpenSSL. Thanks in advance for any information or suggestions you can provide. -- Colin Dick OCIS Admin
Dan Yefimov
2006-Mar-14 18:42 UTC
Problem compiling openssh-4.3p2 w/ openssl.0.9.8a on FC3
On Tue, 14 Mar 2006, Colin Dick wrote:> Hi there, > I have tried compiling OpenSSH 4.3p2 using the following steps: > > Upgrade OpenSSL > tar xvfz openssl-0.9.8a.tar.gz > cd openssl-0.9.8a > ./config > make > make install > > Upgrade zlib > tar xvfz zlib-1.2.3.tar.gz > ./configure > make test > make install > > Upgrade OpenSSH > tar xvfz openssh-4.3p2.tar.gz > cd openssh-4.3p2.tar.gz > ./configure --with-tcp-wrappers --with-ssl-dir=/usr/local/ssl > --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc/ssh --with-md5 > --with-rand-helper > make > > Unfortunately, the make fails with the following error: > > gcc -o ssh ssh.o readconf.o clientloop.o sshtty.o sshconnect.o > sshconnect1.o sshconnect2.o -L. -Lopenbsd-compat/ -L/usr/local/ssl/lib > -lssh -lopenbsd-compat -lresolv -lcrypto -lutil -lz -lnsl -lcrypt > /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x38): In function > `dlfcn_load': > : undefined reference to `dlopen' > /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0xa0): In function > `dlfcn_load': > : undefined reference to `dlclose' > /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0xc9): In function > `dlfcn_load': > : undefined reference to `dlerror' > /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x13e): In function > `dlfcn_unload': > : undefined reference to `dlclose' > /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x1f5): In function > `dlfcn_bind_var': > : undefined reference to `dlsym' > /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x241): In function > `dlfcn_bind_var': > : undefined reference to `dlerror' > /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x2d5): In function > `dlfcn_bind_func': > : undefined reference to `dlsym' > /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o)(.text+0x321): In function > `dlfcn_bind_func': > : undefined reference to `dlerror' > collect2: ld returned 1 exit status > make: *** [ssh] Error 1 > > Any ideas? It looks like an incompatibility between OpenSSH and > OpenSSL. Thanks in advance for any information or suggestions you can > provide. >It seems you forgot to add -ldl to the list of libraries in the linker command line. All undefined references you meantioned are resolved against that library. -- Sincerely Your, Dan.
Darren Tucker
2006-Mar-14 20:37 UTC
Problem compiling openssh-4.3p2 w/ openssl.0.9.8a on FC3
On Tue, Mar 14, 2006 at 10:29:02AM -0800, Colin Dick wrote:> gcc -o ssh ssh.o readconf.o clientloop.o sshtty.o sshconnect.o[...]> : undefined reference to `dlopen' > Any ideas? It looks like an incompatibility between OpenSSH and > OpenSSL. Thanks in advance for any information or suggestions you can > provide.OpenSSL now seems to need libdl these days. You can add it by doing: ./configure --with-libs=-ldl Perhaps configure should test for this condition, eg the attached? (Anyone trying this will need to run "autoreconf" to rebuild configure then re-run configure). -- Darren Tucker (dtucker at zip.com.au) GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69 Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement. -------------- next part -------------- Index: configure.ac ==================================================================RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/configure.ac,v retrieving revision 1.333 diff -u -p -r1.333 configure.ac --- configure.ac 13 Mar 2006 08:06:51 -0000 1.333 +++ configure.ac 14 Mar 2006 20:33:23 -0000 @@ -1871,6 +1895,36 @@ int main(void) { exit(EVP_aes_192_cbc() ] ) +AC_MSG_CHECKING([if programs using OpenSSL functions will link]) +AC_LINK_IFELSE( + [AC_LANG_SOURCE([[ +#include <openssl/evp.h> +int main(void) { SSLeay_add_all_algorithms(); } + ]])], + [ + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + saved_LIBS="$LIBS" + LIBS="$LIBS -ldl" + AC_MSG_CHECKING([if programs using OpenSSL need -ldl]) + AC_LINK_IFELSE( + [AC_LANG_SOURCE([[ +#include <openssl/evp.h> +int main(void) { SSLeay_add_all_algorithms(); } + ]])], + [ + AC_MSG_RESULT(yes) + ], + [ + AC_MSG_RESULT(no) + LIBS="$saved_LIBS" + ] + ) + ] +) + # Some systems want crypt() from libcrypt, *not* the version in OpenSSL, # because the system crypt() is more featureful. if test "x$check_for_libcrypt_before" = "x1"; then