|Summary:||sys-fs/device-mapper ebuild fails with unresolved symbols with --as-needed and --no-undefined|
|Product:||Gentoo Linux||Reporter:||James C. Georgas <james.georgas>|
|Component:||New packages||Assignee:||Gentoo's Team for Core System packages <base-system>|
|Package list:||Runtime testing required:||---|
|Bug Depends on:|
Makefile patch to fix link order
ebuild patch to apply makefile patch
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) 2009-02-19 14:42:37 UTC
The patch looks good to me.