Bug 235765 - net-p2p/libtorrent : broken with OpenSSL 1.1.1
Summary: net-p2p/libtorrent : broken with OpenSSL 1.1.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Danilo G. Baio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-15 19:30 UTC by Henrik Hudson
Modified: 2019-06-23 21:45 UTC (History)
0 users

See Also:
dbaio: maintainer-feedback+


Attachments
Makefile patch for net-p2p/libtorrent (1.00 KB, patch)
2019-02-15 19:30 UTC, Henrik Hudson
no flags Details | Diff
poudriere build log (150.91 KB, text/plain)
2019-02-25 16:25 UTC, Henrik Hudson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Henrik Hudson 2019-02-15 19:30:50 UTC
Created attachment 202050 [details]
Makefile patch for net-p2p/libtorrent

net-p2p/libtorrent is broken with FreeBSD 12+ and/or OpenSSL 1.1.1

I've patched the Makefile to add warnings about 'openssl111' and modified the USES section to enable ssl and force localbase for ldflags. It seems to still look for base SSL otherwise.

No other changes. 

poudriere build works for me on FreeBSD 11.2 with SSL=openssl and 12.0 with SSL=openssl
Comment 1 Danilo G. Baio freebsd_committer freebsd_triage 2019-02-16 15:43:48 UTC
I couldn't replicate this issue with:

Jail Poudriere: 1102000 / 1200086 / 1300003

DEFAULT_VERSIONS+=	ssl=openssl111
 0x0000000000000001 NEEDED               Shared library: [libcrypto.so.11]
 openssl111-1.1.1a


DEFAULT_VERSIONS+=	ssl=openssl
 0x0000000000000001 NEEDED               Shared library: [libcrypto.so.9]
 openssl-1.0.2q,1


DEFAULT_VERSIONS+=
 0x0000000000000001 NEEDED               Shared library: [libcrypto.so.111]
 $openssl version
OpenSSL 1.1.1a-freebsd  20 Nov 2018


Actually I'm running libtorrent/rtorrent on CURRENT 1300010 without issues.

Could you share your poudriere build logs, without the patch?
Comment 2 Danilo G. Baio freebsd_committer freebsd_triage 2019-02-23 21:10:14 UTC
If you have more information, please, reopen this PR.
Comment 3 Henrik Hudson 2019-02-25 16:24:08 UTC
Sorry, took a bit to run builds again.

I backed out my local port changes and attached is my poudriere log.

I get similar errors for net/xmlrpc-c  and the fix was to force the lib path to /usr/local/ for both. It seems to pick up the base SSL vs. honoring the ports SSL.
Comment 4 Henrik Hudson 2019-02-25 16:25:33 UTC
Created attachment 202357 [details]
poudriere build log
Comment 5 Danilo G. Baio freebsd_committer freebsd_triage 2019-02-25 16:44:12 UTC
(In reply to Henrik Hudson from comment #3)

Thank you Henrik.

In fact, my libtorrent port was with this change:

-USES=          autoreconf compiler:c++11-lang libtool pathfix pkgconfig ssl
+USES=          autoreconf compiler:c++11-lang libtool localbase:ldflags pathfix pkgconfig ssl

I was dealing with cppunit dependency some time ago and I let the Makefile dirty. =/

The BROKEN part of your patch is not necessary, as you can see on comment 1, it's linking right.

Is that ok?
Comment 6 Henrik Hudson 2019-02-25 18:08:12 UTC
No worries.

Without that warning won't it still break for people using openssl111 though even on 11.x or 12.x?
Comment 7 Danilo G. Baio freebsd_committer freebsd_triage 2019-02-25 19:23:12 UTC
With this change, libtorrent can be built with openssl-1.1.X or openssl-1.0.X in base or not:

https://svnweb.freebsd.org/ports?view=revision&revision=484484
https://svnweb.freebsd.org/ports/head/net-p2p/libtorrent/files/patch-openssl-1.1.x?revision=484484&view=markup&pathrev=484484

Is there another issue am I not seeing?
Comment 8 Henrik Hudson 2019-02-26 16:58:30 UTC
Sorry, I guess I don't understand the purpose of the 'localbase:ldflags' then.

I thought it was just forcing it to use /usr/local/ for SSL library paths and that the base SSL 1.1.x was what was breaking the compilation.
Comment 9 Danilo G. Baio freebsd_committer freebsd_triage 2019-03-02 12:34:23 UTC
(In reply to Henrik Hudson from comment #8)

If you not set `ssl=openssl111` or `ssl=openssl`, the framework will use `ssl=base` for default.

`localbase:ldflags` will help libtorrent to link properly with openssl from ports (if users desire that), not conflicting with the base one.

When you change `DEFAULT_VERSIONS+= ssl=???`, look at this:

$ make -V OPENSSLBASE
/usr
$ make -V OPENSSLDIR
/etc/ssl
$ make -V OPENSSLINC
/usr/include
$ make -V OPENSSLLIB
/usr/lib


./configure --help
[...]
  OPENSSL_CFLAGS
              C compiler flags for OPENSSL, overriding pkg-config
  OPENSSL_LIBS
              linker flags for OPENSSL, overriding pkg-config

build log:
--CONFIGURE_ENV--
OPENSSL_LIBS="-L/usr/lib -lcrypto" OPENSSL_CFLAGS="-I /usr/include" ...


So we are not forcing users to use OpenSSL from ports, we are just letting them to choose what they want.

And IMHO I recommend to use OpenSSL from base unless you have a compelling reason for not doing that.
Comment 10 commit-hook freebsd_committer freebsd_triage 2019-06-23 21:43:15 UTC
A commit references this bug:

Author: dbaio
Date: Sun Jun 23 21:42:15 UTC 2019
New revision: 504994
URL: https://svnweb.freebsd.org/changeset/ports/504994

Log:
  net-p2p/libtorrent: Unbreak with ssl other than base

  PR:		235765

Changes:
  head/net-p2p/libtorrent/Makefile