Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via infra@gentoo.org or IRC

Bug 699384

Summary: net-misc/openssh-8.0_p1-r4 USE=static with dev-libs/openssl-1.1.1d-r2 - configure: error: *** working libcrypto not found, check config.log
Product: Gentoo Linux Reporter: Nuno <can.ecodo.nu.n.o+bugs.gentoo>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: UNCONFIRMED ---    
Severity: normal CC: ivan, robbat2
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: /var/tmp/portage/net-misc/openssh-8.0_p1-r4/temp/build.log
/var/tmp/portage/net-misc/openssh-8.0_p1-r4/work/openssh-8.0p1/config.log
emerge --info '=net-misc/openssh-8.0_p1-r4::gentoo'
emerge --info openssl
/var/tmp/portage/net-misc/openssh-8.0_p1-r4/work/openssh-8.0p1/config.log after patching -lpthread
Patch from Thomas adding -lpthread

Description Nuno 2019-11-05 18:04:35 UTC
openssh-7.9_p1-r4 fails with
configure: error: *** Can't find recent OpenSSL libcrypto (see config.log for details) ***

net-misc/openssh-8.0_p1-r4 fails with
configure: error: *** working libcrypto not found, check config.log

Using dev-libs/openssl-1.1.1d-r2 with USE="asm static-libs zlib".

---
USE="static-libs static -pam -pie" emerge -pqv net-misc/openssh
[ebuild   R   ] net-misc/openssh-8.0_p1-r4  USE="X ssl static* -X509 -audit -bindist -debug -hpn -kerberos -ldns -libedit
 -libressl -livecd -pam* -pie* -sctp (-selinux) -test -xmss"
---


config.log (full version attached below):
---
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../
../../../lib64/libcrypto.a(dso_dlfcn.o): in function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x11): warning: Using 'dlopen' in statically linked applications requires at runtime the shared librar
ies from the glibc version used for linking
(...)
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../
../../../lib64/libcrypto.a(threads_pthread.o): in function `CRYPTO_THREAD_get_local':
threads_pthread.c:(.text+0x143): undefined reference to `pthread_getspecific'
collect2: error: ld returned 1 exit status
configure:12634: $? = 1
---
Comment 1 Nuno 2019-11-05 18:05:44 UTC
Created attachment 595074 [details]
/var/tmp/portage/net-misc/openssh-8.0_p1-r4/temp/build.log
Comment 2 Nuno 2019-11-05 18:06:09 UTC
Created attachment 595076 [details]
/var/tmp/portage/net-misc/openssh-8.0_p1-r4/work/openssh-8.0p1/config.log
Comment 3 Nuno 2019-11-05 18:07:27 UTC
Created attachment 595078 [details]
emerge --info '=net-misc/openssh-8.0_p1-r4::gentoo'

note that I currently have openssh installed with USE="-static" but I want to compiled with USE="static"
Comment 4 Nuno 2019-11-05 18:07:55 UTC
Created attachment 595080 [details]
emerge --info openssl
Comment 5 Thomas Deutschmann gentoo-dev Security 2019-11-05 19:54:41 UTC
Please try

--- a/configure.ac
+++ b/configure.ac
@@ -2530,7 +2530,7 @@ AC_ARG_WITH([ssl-engine],
 )

 if test "x$openssl" = "xyes" ; then
