RFC: libtool updates and improved Nix/NixOS support

For those who previously used libtool or currently use it you are likely aware that it has gone unmaintained for the last few years and as a result it has become somewhat painful for creating modern ELF shared objects. On the other hand it’s core design and interfaces have incredible potential if they could get a few updates.

With that in mind I’m happy to announce that I was recently approved to become the new maintainer of libtool and plan to expand its features for creating modern shared libraries.

I wanted to create a request for comment discussion for folks to submit suggestions for features they would like to see added.

Currently I plan to incorporate existing patch requests to avoid over-linking, as well as improve the usefulness of .la files incorporating native compatibility with pkg-config . Additionally I plan to add support for use of $ORIGIN in RPATH and RUNPATH , and handling for dependency cycles in shared objects ( which properly manage TLS optimizations ).

As a NixOS user myself, one of the first patches I will be applying is fixing hard coded references to /usr/bin/file in libtool which cause a large number of test failures on NixOS systems. On this same subject I suspect there are several other hard coded paths that I will be tracking down and patching. Another patch which I expect will be useful to NixOS/Nix ( and a number of other package-managers ) is making the installation of .la files optional since in their current state they cause a lot of headaches and arbitrary restrictions on moving libraries in the filesystem ( ultimately I hope to make these handle movement more flexibly, but for now I think it’s best to make their use optional ).

Aside from that I invite anyone to submit ideas.



This is great news! I have long thought the biggest problem with the Nix ecosystem is the fact that we have fairly little mindshare among widely used “upstream” projects. Thank you for helping fix this!


I suppose one thing in nixpkgs that could benefit from an upstream remedy would be the need for fixLibtool in stdenv.

1 Like

Yeah I looked into that and patched some parts in the new 2.4.7 release.

I’ve also got libtool’s entire pipeline building in Hydra now.

For test cases there’s a NIX_DONT_FUCK_WITH_RPATH type flag that was the magic bullet along with “dont patch shebangs”. I’ve got two lingering tests to fix and then I plan to PR nixpkgs so it can test finally.

The fixLibtool one has parts that need to be done in cooperation with folks with more knowledge of the Nixpkgs bootstrap process since I think it has its own special libtool handling in different stages. Honestly I’m more wary of messing with that part of nixpkgs because folks will come at me with pitchforks if I slip up.


Honestly I’m more wary of messing with that part of nixpkgs because folks will come at me with pitchforks if I slip up.

Oh please don’t be. Whoever else that merges your PRs would be the responsible. Upstream is still the source of truth, remember, and you are now upstream, so I am sure things can be worked out.

1 Like