This Time Self-Hosted
dark mode light mode Search

Summing up the binutils trouble

Let’s sum up the binutils trouble with KDE and with other bugs too.

For a bug in 2.16.92 and 2.16.93 versions of binutils, the –as-needed flag ended up doing something more than is documented, instead of simply skipping DT_NEEDED entries, it also discarded the search path for the libraries passed in command line that get discarded.

If from one side this can be seen as a correct behaviour, this broke with almost every build system, like for instance everything using libtool. It broke in the sense that it ended up looking up the libraries installed in the system rather than the ones just build, failing to find them if they weren’t installed and cross-linking them if they were. The result is not good.

Luckily there is a patch laying in binutils-devel mailing list and it has been committed hopefully for 2.17. In the mean time you have either to cope with the problem or simply use my overlay and use binutils that are there. They are already patched for -Bdirect and -hashvals support (the latter more to avoid breakages).

I might end up closing some bugs pointing to this blog post as it’s boring to repeat the same stuff too many times 😉

Comments 4
  1. If from one side this can be seen as a correct behaviour, this broke with almost every build system, like for instance everything using libtool.

    I’d like to point out again that GNU libtool didn’t have a problem with it. It’s only KDE libtool that broke. 🙂 Out of curiosity, what non-KDE build systems broke because of it?

  2. Urm, no, also older versions of libtool are broken. Plus e2fsprogs’s and ffmpeg’s build systems (ffmpeg’s is fixed now).I think jakub found also a couple of other bugs caused by this.

  3. Urm, no, also older versions of libtool are broken.

    libtool itself had for as far as I could track back always built libraries with the compilation directory passed via the -rpath option, so that binutils would use the compiled lib instead of the already installed lib for linking, regardless of which -L options are used. Thanks for the packages, I’ll check if it’s libtool in some other way, or if it’s improper use of it, that caused the failures.

  4. Having looked at both e2fsprogs and ffmpeg now: neither uses libtool, and the fixes for both do just what libtool already does 🙂 (And I should’ve said -rpath-link instead of -rpath.)

Leave a Reply to Harald van DijkCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.