On 07/30/2011 07:24 PM, Pierre Chifflier wrote:
> On Sat, Jul 30, 2011 at 07:02:27PM +0200, Julian Taylor wrote:
>> reopen 632090
>> found 632090 0.8-1
>> thanks
>>
>> the fix was not merged in 0.8.
>> Makefile.am and debian/rules is still wrongly using LDFLAGS for linking.
>>
>> The proper fix is still waiting in this pull request:
>> https://github.com/moxie0/sslsniff/pull/1
>> see:
>> https://github.com/moxie0/sslsniff/issues/2
>>
> 
> I must have missed something ..
> 
> I tried to add -Wl,--as-needed to LDFLAGS and building the package and
> it builds fine. Last lines from build are:
> 
> mv -f .deps/FirefoxAddonUpdater.Tpo .deps/FirefoxAddonUpdater.Po
> g++ -ggdb -g -O2 -lssl -lboost_filesystem-mt -lpthread -lboost_thread-mt 
> -llog4cpp -Wl,-z,defs -lcrypto -lboost_system -Wl,--as-needed -o sslsniff 
> SSLConnectionManager.o Destination.o FirefoxUpdater.o Logger.o SessionCache.o 
> SSLBridge.o HTTPSBridge.o sslsniff.o FingerprintManager.o 
> AuthorityCertificateManager.o TargetedCertificateManager.o 
> CertificateManager.o HttpBridge.o HttpConnectionManager.o HttpHeaders.o 
> UpdateManager.o OCSPDenier.o FirefoxAddonUpdater.o  
> {master//sslsniff} $ ++ -ggdb -g -O2 -lssl -lboost_filesystem-mt -lpthread 
> -lboost_thread-mt -llog4cpp -Wl,-z,defs -lcrypto -lboost_system 
> -Wl,--as-needed -o sslsniff SSLConnectionManager.o Destination.o 
> FirefoxUpdater.o Logger.o SessionCache.o SSLBridge.o HTTPSBridge.o sslsniff.o 
> FingerprintManager.o AuthorityCertificateManager.o 
> TargetedCertificateManager.o CertificateManager.o HttpBridge.o 
> HttpConnectionManager.o HttpHeaders.o UpdateManager.o OCSPDenier.o 
> FirefoxAddonUpdater.o
> 
> (note the -Wl,--as-needed on the command line).
> 
> Do I have something else to check ?
> 
> Pierre

--as-needed is a positional flag, it only affects arguments later in the
commandline. You added it after the libraries so these are still kept.
Placing -Wl,--as-needed as the first argument will result in an error in
debian unstable too:
g++ -Wl,--as-needed -ggdb -g -O2 -lssl -lboost_filesystem-mt -lpthread
-lboost_thread-mt -llog4cpp -Wl,-z,defs -lcrypto -lboost_system -o
sslsniff SSLConnectionManager.o Destination.o FirefoxUpdater.o Logger.o
SessionCache.o SSLBridge.o HTTPSBridge.o sslsniff.o FingerprintManager.o
AuthorityCertificateManager.o TargetedCertificateManager.o
CertificateManager.o HttpBridge.o HttpConnectionManager.o HttpHeaders.o
UpdateManager.o OCSPDenier.o FirefoxAddonUpdater.o

The fix is to place all objects needing symbols before the libraries
providing them on the commandline so ld knows which symbols it needs.
automake does this correctly if the correct variable LIBS or LDADD is
used for -l flags, sslsniff wrongly uses LDFLAGS.

also in ubuntu oneiric where this flag is default for all builds so its
dependencies they may have less links than in debian, which could result
in further problems if sslsniff is relying on indirect linkage.
But this should be caught by --no-copy-dt-needed which is default in
debian now too.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to