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

Bug 370105

Summary: net-analyzer/sslsniff fails because of underlinking
Product: Gentoo Linux Reporter: Diego Elio Pettenò (RETIRED) <flameeyes>
Component: New packagesAssignee: Robin Johnson <robbat2>
Status: RESOLVED FIXED    
Severity: normal CC: jer, zerochaos
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 372079    
Attachments: Build log
sslsniff-0.8-underlinking.patch

Description Diego Elio Pettenò (RETIRED) gentoo-dev 2011-06-05 11:59:34 UTC
Created attachment 275889 [details]
Build log

Hello there!

You're getting this bug because the package in Summary failed to build in my tinderbox using the gold link editor from binutils. Before closing the bug as INVALID let me explain why this is still important!

The gold link editor does not support underlinking of shared objects, which is something I have described in my blog post:

http://blog.flameeyes.eu/2010/11/26/it-s-not-all-gold-that-shines-why-underlinking-is-a-bad-thing

Even the basic link editor (ld.bfd) has an option to support this but it is a heck to enable and get passed, so linking with gold is simply quicker.

Fixing underlinking provides optimized --as-needed builds (because the "softer" version no longer need to recover libraries that are underlinked), so it is a Good Thing To Do.

Thank you very much for the attention!
Comment 1 Kevin Pyle 2011-06-11 03:37:47 UTC
Output file "sslsniff" needs libboost_system.so and libcrypto.so, but does not request them.  Adding "-lboost_system -lcrypto" to the link line should fix it.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2011-11-18 17:52:34 UTC
Created attachment 292999 [details, diff]
sslsniff-0.8-underlinking.patch

Use pkgconfig to get openssl libraries (configure.ac) and add -lboost_system to LDFLAGS.

Also needs these changes to the ebuild:

Index: sslsniff-0.8.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/net-analyzer/sslsniff/sslsniff-0.8.ebuild,v
retrieving revision 1.1
diff -u -B -r1.1 sslsniff-0.8.ebuild
--- sslsniff-0.8.ebuild 2 Oct 2011 01:27:31 -0000       1.1
+++ sslsniff-0.8.ebuild 18 Nov 2011 17:50:32 -0000
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/sslsniff/sslsniff-0.8.ebuild,v 1.1 2011/10/02 01:27:31 robbat2 Exp $
 
-EAPI=2
+EAPI=4
 inherit autotools eutils
 
 DESCRIPTION="MITM all SSL connections on a LAN and dynamically generates certs"
@@ -14,12 +14,14 @@
 KEYWORDS="~amd64 ~x86"
 IUSE=""
 
-DEPEND="dev-libs/boost
+DEPEND="dev-util/pkgconfig"
+CDEPEND="dev-libs/boost
        dev-libs/log4cpp
        dev-libs/openssl"
+RDEPEND="${CDEPEND}"
 
 src_prepare() {
-       epatch "${FILESDIR}"/${PN}-0.6-asneeded.patch
+       epatch "${FILESDIR}"/${P}-underlinking.patch
        eautoreconf
 }
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2011-11-18 17:56:11 UTC
(In reply to comment #2)
> Created attachment 292999 [details, diff] [details, diff]
> sslsniff-0.8-underlinking.patch
> 
> Use pkgconfig to get openssl libraries (configure.ac) and add -lboost_system > to LDFLAGS.

Maybe AC_SUBST(openssl_LIBS) isn't even needed. I haven't checked.
Comment 4 Rick Farina (Zero_Chaos) gentoo-dev 2012-12-07 15:31:25 UTC
Can I get a bump on this from someone that know how to test if "AC_SUBST(openssl_LIBS)" is needed?

Feel free to fix it however you see fit, as long as you sanely tested.
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2012-12-07 16:01:28 UTC
Fixed in 0.8-r1.