Subject: [PATCH v2 0/4] Using 'ld.so.cache' to speed up application startup

From: Ludovic Courtès <[email-masked]>
Date: Sat, 28 Nov 2020 11:24:04 +0100

Hi!

This new version addresses the shortcomings I mentioned earlier and
other issues reported on IRC:

  • ld.so no longer uses “../etc/ld.so.cache”.  Instead, it (1) ensures
    $ORIGIN is in the store, (2) extracts the store file name, and
    (3) appends “/etc/ld.so.cache”.  IOW, the ‘ld.so.cache’ is always
    resolved relative to the store directory $ORIGIN belongs to, not
    relative to $ORIGIN itself.

    Thinking about it, it’s a direct translation of the ld.so.cache model
    from FHS to the functional model where a system-wide /etc/ld.so.cache
    makes no sense.

  • ‘make-dynamic-linker-cache’ now creates an ‘ld.so.conf’ that contains
    all the dependencies, recursively, as would be returned by ‘ldd’.
    The new ‘file-needed/recursive’ procedure returns the list of shared
    objects depended on like ‘ldd’.

  • ‘make-dynamic-linker-cache’ creates ‘ld.so.conf’ in $TMPDIR rather
    than hard-code /tmp, so as to be friendlier to ‘--disable-chroot’
    builds (as is currently used on GNU/Hurd).

I’m rather happy and confident with that version.  :-)

Feedback welcome!

Ludo’.

Ludovic Courtès (4):
  gremlin: Fix typo in docstring.
  gremlin: Add 'file-needed/recursive'.
  gnu: glibc: Load 'etc/ld.so.cache' in $ORIGIN's store item when
    available.
  build-system/gnu: Add 'make-dynamic-linker-cache' phase.

 gnu/local.mk                              |   1 +
 gnu/packages/base.scm                     |  16 +--
 gnu/packages/patches/glibc-dl-cache.patch | 140 ++++++++++++++++++++++
 guix/build-system/gnu.scm                 |   4 +
 guix/build/gnu-build-system.scm           |  68 +++++++++++
 guix/build/gremlin.scm                    |  43 ++++++-
 tests/gremlin.scm                         |  36 ++++++
 7 files changed, 297 insertions(+), 11 deletions(-)
 create mode 100644 gnu/packages/patches/glibc-dl-cache.patch

-- 
2.29.2