Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 246869 - app-crypt/ophcrack: fails with forced --as-needed
Summary: app-crypt/ophcrack: fails with forced --as-needed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Mike Auty (RETIRED)
URL: http://www.gentoo.org/proj/en/qa/asne...
Whiteboard:
Keywords:
Depends on:
Blocks: as-needed
  Show dependency tree
 
Reported: 2008-11-15 13:56 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2008-11-17 17:06 UTC (History)
0 users

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


Attachments
Build log (app-crypt:ophcrack-3.0.1-r1:20081114-220005.log,4.29 KB, text/plain)
2008-11-15 13:57 UTC, Diego Elio Pettenò (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
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 http://blog.flameeyes.eu/2008/11/14/problems-and-mitigation-strategies-for-as-needed for details).

Check the attached build log.

Thanks,
Diego
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 http://blog.flameeyes.eu/2008/10/15/fixing-cflags-ldflags-handling-with-a-single-boilerplate-makefile.

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) http://blog.flameeyes.eu/2008/11/15/building-the-whole-portage . 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...