Distribution-friendly projects Part 2
Distribution-friendly projects Part 2
Posted Apr 10, 2008 11:48 UTC (Thu) by nix (subscriber, #2304)Parent article: Distribution-friendly projects Part 2
A similar problem to your last one, which I've fixed in a dozen packages or so by now (all passed upstream) is when libtool-using projects put libraries in LDFLAGS or linker flags (of the type which should apply to everything, i.e. not -R, -Wl,Bdynamic, or -Wl,--as-needed et al) in LIBS. Because libtool automatically forces LDFLAGS in front of the filename list in the link line and LIBS to the end of that list, mixing up LDFLAGS and LIBS assignments can easily lead to things that don't link. (This is especially common if you're using a wrapper around the compiler, or a modified specs file, to add flags like --as-needed by default, so that your shared library doesn't get linked because its symbols weren't needed if it was linked 'too early' by being put in LDFLAGS rather than LIBS. Using --as-needed works pretty much all the time otherwise and reduces relocations significantly for some projects: the only things it breaks that I've found are the testsuites for glibc, prelink, and libtool, all of which test peculiar edge cases like linking to shared libraries containing no needed symbols but with constructors: --as-needed eliminates those libraries and the test fails. Real code pretty much never does this, so the solution is to turn off the --as-needed wrappers for those projects' testsuites only.)
