This is especially important for libstdc++ on distributions that don't have it directly in a libdir and the runtime linker doesn't look where needed without /etc/ld.so.cache (e.g. if libstdc++ is in a GCC per-version subdirectory handled via /etc/ld.so.conf.d/).
If /etc/ld.so.cache is not available, the runtime linker will look only at a set of predetermined paths - as seen with LD_DEBUG=libs added to the bwrap call with "--setenv LD_DEBUG libs":
find library=libstdc++.so.6 ; searching search cache=/etc/ld.so.cache search path=/lib64:/usr/lib64 (system search path) trying file=/lib64/libstdc++.so.6 trying file=/usr/lib64/libstdc++.so.6
/usr/bin/totem-video-thumbnailer: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
If /etc/ld.so.cache is available, it will use that for the paths:
find library=libstdc++.so.6 ; searching search cache=/etc/ld.so.cache trying file=/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/libstdc++.so.6
By bind mounting just that file out of /etc, we get it to work on such a system.
Closes: #81 (closed)