-       LIBS="-lcrypto $LIBS"
+       LIBS="-lcrypto -lpthread $LIBS"
        AC_TRY_LINK_FUNC([RAND_add], ,
            [AC_MSG_ERROR([*** working libcrypto not found, check config.log])])
        AC_CHECK_HEADER([openssl/opensslv.h], ,
Comment 6 Nuno 2019-11-05 22:22:26 UTC
(In reply to Thomas Deutschmann from comment #5)
> Please try
> 

Thanks, Thomas!

It helps a bit: after applying that patch (had to chance a few spaces to tabs), it gives a different error in build.log:

checking whether OpenSSL's PRNG is internally seeded... no
checking for PRNGD/EGD socket... not found
configure: error: OpenSSH has no source of random numbers. Please configure OpenSSL with an entropy source or re-run configure using one of 
the --with-prngd-port or --with-prngd-socket options
Comment 7 Nuno 2019-11-05 22:24:12 UTC
Created attachment 595106 [details]
/var/tmp/portage/net-misc/openssh-8.0_p1-r4/work/openssh-8.0p1/config.log after patching -lpthread
Comment 8 Nuno 2019-11-12 14:27:09 UTC
Created attachment 595888 [details, diff]
Patch from Thomas adding -lpthread

/etc/portage/patches/net-misc/openssh-8.0_p1-r4/bug-699384_lpthread.patch

If anyone wants to try it.
Comment 9 Nuno 2020-02-03 17:42:29 UTC
Any update on this? :/
Comment 10 Nuno 2020-02-03 18:06:10 UTC
the newer net-misc/openssh-8.1_p1-r1 is also affected


(...)
checking if openpty correctly handles controlling tty... yes
checking whether AI_NUMERICSERV is declared... yes
checking for getpgrp... yes
checking if getpgrp accepts zero args... yes
configure: error: *** working libcrypto not found, check config.log
Comment 11 Nuno 2020-06-26 19:31:31 UTC
net-misc/openssh-8.3_p1-r2 (currently ~amd64) is still affected:

# USE="static -pam -pie" emerge -1v --buildpkgonly net-misc/openssh --quiet-build=n

(...)

[ebuild     U ~] net-misc/openssh-8.3_p1-r2::gentoo [8.1_p1-r3::gentoo] USE="X ssl static* -X509 -audit -bindist -debug -hpn -kerberos -ldns -libedit -libressl -livecd -pam* -pie* -sctp -security-key% (-selinux) -test -xmss" 1,667 KiB

(...)

checking if SA_RESTARTed signals interrupt select()... yes
checking for getpgrp... yes
checking if getpgrp accepts zero args... yes
configure: error: *** working libcrypto not found, check config.log




config.log says:

(...)

configure:12933: x86_64-pc-linux-gnu-gcc -o conftest -O2 -pipe -march=ivybridge -mmmx -msse -msse2 -msse3 -mssse3 -mcx16 -msahf -maes -mpclmul -mpopcnt -mavx -msse4.2 -msse4.1 -mrdrnd -mf16c -mfsgsbase -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=ivybridge -pipe -Wno-error=format-truncation -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -Wimplicit-fallthrough -fno-strict-aliasing  -ftrapv -fno-builtin-memset -fstack-protector-strong  -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -Wl,-O1 -Wl,--as-needed -static -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -fstack-protector-strong -Wl,-O1 -Wl,--as-needed -static conftest.c -lssl -lcrypto -ldl -lutil -lz  >&5
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libcrypto.a(dso_dlfcn.o): in function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x13): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libcrypto.a(b_addr.o): in function `BIO_lookup_ex':
b_addr.c:(.text+0xcee): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libcrypto.a(b_sock.o): in function `BIO_gethostbyname':
b_sock.c:(.text+0x71): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/libgcc_eh.a(unwind-dw2.o): in function `__gthread_once':
/var/tmp/portage/sys-devel/gcc-9.3.0/work/build/x86_64-pc-linux-gnu/libgcc/./gthr-default.h:700: undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libcrypto.a(threads_pthread.o): in function `CRYPTO_THREAD_lock_new':
threads_pthread.c:(.text+0x46): undefined reference to `pthread_rwlock_init'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libcrypto.a(threads_pthread.o): in function `CRYPTO_THREAD_read_lock':
threads_pthread.c:(.text+0x85): undefined reference to `pthread_rwlock_rdlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libcrypto.a(threads_pthread.o): in function `CRYPTO_THREAD_write_lock':
threads_pthread.c:(.text+0xa5): undefined reference to `pthread_rwlock_wrlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libcrypto.a(threads_pthread.o): in function `CRYPTO_THREAD_unlock':
threads_pthread.c:(.text+0xc5): undefined reference to `pthread_rwlock_unlock'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libcrypto.a(threads_pthread.o): in function `CRYPTO_THREAD_lock_free':
threads_pthread.c:(.text+0xea): undefined reference to `pthread_rwlock_destroy'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libcrypto.a(threads_pthread.o): in function `CRYPTO_THREAD_run_once':
threads_pthread.c:(.text+0x115): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libcrypto.a(threads_pthread.o): in function `CRYPTO_THREAD_init_local':
threads_pthread.c:(.text+0x135): undefined reference to `pthread_key_create'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libcrypto.a(threads_pthread.o): in function `CRYPTO_THREAD_set_local':
threads_pthread.c:(.text+0x167): undefined reference to `pthread_setspecific'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libcrypto.a(threads_pthread.o): in function `CRYPTO_THREAD_cleanup_local':
threads_pthread.c:(.text+0x187): undefined reference to `pthread_key_delete'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libcrypto.a(threads_pthread.o): in function `openssl_init_fork_handlers':
threads_pthread.c:(.text+0x1e3): undefined reference to `pthread_once'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/libcrypto.a(threads_pthread.o): in function `CRYPTO_THREAD_get_local':
threads_pthread.c:(.text+0x153): undefined reference to `pthread_getspecific'
collect2: error: ld returned 1 exit status
configure:12933: $? = 1

(...)