Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

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: 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