Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 259569 - sys-fs/device-mapper ebuild fails with unresolved symbols with --as-needed and --no-undefined
Summary: sys-fs/device-mapper ebuild fails with unresolved symbols with --as-needed an...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: as-needed
  Show dependency tree
 
Reported: 2009-02-19 08:32 UTC by James C. Georgas
Modified: 2009-12-21 13:26 UTC (History)
2 users (show)

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


Attachments
Makefile patch to fix link order (device-mapper-1.02.28-makefile.diff,435 bytes, patch)
2009-02-19 08:34 UTC, James C. Georgas
Details | Diff
ebuild patch to apply makefile patch (device-mapper-1.02.28.ebuild.diff,436 bytes, patch)
2009-02-19 08:34 UTC, James C. Georgas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James C. Georgas 2009-02-19 08:32:59 UTC
device-mapper ebuild fails with unresolved symbols with --as-needed and --no-undefined

The problem is that the one of the makefiles puts the libraries before the regular objects on the link command line. --as-needed seems to scan the command line from left to right, so it ends up stripping out all the libraries that the regular objects reference. Luckily, I have --no-undefined in my linker options, and this caught the problem.

Here is a patch for Makefile.in, which fixes the problem, and also a patch for the device-mapper-1.02.28.ebuild, to apply the patch.

Reproducible: Always

Steps to Reproduce:
1. add --as-needed and --no-undefined to your linker options
2. emerge device-mapper
3. observe stream of undefined reference errors.

Actual Results:  
emerge fails with unsuccessful link step for libdevmapper-event.so

Expected Results:  
successful emerge

Not sure if this is a bug in the makefile or in the linker. Maybe --as-needed shouldn't be so picky about the order. Either way, it's gotta go upstream. In the meantime, these patches should make it work.
Comment 1 James C. Georgas 2009-02-19 08:34:21 UTC
Created attachment 182518 [details, diff]
Makefile patch to fix link order
Comment 2 James C. Georgas 2009-02-19 08:34:57 UTC
Created attachment 182520 [details, diff]
ebuild patch to apply makefile patch
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2009-02-19 14:42:37 UTC
The patch looks good to me.
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2009-12-21 13:26:01 UTC
+  21 Dec 2009; Samuli Suominen <ssuominen@gentoo.org>                                                                              
+  device-mapper-1.02.28.ebuild, +files/device-mapper-1.02.28-asneeded.patch:                                                       
+  Fix building with -Wl,--as-needed wrt #259569 by James C. Georgas.