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

Bug 246869

Summary: app-crypt/ophcrack: fails with forced --as-needed
Product: Gentoo Linux Reporter: Diego Elio Pettenò (RETIRED) <flameeyes>
Component: New packagesAssignee: Mike Auty (RETIRED) <ikelos>
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 129413    
Attachments: Build log

Description Diego Elio Pettenò (RETIRED) gentoo-dev 2008-11-15 13:56:56 UTC
I'm reporting this bug because the package in summary fails to build when forcing --as-needed on through spec files (check out for details).

Check the attached build log.

Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-11-15 13:57:13 UTC
Created attachment 171818 [details]
Build log
Comment 2 Mike Auty (RETIRED) gentoo-dev 2008-11-15 16:29:35 UTC
Hmmm, the build log shows the command being run by upstream's Makefile as:

/usr/bin/gcc -o samdump2 hive.o list.o bkhive.o samdump2.o main.o -Wall  -lssl

which seems to have the library listed last (as I believe it should be for --as-needed).  The symbols seem to be from openssl, so I'm not sure why this fails.  Are the symbols actually from -lcrypto, and is there an easy way to tell what symbols come from which libraries?

The relevant Makefile line is:

$(CC) -o $@ $^ $(CFLAGS) $(LIBS)

where CC, CFLAGS and LIBS are all defined in the Makefile as follows:

CC	  = $(shell which gcc)
CFLAGS    = -Wall 
LIBS      = -lssl

LDFLAGS isn't present, which is probably why this wasn't spotted before.  Other than that, there isn't much difference between this and your boilerplate Makefile mentioned in

I know CC should be using $(tc-getCC), but I doubt that would explain the symbol errors, and I don't see how -Wall would cause them.

So, is this a broken Makefile, or something going wrong with --as-needed, or something going wrong with the spec file?  Any help would be greatly appreciated...  5:)
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-11-15 16:40:00 UTC
Read here, I wrote about this issue (which is all too common) . The problem is that libcrypto is the one needed, not libssl, and thus --as-needed drops -lssl out.
Comment 4 Mike Auty (RETIRED) gentoo-dev 2008-11-17 17:06:28 UTC
Ok, 3.0.1-r2 was just committed to the tree and should fix this issue.  I've removed the samdump2 program, since it's used as a library in the latest version and therefore doesn't need additional packaging/installing.

Please feel free to re-open this bug if you come across any other as-needed issues with ophcrack...