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

Bug 605026

Summary: www-client/elinks-0.12_pre6-r2 with dev-libs/openssl-1.1.0c - configure: error: OpenSSL not found - conftest.c:151: undefined reference to `SSLeay_add_ssl_algorithms'
Product: Gentoo Linux Reporter: eroen <gentoo>
Component: Current packagesAssignee: Felix Janda <felix.janda>
Severity: normal CC: jstein, maintainer-needed, proxy-maint, quentin
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 592438, 669514    
Attachments: www-client/elinks-0.12_pre6-r2:20170108-092431.log
0002-Support-openssl-1.1.0-without-compat-modes.patch (backported to 0.12_pre6-r2)
Suggested patch

Description eroen 2017-01-08 09:28:58 UTC
Created attachment 459136 [details]

checking for OpenSSL... configure: error: OpenSSL not found

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/www-client/elinks-0.12_pre6-r2/work/elinks-0.12pre6/config.log
 * ERROR: www-client/elinks-0.12_pre6-r2::gentoo failed (configure phase):
 *   econf failed
 * Call stack:
 *     , line  115:  Called src_configure
 *             environment, line 3126:  Called econf '--sysconfdir=/etc/elinks' '--enable-leds' '--enable-88-colors' '--enable-256-colors' '--enable-true-color' '--enable-html-highlight' '--with-gpm' '--with-zlib' '--with-bzlib' '--without-gc' '--with-x' '--without-lua' '--without-guile' '--without-perl' '--without-ruby' '--with-idn' '--without-spidermonkey' '--disable-bittorrent' '--disable-nls' '--enable-ipv6' '--enable-ftp' '--enable-gopher' '--disable-nntp' '--enable-finger' '--enable-smb' '--enable-mouse' '--enable-xbel' '--enable-fastmem' '--with-openssl=/usr'
 *, line  665:  Called __helpers_die 'econf failed'
 *, line  117:  Called die
 * The specific snippet of code:
 *   		die "$@"
Comment 1 eroen 2017-01-08 09:32:15 UTC
Created attachment 459138 [details]

configure:9992: checking for OpenSSL
configure:10039: x86_64-pc-linux-gnu-gcc -o conftest -O0 -g -Wall -I/usr/include  -I/usr/include -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu conftest.c -L/usr/lib -lssl -lcrypto -ldl  -lgpm -lz -lbz2 -lidn -lexpat >&5
conftest.c: In function 'main':
conftest.c:151:1: warning: implicit declaration of function 'OpenSSL_add_all_algorithms' [-Wimplicit-function-declaration]
/var/tmp/portage/www-client/elinks-0.12_pre6-r2/temp/ccHEPwOj.o: In function `main':
/var/tmp/portage/www-client/elinks-0.12_pre6-r2/work/elinks-0.12pre6/conftest.c:151: undefined reference to `OpenSSL_add_all_algorithms'
collect2: error: ld returned 1 exit status
configure:10039: $? = 1
configure: failed program was:

(test is repeated with many permutations)
Comment 2 eroen 2017-01-08 22:42:45 UTC
Created attachment 459238 [details, diff]

Upstream's bug tracker[0] seems to have some trouble, but here's a patch to fix build with openss-1.1.0c for upstream master branch.

Comment 3 eroen 2017-01-08 22:45:01 UTC
Created attachment 459240 [details, diff]

For 0.12_pre6-r2, first this patch[1] from upstream is required to drop EGD requirement.

Comment 4 eroen 2017-01-08 22:46:40 UTC
Created attachment 459242 [details, diff]
0002-Support-openssl-1.1.0-without-compat-modes.patch (backported to 0.12_pre6-r2)

Also required is my patch from above, backported to 0.12_pre6-r2.
Comment 5 Felix Janda 2017-10-14 14:44:10 UTC
Could you send your patches to elinks-dev[0]?

Comment 6 Mark Wright gentoo-dev 2017-10-29 11:15:37 UTC
Created attachment 500770 [details, diff]

This patch is just simply the patches that eroen kindly supplied earlier
tweaked to apply to www-client/elinks-0.12_pre6-r3 (leaving out stuff that
is now in -r3).  Builds fine with dev-libs/openssl-1.1.0f-r1.
Comment 7 Felix Janda 2017-10-31 22:43:24 UTC
I don't quite understand the patch.

From what I can see, SSLeay_add_ssl_algorithms does the same as
SSL_library_init, which has been superseeded by OPENSSL_init_ssl.
It seems that the patch removes openssl initialization.

The configure tests also seem strange:

+				AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <openssl/crypto.h>]], [[OpenSSL_version_num()]])],[cf_result=yes],[cf_result=no])

Why include openssl/crypto.h? openssl/opensslv.h would make more sense.

+		AC_CHECK_FUNCS([SSL_set_options] [SSL_get_SSL_CTX])

The result of this check doesn't seem to be used anywhere. So why add it?
Comment 8 Felix Janda 2017-11-04 11:30:47 UTC
Created attachment 502474 [details, diff]
Suggested patch

Reading the documentation [1] more closely, indeed, with OpenSSL-1.1.0
explicit initialized is no longer needed.

Does this new patch still work?

Comment 9 Quentin Minster 2018-03-05 20:48:56 UTC
Created attachment 522472 [details, diff]

Here is an updated and cleaned up patch for elinks-0.13_pre_pre20180225.
Comment 10 Felix Janda 2018-03-15 23:07:57 UTC
Sorry for the delay.

The only minor issue I see is that it breaks compilation with libressl.
No current release of libressl has ASN1_STRING_get0_data, but the next
version should have it.

Several possibilities:

- wait for the next libressl release
- write a configure test for ASN1_STRING_get0_data
- speculatively check for LIBRESSL_VERSION_NUMBER <= 0x2060400fL
- ask for an openssl ebuild with the option to enable the deprecated functions
Comment 11 Lars Wendler (Polynomial-C) gentoo-dev 2018-10-24 14:28:46 UTC
Since we decided to no longer build openssl without deprecated features, this
bug can now be considered as fixed (but will eventually reappear once openssl
upstream finally removed deprecated features from their code).