Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 655696 - net-libs/libtorrent-0.13.6-r1 - diffie_hellman.cc:57:7: error: invalid use of incomplete type 'DH {aka struct dh_st}'
Summary: net-libs/libtorrent-0.13.6-r1 - diffie_hellman.cc:57:7: error: invalid use of...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Stephen Shkardoon
URL: https://github.com/rakshasa/libtorren...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-13 21:35 UTC by cryptopsy
Modified: 2018-05-20 13:46 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
net-libs:libtorrent-0.13.6-r1:20180514-002724.log (net-libs:libtorrent-0.13.6-r1:20180514-002724.log,199.64 KB, text/plain)
2018-05-13 21:35 UTC, cryptopsy
Details
emerge --info (info,5.26 KB, text/plain)
2018-05-13 21:35 UTC, cryptopsy
Details
build.log without lto on openssl (net-libs:libtorrent-0.13.6-r1:20180515-221738.log.xz,9.44 KB, application/x-xz)
2018-05-15 19:19 UTC, cryptopsy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cryptopsy 2018-05-13 21:35:16 UTC
Created attachment 531294 [details]
net-libs:libtorrent-0.13.6-r1:20180514-002724.log

doesn't work without lto either
Comment 1 cryptopsy 2018-05-13 21:35:42 UTC
Created attachment 531296 [details]
emerge --info
Comment 2 Joonas Niilola gentoo-dev 2018-05-14 06:33:15 UTC
Hey, have you built openssl with flto? Its known to cause a lot of issues. Also if you are using gold linker, you should switch to bfd when building openssl. These can both be easily done with package.env.

https://github.com/InBetweenNames/gentooLTO/blob/master/sys-config/ltoize/files/package.cflags/ltoworkarounds.conf
Heres a nice list of packages that dont play well with LTO.
Comment 3 cryptopsy 2018-05-14 14:50:55 UTC
openssl is built with flto and i have not specified a different linker. Only a handfull of packages in package.env are not:

app-emulator/wine-staging       nolto nographite j1
app-shells/bash                                  graphite-safe
dev-lang/spidermonkey           nolto nographite
dev-qt/qtcore                   nolto
dev-qt/qtwebengine              nolto #working , may need j1
#dev-qt/qtwebengine             #working
media-libs/mesa                 nolto
media-libs/openal               nolto 
media-sound/pulseaudio          nolto #needed, but nographite not needed
media-video/ffmpeg              nolto nographite working # 
net-print/cups                  nolto nographite
Comment 4 Joonas Niilola gentoo-dev 2018-05-15 04:49:38 UTC
Well, can you try and build your installed version of openssl:0 without lto, and then try compiling this package? Theres no reason to debug this further _IF_ the reason is broken openssl due to lto :)
Comment 5 cryptopsy 2018-05-15 19:19:38 UTC
Created attachment 531626 [details]
build.log without lto on openssl
Comment 6 Joonas Niilola gentoo-dev 2018-05-16 06:25:02 UTC
Ok, I found that error in libtorrent's github issues. It was related to openssl-1.1 which should still be masked in Gentoo. I couldnt see your version of installed openssl, but I tried building libtorrent myself with openssl-1.1.0h-r1 and I got the exact same error. Downgraded openssl to 1.0.2o-r1 and it built fine. 

Theres a patch in libtorrent's github page, and this should be fixed for the next release. However for now, libtorrent needs to apply patch if openssl is 1.1*, or it should require 1.0.x. Thanks for the report!

Stephen will prepare a PR to fix this ;)
Comment 7 cryptopsy 2018-05-19 01:37:31 UTC
whats the easiest way to apply patches such that they are managed by portage?
Comment 8 Larry the Git Cow gentoo-dev 2018-05-20 13:46:09 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c02b0a1017107506f92c6f705bf2b5c9bcada806

commit c02b0a1017107506f92c6f705bf2b5c9bcada806
Author:     Stephen Shkardoon <ss23@ss23.geek.nz>
AuthorDate: 2018-05-20 07:42:12 +0000
Commit:     Jason Zaman <perfinion@gentoo.org>
CommitDate: 2018-05-20 13:45:46 +0000

    net-libs/libtorrent: support openssl-1.1
    
    Closes: https://bugs.gentoo.org/655696
    
    Package-Manager: Portage-2.3.24, Repoman-2.3.6

 ...DH-parameters-generation-with-OpenSSL-1.1.patch | 105 +++++++++++++++++++++
 net-libs/libtorrent/files/libtorrent-cppunit.patch |  36 +++++++
 .../files/libtorrent-openssl-1.1-part2.patch       |  57 +++++++++++
 .../files/libtorrent-openssl-1.1-part3.patch       |  68 +++++++++++++
 net-libs/libtorrent/libtorrent-0.13.6-r2.ebuild    |  69 ++++++++++++++
 5 files changed, 335 insertions(+)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f792851597b8149efd61273bcd08e261c424e90e

commit f792851597b8149efd61273bcd08e261c424e90e
Author:     Stephen Shkardoon <ss23@ss23.geek.nz>
AuthorDate: 2018-05-20 13:12:38 +0000
Commit:     Jason Zaman <perfinion@gentoo.org>
CommitDate: 2018-05-20 13:45:49 +0000

    net-libs/libtorrent: clarify openssl <1.1 requirement
    
    Bug: https://bugs.gentoo.org/655696
    Package-Manager: Portage-2.3.24, Repoman-2.3.6

 net-libs/libtorrent/libtorrent-0.13.6-r1.ebuild | 4 ++--
 net-libs/libtorrent/libtorrent-0.13.6.ebuild    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)