BTW, what faketime itself seems to do is
LD_PRELOAD='/usr/$LIB/faketime/libfaketime.so.1'
is this a trick, does the dynamic linker interpret a literal $LIB?
(found this out with
$ faketime 0 'sh' '-c' env |grep LD_PRELOAD
LD_PRELOAD=/usr/$LIB/faketime/libfaketime.so.1
)
if that works there's no need for guessing!
apparently it is documented: from man ld.so:
LD_PRELOAD
...
Within the names specified in the LD_PRELOAD list, the dynamic linker understands the
tokens $ORIGIN, $LIB, and $PLATFORM (or the versions using curly braces around the names)
as described above in Rpath token expansion. (See also the discussion of quoting under
the description of LD_LIBRARY_PATH.)