Subject: Re: kphone and libssl
To: Curt Sampson <cjs@cynic.net>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 04/22/2005 08:14:49
On Fri, 22 Apr 2005, Curt Sampson wrote:

> I notice that BIO_find_type is defined in libcrypto, but -lcrypto is not
> on the command for the compiler below. Is this the problem?

With some old versions of openssl (like libssl.so.2.1 in NetBSD
1.6.2_STABLE) these functions are defined in libdes. And there is not a
defined NEEDED so -ldes appears to be needed.

With newer versions of openssl (like openssl-0.9.6m), they are defined in
libcrypto. But there is a NEEDED for libcrypto, so -lcrypto is not needed.

(I looked using objdump -x.)

I didn't look at NetBSD-2.0_STABLE though.

Can you check to see what was buildlinked?

Look at work/.buildlink/.buildlink_openssl_done

And:

ls -l work/.buildlink/lib/lib{des,crypt,ssl}*

I wonder if for some reason the wrong libssl is being used.

Then try:

objdump -x work/.buildlink/lib/libssl.so | egrep 'RPATH|NEEDED'

Also, if you have an openssl package installed, what version?


> configure:1551: cc -o conftest -O2 -pthread -I/usr/pkg/include -I/usr/pkg/qt3/include -DGLX_GLXEXT_LEGACY -I/usr/include -I/usr/pkg/include/freetype2 -I/usr/pkg/qt3/include -Wall   -I/usr/pkg/include -I/usr/pkg/qt3/include -DGLX_GLXEXT_LEGACY -I/usr/include -I/usr/pkg/include/freetype2  -L/usr/pkg/lib -L/usr/pkg/qt3/lib -Wl,-R/usr/pkg/qt3/lib -Wl,-R/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -pthread -L/usr/X11R6/lib -Wl,-R/usr/X11R6/lib conftest.c -lssl  -lpng -lSM -lICE -lXt -lXext -lX11 -L/usr/pkg/qt3/lib -lqt-mt -lossaudio 1>&5
> /usr/lib/libssl.so: undefined reference to `BIO_find_type'
> /usr/lib/libssl.so: undefined reference to `EVP_enc_null'
> /usr/lib/libssl.so: undefined reference to `EVP_CIPHER_CTX_init'
> /usr/lib/libssl.so: undefined reference to `X509_NAME_dup'
> /usr/lib/libssl.so: undefined reference to `COMP_compress_block'
> /usr/lib/libssl.so: undefined reference to `EVP_rc2_cbc'
> /usr/lib/libssl.so: undefined reference to `sk_new_null'
> /usr/lib/libssl.so: undefined reference to `X509_STORE_get_by_subject'
> /usr/lib/libssl.so: undefined reference to `lh_free'
...


 Jeremy C. Reed

 	  	 	 BSD News, BSD tutorials, BSD links
	  	 	 http://www.bsdnewsletter.com/