Skip to content

Delete more overridden libraries

Simon McVittie requested to merge wip/delete-more-overridden-libraries into master

Based on !185 (merged), please review that first. This is working towards !182 (closed). I want to land it relatively soon, partly for correctness, and partly so it won't conflict with refactoring runtime.c to have more/smaller functions - some of them are getting uncomfortably large.

Best reviewed commit-by-commit.

"Record known filenames of ld.so.cache on each architecture" is for !182 (closed), but it's just adding data to our table of known architectures, and if we land it a bit sooner than !182 (closed), it won't cause merge conflicts every time we touch something else in those structs.

/cc @denittis


  • runtime: Defer deletion of overridden libraries

    We need to do this after we have captured glibc-related libraries, otherwise they won't be taken into account while deleting their overridden equivalents.

  • runtime: Don't iterate over directories we already inspected

    If /lib and /usr/lib are the same file, there's no need to iterate over both.

  • runtime: Factor out multiarch_details_get_libdirs

    We return the library directories in most-important-first order here, because that seems like the one that makes most sense (and matches LD_LIBRARY_PATH). When we go looking for DRI drivers, we actually want to take the least important first, but iteration over a GPtrArray in reverse order is easy.

  • runtime: Delete overridden libraries from more directories

    In particular, when using a SDK runtime, we need to delete overridden 32-bit libraries from /lib32 as well as /lib/i386-linux-gnu.

  • runtime: Record known filenames of ld.so.cache on each architecture

  • tests: Assert that libraries are deleted from /usr/lib32 when necessary

Merge request reports