Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 338738 - app-admin/gkrellm-2.3.4 does not respect --as-needed (but does respect position-insensitive LDFLAGS) [patch included]
Summary: app-admin/gkrellm-2.3.4 does not respect --as-needed (but does respect positi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Jim Ramsay (lack) (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on: 340113
Blocks:
  Show dependency tree
 
Reported: 2010-09-25 21:52 UTC by Kevin Pyle
Modified: 2010-10-31 14:37 UTC (History)
1 user (show)

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


Attachments
Patch to gkrellm-2.3.4.ebuild to sed upstream Makefiles to fix LDFLAGS ordering (gkrellm-2.3.4.ebuild.patch,429 bytes, patch)
2010-09-25 21:55 UTC, Kevin Pyle
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Pyle 2010-09-25 21:52:41 UTC
app-admin/gkrellm-2.3.4 uses the variable $LINK_FLAGS instead of the traditional $LDFLAGS to pass linker options.  Gentoo has an override in the calls to emake to include user LDFLAGS, and the upstream build rule does mention $(LINK_FLAGS) in its build of gkrellm and gkrellmd.  Unfortunately, it places $LINK_FLAGS at the end of the rule, so position-sensitive options like --as-needed appear after all the libraries that it could affect, rendering it useless.  Since LDFLAGS are used in the rule, position-insensitive options like --hash-style=gnu are respected and so Portage does not flag the file as ignoring LDFLAGS.  I will attach a minor ebuild patch that uses sed to reorder the rule so that the linker flags occur early enough in the link line.
Comment 1 Kevin Pyle 2010-09-25 21:55:25 UTC
Created attachment 248641 [details, diff]
Patch to gkrellm-2.3.4.ebuild to sed upstream Makefiles to fix LDFLAGS ordering

This patch swaps the order of "-o <OUTPUT> $(LIBS)" and "$LINK_FLAGS" so that the linker flags appear before $(LIBS).
Comment 2 Jim Ramsay (lack) (RETIRED) gentoo-dev 2010-10-31 14:32:18 UTC
It looks to me like gkrellm-2.3.5 support LDFLAGS at an appropriate location relative to $(LIBS), so this will be fixed in the next version bump.
Comment 3 Jim Ramsay (lack) (RETIRED) gentoo-dev 2010-10-31 14:37:43 UTC
2.3.5 is in the tree, which properly respects LDFLAGS in the right place, and (I believe) --as-needed works now.  Please reopen this bug if I am mistaken.