Building opendkim / head,
git log | head -n1
commit 3deafe9a2b43a41ae740836b8c689e132424e1ac
Author: Murray S. Kucherawy <msk@trusteddomain.org>
Date: Sat Mar 4 08:50:52 2017 -0800
CONFIG: Add compatibility with openssl-1.1.0. Patch from Scott Kitterman.
commit 70e8914b59c933d38d8539ef60299ddf991e5ef6
Author: Murray S. Kucherawy <msk@trusteddomain.org>
Date: Sat Mar 4 08:46:45 2017 -0800
with
echo $LDFLAGS
-L/usr/local/openssl11/lib64 -Wl,-rpath,/usr/local/openssl11/lib64 -L/usr/local/lmdb/lib64 -Wl,-rpath,/usr/local/lmdb/lib64 -L/usr/local/unbound/lib64 -Wl,-rpath,/usr/local/unbound/lib64 -L/usr/local/lib64 -Wl,-rpath,/usr/local/lib64
echo $CFLAGS
-O3 -Wall -fstack-protector -funwind-tables -fasynchronous-unwind-tables -fmessage-length=0 -grecord-gcc-switches -march=native -mtune=native -I/usr/local/openssl11/include -I/usr/local/lmdb/include -I/usr/local/unbound/include -I/usr/local/include
echo $LIBS
-lssl -lcrypto -llmdb -lunbound -lcurl
echo $CPPFLAGS
-I/usr/local/openssl11/include -I/usr/local/lmdb/include -I/usr/local/unbound/include -I/usr/local/include
config'd
./configure \
--prefix=/usr/local/opendkim \
--enable-shared --disable-static \
--enable-rpath \
--with-openssl=/usr/local/openssl11 \
...
where
pkg-config --libs --cflags openssl
-I/usr/local/openssl11/include -L/usr/local/openssl11/lib64 -lssl -lcrypto
fails at
...
checking for strl.h... no
checking for strl.h in /usr/local/include/strl... checking for strl.h in /usr/local/include... checking for strl.h in /usr/include/strl... checking for struct sockaddr_un.sun_len... no
checking for struct sockaddr_in.sin_len... no
checking for struct sockaddr_in6.sin6_len... no
checking for rrdtool... no
checking for sendmail... /usr/sbin/sendmail
checking for OpenSSL includes... /usr/local/openssl11
checking openssl/bio.h usability... yes
checking openssl/bio.h presence... yes
checking for openssl/bio.h... yes
checking openssl/conf.h usability... yes
checking openssl/conf.h presence... yes
checking for openssl/conf.h... yes
checking openssl/crypto.h usability... yes
checking openssl/crypto.h presence... yes
checking for openssl/crypto.h... yes
checking openssl/err.h usability... yes
checking openssl/err.h presence... yes
checking for openssl/err.h... yes
checking openssl/evp.h usability... yes
checking openssl/evp.h presence... yes
checking for openssl/evp.h... yes
checking openssl/md5.h usability... yes
checking openssl/md5.h presence... yes
checking for openssl/md5.h... yes
checking openssl/opensslv.h usability... yes
checking openssl/opensslv.h presence... yes
checking for openssl/opensslv.h... yes
checking openssl/pem.h usability... yes
checking openssl/pem.h presence... yes
checking for openssl/pem.h... yes
checking openssl/rsa.h usability... yes
checking openssl/rsa.h presence... yes
checking for openssl/rsa.h... yes
checking openssl/sha.h usability... yes
checking openssl/sha.h presence... yes
checking for openssl/sha.h... yes
checking openssl/ssl.h usability... yes
checking openssl/ssl.h presence... yes
checking for openssl/ssl.h... yes
checking for library containing ERR_peek_error... none required
configure: error: Cannot build shared opendkim
against static openssl libraries.
Configure with --disable-shared
to get this working or obtain a
shared libssl library for
opendkim to use.
checking config.log
...
configure:17300: $? = 0
configure:17317: result: none required
configure:17340: /usr/bin/gcc-6 -o conftest -O3 -Wall -fstack-protector -funwind-tables -fasynchronous-unwind-tables -fmessage-length=0 -grecord-gcc-switches -march=native -mtune=native -I/usr/local/openssl11/include -I/usr/local/lmdb/include -I/usr/local/unbound/include -I/usr/local/include -I/usr/local/openssl11/include -I/usr/local/openssl11/include -I/usr/local/lmdb/include -I/usr/local/unbound/include -I/usr/local/include -L/usr/local/openssl11/lib64 -Wl,-rpath,/usr/local/openssl11/lib64 -L/usr/local/lmdb/lib64 -Wl,-rpath,/usr/local/lmdb/lib64 -L/usr/local/unbound/lib64 -Wl,-rpath,/usr/local/unbound/lib64 -L/usr/local/lib64 -Wl,-rpath,/usr/local/lib64 -L/usr/local/openssl11/lib -L/usr/local/openssl11/lib64 -Wl,-rpath,/usr/local/openssl11/lib64 -L/usr/local/lmdb/lib64 -Wl,-rpath,/usr/local/lmdb/lib64 -L/usr/local/unbound/lib64 -Wl,-rpath,/usr/local/unbound/lib64 -L/usr/local/lib64 -Wl,-rpath,/usr/local/lib64 conftest.c -lssl -lcrypto -llmdb -lunbound -lcurl -lssl -lcrypto -lssl -lcrypto -llmdb -lunbound -lcurl -lbsd -lssl -lcrypto -llmdb -lunbound -lcurl >&5
conftest.c: In function 'main':
conftest.c:115:1: warning: implicit declaration of function 'SSL_library_init' [-Wimplicit-function-declaration]
SSL_library_init();
^~~~~~~~~~~~~~~~
/tmp/cctRUvxm.o: In function `main':
!!! conftest.c:(.text.startup+0x7): undefined reference to `SSL_library_init'
collect2: error: ld returned 1 exit status
configure:17340: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "OpenDKIM"
| #define PACKAGE_TARNAME "opendkim"
| #define PACKAGE_VERSION "2.11.0"
| #define PACKAGE_STRING "OpenDKIM 2.11.0"
| #define PACKAGE_BUGREPORT "bugs@opendkim.org"
| #define PACKAGE_URL ""
| #define PACKAGE "opendkim"
| #define VERSION "2.11.0"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define HAVE_PTHREAD_PRIO_INHERIT 1
| #define HAVE_PTHREAD 1
| #define HAVE_INET_PTON 1
| #define HAVE_INET_NTOP 1
| #define HAVE_GETADDRINFO 1
| #define HAVE_GETOPT_LONG 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_NETINET_IN_H 1
| #define HAVE_ARPA_NAMESER_H 1
| #define HAVE_NETDB_H 1
| #define HAVE_RESOLV_H 1
| #define HAVE_USECONDS_T 1
| #define HAVE_ARPA_INET_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_NETDB_H 1
| #define HAVE_NETINET_IN_H 1
| #define HAVE_PATHS_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_SYS_FILE_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_SYSLOG_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_STDINT_H 1
| #define HAVE__BOOL 1
| #define HAVE_STDBOOL_H 1
| #define HAVE_FORK 1
| #define HAVE_VFORK 1
| #define HAVE_WORKING_VFORK 1
| #define HAVE_WORKING_FORK 1
| #define GETGROUPS_T gid_t
| #define HAVE_GETGROUPS 1
| #define HAVE_STDLIB_H 1
| #define HAVE_MALLOC 1
| #define TIME_WITH_SYS_TIME 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_ALARM 1
| #define HAVE_STDLIB_H 1
| #define HAVE_REALLOC 1
| #define HAVE_DUP2 1
| #define HAVE_ENDPWENT 1
| #define HAVE_GETCWD 1
| #define HAVE_GETHOSTNAME 1
| #define HAVE_GETHOSTBYNAME 1
| #define HAVE_GETADDRINFO 1
| #define HAVE_GETHOSTBYNAME2 1
| #define HAVE_GETTIMEOFDAY 1
| #define HAVE_ISASCII 1
| #define HAVE_MEMCHR 1
| #define HAVE_MEMMOVE 1
| #define HAVE_MEMSET 1
| #define HAVE_REGCOMP 1
| #define HAVE_SELECT 1
| #define HAVE_SOCKET 1
| #define HAVE_STRCASECMP 1
| #define HAVE_STRCHR 1
| #define HAVE_STRDUP 1
| #define HAVE_STRERROR 1
| #define HAVE_STRNCASECMP 1
| #define HAVE_STRRCHR 1
| #define HAVE_STRSTR 1
| #define HAVE_STRTOL 1
| #define HAVE_STRTOUL 1
| #define HAVE_STRTOULL 1
| #define HAVE_REALPATH 1
| #define HAVE_STRSEP 1
| #define HAVE_BSD_STRING_H 1
| #define USE_BSD_H 1
| #define _FFR_DIFFHEADERS 1
| #define _FFR_DIFFHEADERS 1
| #define _FFR_STATS 1
| #define _FFR_VBR 1
| #define SENDMAIL_PATH "/usr/sbin/sendmail"
| #define HAVE_OPENSSL_BIO_H 1
| #define HAVE_OPENSSL_CONF_H 1
| #define HAVE_OPENSSL_CRYPTO_H 1
| #define HAVE_OPENSSL_ERR_H 1
| #define HAVE_OPENSSL_EVP_H 1
| #define HAVE_OPENSSL_MD5_H 1
| #define HAVE_OPENSSL_OPENSSLV_H 1
| #define HAVE_OPENSSL_PEM_H 1
| #define HAVE_OPENSSL_RSA_H 1
| #define HAVE_OPENSSL_SHA_H 1
| #define HAVE_OPENSSL_SSL_H 1
| /* end confdefs.h. */
| #include <openssl/ssl.h>
| int
| main ()
| {
| SSL_library_init();
| ;
| return 0;
| }
configure:17351: error: Cannot build shared opendkim
against static openssl libraries.
Configure with --disable-shared
to get this working or obtain a
shared libssl library for
opendkim to use.
...
the undelcared symbol "SSL_library_init", is a openssl v10x remnant
nm /usr/local/openssl10/lib64/lib*so | grep SSL_library_init
0000000000052680 T SSL_library_init
not available in v11x libs
nm /usr/local/openssl11/lib64/lib*so | grep SSL_library_init
(empty)
This response comes a year late, but is this still an issue?
SSL_library_init() was deprecated in OpenSSL 1.1.0, but it's still implemented as a compatibility macro in openssl/ssl.h. Your conftest.c contains
#include <openssl/ssl.h>, so either /usr/local/openssl11/include/openssl/ssl.h doesn't contain the# define SSL_library_init() OPENSSL_init_ssl(0, NULL)compatibility macro, or some other openssl/ssl.h is getting included ...Your first -I option is
-I/usr/local/openssl11/include, and the GCC docs say that will be searched after the current directory; is there any chance there's an openssl/ssl.h in your OpenDKIM base directory?Or! What's the value of OPENSSL_API_COMPAT in openssl/opensslconf.h, and is GCC including the right openssl/opensslconf.h?
Yes.
as openssl is built here without compat
compat macros should NOT be assumed.
nope
nope.
Yes.
I build dozens of other apps against openssl 1.1 libs -- with no such^ issues, as they've been updated to not rely on openssl 10 deprecated libs compat