Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 246902 - app-misc/beanstalkd: fails with forced --as-needed
Summary: app-misc/beanstalkd: 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: Caleb Tennis (RETIRED)
URL: http://www.gentoo.org/proj/en/qa/asne...
Whiteboard:
Keywords:
Depends on:
Blocks: as-needed
  Show dependency tree
 
Reported: 2008-11-15 14:31 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2009-06-02 10:40 UTC (History)
0 users

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


Attachments
Build log (app-misc:beanstalkd-1.0:20081115-072246.log,2.51 KB, text/plain)
2008-11-15 14:31 UTC, Diego Elio Pettenò (RETIRED)
Details
Patch to beanstalkd-1.0.ebuild to fix several QA issues in upstream Makefile (beanstalkd.ebuild.patch,809 bytes, patch)
2009-02-14 21:08 UTC, Kevin Pyle
Details | Diff

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 14:31:22 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 14:31:33 UTC
Created attachment 171853 [details]
Build log
Comment 2 Caleb Tennis (RETIRED) gentoo-dev 2008-11-23 23:50:45 UTC
Note to self: this seems to get fixed by moving -levent to the end of the link line

cc -Wl,-O1 -levent  beanstalkd.o conn.o job.o ms.o net.o pq.o prot.o tube.o util.o   -o beanstalkd

becomes

cc -Wl,-O1 beanstalkd.o conn.o job.o ms.o net.o pq.o prot.o tube.o util.o   -o beanstalkd -levent
Comment 3 Kevin Pyle 2009-02-14 21:08:41 UTC
Created attachment 182052 [details, diff]
Patch to beanstalkd-1.0.ebuild to fix several QA issues in upstream Makefile

This patch modifies the ebuild to fix several QA issues in the upstream Makefile.  The upstream Makefile does not set CC, nor does its build system have a way to determine the correct compiler name.  To address this, the patch adds a tc-export CC, as recommended in Diego's bug reports about various packages not respecting CC.  Next, as reported here, linking fails with --as-needed because the library is listed too early.  A sed transform replaces the assignment to LDFLAGS with one to LDLIBS, which resolves this issue.  Finally, though not specifically a QA issue, this patch changes a CFLAGS assignment in the upstream Makefile.  Originally, it did:

CFLAGS := $(CFLAGS) -O2

This forced the package to compile with -O2, without regard to what the user put in CFLAGS in /etc/make.conf.  The sed expression changes it to:

CFLAGS := -O2 $(CFLAGS)

This keeps -O2 as a default if one is not specified, but allows CFLAGS from the user to choose a different optimization level if desired.

(In reply to comment #2)
Yes, that is the typical solution to this type of bug.
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-06-02 10:40:21 UTC
Given 1.2 uses autotools (and does not fail) I'd say this is done for. Thanks anyway Kevin! :)