Skip to content

Some OpenSSL configure tests not linking OpenSSL #2199

@MarcelRaad

Description

@MarcelRaad

I did this

./configure --enable-warnings --enable-werror --enable-static --disable-shared [...] --with-ssl="/[...]/openssl/[...]"

OpenSSL's lib directory only contains libcrypto.a and libssl.a.

From config.log (https://github.com/curl/curl/blob/curl-7_57_0/configure.ac#L1638):

configure:22599: checking for HMAC_Update in -lcrypto
configure:22621: gcc -o conftest [...]  -I/[...]/openssl/[...]/include -I/[...]/openssl/[...]/include/openssl  -L/[...]/openssl/[...]/lib conftest.c -lcrypto   >&5
conftest.c:51:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
char HMAC_Update ();
^
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_lock_new':
threads_pthread.c:(.text+0x25): undefined reference to `pthread_rwlock_init'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_read_lock':
threads_pthread.c:(.text+0x65): undefined reference to `pthread_rwlock_rdlock'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_write_lock':
threads_pthread.c:(.text+0x85): undefined reference to `pthread_rwlock_wrlock'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_unlock':
threads_pthread.c:(.text+0xa5): undefined reference to `pthread_rwlock_unlock'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_lock_free':
threads_pthread.c:(.text+0xca): undefined reference to `pthread_rwlock_destroy'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_run_once':
threads_pthread.c:(.text+0xf5): undefined reference to `pthread_once'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_init_local':
threads_pthread.c:(.text+0x115): undefined reference to `pthread_key_create'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_set_local':
threads_pthread.c:(.text+0x147): undefined reference to `pthread_setspecific'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_cleanup_local':
threads_pthread.c:(.text+0x167): undefined reference to `pthread_key_delete'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_get_local':
threads_pthread.c:(.text+0x133): undefined reference to `pthread_getspecific'
/[...]/openssl/[...]/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x11): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x24): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x2f): undefined reference to `dlclose'
/[...]/openssl/[...]/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
dso_dlfcn.c:(.text+0x1a4): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x262): undefined reference to `dlerror'
/[...]/openssl/[...]/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
dso_dlfcn.c:(.text+0x2c9): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x339): undefined reference to `dlclose'
dso_dlfcn.c:(.text+0x372): undefined reference to `dlerror'
/[...]/openssl/[...]/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
dso_dlfcn.c:(.text+0x421): undefined reference to `dladdr'
dso_dlfcn.c:(.text+0x489): undefined reference to `dlerror'
/[...]/openssl/[...]/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
dso_dlfcn.c:(.text+0x652): undefined reference to `dlclose'
configure:22641: checking for HMAC_Init_ex in -lcrypto
configure:22663: gcc -o conftest [...]  -I/[...]/openssl/[...]/include/openssl -I/[...]/openssl/[...]/include  -L/[...]/openssl/[...]/lib conftest.c -lcrypto   >&5
conftest.c:51:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
char HMAC_Init_ex ();
^
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_lock_new':
threads_pthread.c:(.text+0x25): undefined reference to `pthread_rwlock_init'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_read_lock':
threads_pthread.c:(.text+0x65): undefined reference to `pthread_rwlock_rdlock'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_write_lock':
threads_pthread.c:(.text+0x85): undefined reference to `pthread_rwlock_wrlock'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_unlock':
threads_pthread.c:(.text+0xa5): undefined reference to `pthread_rwlock_unlock'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_lock_free':
threads_pthread.c:(.text+0xca): undefined reference to `pthread_rwlock_destroy'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_run_once':
threads_pthread.c:(.text+0xf5): undefined reference to `pthread_once'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_init_local':
threads_pthread.c:(.text+0x115): undefined reference to `pthread_key_create'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_set_local':
threads_pthread.c:(.text+0x147): undefined reference to `pthread_setspecific'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_cleanup_local':
threads_pthread.c:(.text+0x167): undefined reference to `pthread_key_delete'
/[...]/openssl/[...]/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_get_local':
threads_pthread.c:(.text+0x133): undefined reference to `pthread_getspecific'
/[...]/openssl/[...]/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x11): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x24): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x2f): undefined reference to `dlclose'
/[...]/openssl/[...]/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
dso_dlfcn.c:(.text+0x1a4): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x262): undefined reference to `dlerror'
/[...]/openssl/[...]/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
dso_dlfcn.c:(.text+0x2c9): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x339): undefined reference to `dlclose'
dso_dlfcn.c:(.text+0x372): undefined reference to `dlerror'
/[...]/openssl/[...]/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
dso_dlfcn.c:(.text+0x421): undefined reference to `dladdr'
dso_dlfcn.c:(.text+0x489): undefined reference to `dlerror'
/[...]/openssl/[...]/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
dso_dlfcn.c:(.text+0x652): undefined reference to `dlclose'
configure:22681: checking OpenSSL linking with -ldl
configure:22698: gcc -o conftest [...]  -I/[...]/openssl/[...]/include/openssl -I/[...]/openssl/[...]/include  -L/[...]/openssl/[...]/lib conftest.c -ldl  >&5
/tmp/ccxJxgSF.o: In function `main':
conftest.c:(.text.startup+0x5): undefined reference to `ERR_clear_error'
configure:22709: checking OpenSSL linking with -ldl and -lpthread
configure:22726: gcc -o conftest [...]  -I/[...]/openssl/[...]/include/openssl -I/[...]/openssl/[...]/include  -L/[...]/openssl/[...]/lib conftest.c -lpthread -ldl  >&5
/tmp/cco8FOvK.o: In function `main':
conftest.c:(.text.startup+0x5): undefined reference to `ERR_clear_error'

I expected the following

-lcrypto also being passed to the -ldl and -ldl -lpthread tests

curl/libcurl version

7.57.0 (OpenSSL 1.1.0g)

operating system

Ubuntu 16.04 Xenial

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions