Subject: [bug#41189] [PATCH 0/3] Add Fakechroot engine for 'guix pack -RR'

From: Carlos O'Donell <[email-masked]>
Date: Tue, 12 May 2020 08:09:53 -0400

On 5/12/20 6:03 AM, Ludovic Courtès wrote:
> One thing that won’t work is dlopen because our ‘--library-path’
> argument is computed statically based on the RUNPATH of the wrapped
> program.  So for instance if you try to load guile-readline.so from
> Guile, it eventually fails because libreadline.so isn’t found
> (libreadline.so is in the RUNPATH of guile-readline.so, but the loader
> uses non-interposable calls here as well.)  Probably no simple solution
> to that one.

There is a simple solution. You need to write a dynamic loader audit module
that handles la_objsearch() and inject your lookup path. See man 7 rtld-audit.
The dynamic loader audit modules allow you to alter the loader's core behaviour
with a plugin.

-- 
Cheers,
Carlos.