Menu

#51 Build failure against OpenSSL 1.1.1c on macOS

1.3.1
fixed
None
1.3.2
5
2019-09-10
2019-09-06
FX
No

Hi,

Building isync 1.3.1 against OpenSSL 1.1.1c and berkeley-db 18.1.32 on macOS fails to link with many undefined symbols. The exact same build with OpenSSL 1.0.2s works fine. We build with a simple configure --prefix=/foo && make.

This was discovered as part of migrating all Homebrew formulas to OpenSSL 1.1: https://github.com/Homebrew/homebrew-core/pull/43860

It looks like it's linking only to libssl while the symbols it's looking for are in libcrypto.

clang  -g -O2 -pipe -W -Wall -Wshadow -Wstrict-prototypes -std=c99 -pedantic -Wno-overlength-strings   -o mbsync main.o sync.o config.o util.o socket.o driver.o drv_imap.o drv_maildir.o drv_proxy.o -ldb -lssl  -ldl  -lsasl2 -lz 
Undefined symbols for architecture x86_64:
  "_ERR_error_string", referenced from:
      _socket_start_tls in socket.o
      _ssl_return in socket.o
  "_ERR_get_error", referenced from:
      _socket_start_tls in socket.o
      _ssl_return in socket.o
  "_GENERAL_NAME_free", referenced from:
      _start_tls_p2 in socket.o
  "_OPENSSL_sk_dup", referenced from:
      _socket_start_tls in socket.o
  "_OPENSSL_sk_num", referenced from:
      _start_tls_p2 in socket.o
  "_OPENSSL_sk_pop_free", referenced from:
      _start_tls_p2 in socket.o
  "_OPENSSL_sk_value", referenced from:
      _start_tls_p2 in socket.o
  "_X509_NAME_get_text_by_NID", referenced from:
      _start_tls_p2 in socket.o
  "_X509_OBJECT_get0_X509", referenced from:
      _start_tls_p2 in socket.o
  "_X509_STORE_get0_objects", referenced from:
      _socket_start_tls in socket.o
  "_X509_cmp", referenced from:
      _start_tls_p2 in socket.o
  "_X509_get_ext_d2i", referenced from:
      _start_tls_p2 in socket.o
  "_X509_get_subject_name", referenced from:
      _start_tls_p2 in socket.o
  "_X509_verify_cert_error_string", referenced from:
      _start_tls_p2 in socket.o

Discussion

  • FX

    FX - 2019-09-07

    libcrypto is not detected because CRYPTO_lock was removed in OpenSSL 1.1.
    Fixed with the following patch:

    diff -pur isync-1.3.1/configure.ac isync-1.3.1-fixed/configure.ac
    --- isync-1.3.1/configure.ac    2019-05-28 15:44:13.000000000 +0200
    +++ isync-1.3.1-fixed/configure.ac  2019-09-07 15:39:55.000000000 +0200
    @@ -94,7 +94,7 @@ if test "x$ob_cv_with_ssl" != xno; then
         sav_LDFLAGS=$LDFLAGS
         LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
         AC_CHECK_LIB(dl, dlopen, [LIBDL=-ldl])
    -    AC_CHECK_LIB(crypto, CRYPTO_lock, [LIBCRYPTO=-lcrypto])
    +    AC_CHECK_LIB(crypto, HMAC_Update, [LIBCRYPTO=-lcrypto])
         AC_CHECK_LIB(ssl, SSL_connect,
                      [SSL_LIBS="-lssl $LIBCRYPTO $LIBDL" have_ssl_paths=yes])
         LDFLAGS=$sav_LDFLAGS
    
     
  • Oswald Buddenhagen

    • status: reported --> fixed
    • assigned_to: Oswald Buddenhagen
    • Fixed In: unknown --> 1.3.2
     

Log in to post a comment.