User: Password:
Subscribe / Log in / New account

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.)

(Log in to post comments)

Distribution-friendly projects Part 2

Posted Apr 12, 2008 2:43 UTC (Sat) by dirtyepic (subscriber, #30178) [Link]

Being a source distro with a hyperactive userbase can actually be beneficial in some rare cases, like smoking out problems in new territory like this. The number of --as-needed related issues that have been identified, fixed, and pushed upstream (a large part of which are a result of Diego's efforts), is impressive.

I'd like to say, I wouldn't mind seeing a complement to this series - Project-friendly Distributions - describing things that distros can do to make upstream's lives a little easier as well.

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds