<story><title>Picking Glibc Versions at Runtime</title><url>https://blogsystem5.substack.com/p/glibc-versions-runtime</url></story><parent_chain></parent_chain><comment><author>wallstprog</author><text>If you&amp;#x27;re using dynamic linking, the following two tools will come in very handy:&lt;p&gt;- pldd (&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;man7.org&amp;#x2F;linux&amp;#x2F;man-pages&amp;#x2F;man1&amp;#x2F;pldd.1.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;man7.org&amp;#x2F;linux&amp;#x2F;man-pages&amp;#x2F;man1&amp;#x2F;pldd.1.html&lt;/a&gt;) shows the &lt;i&gt;actual&lt;/i&gt; dynamic libs linked into a running process.  (Contrast this with ldd, which shows what the dynamic libs &lt;i&gt;would be&lt;/i&gt; based on the current shell environment).&lt;p&gt;- libtree (&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;haampie&amp;#x2F;libtree&quot;&gt;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;haampie&amp;#x2F;libtree&lt;/a&gt;) which shows dependencies similarly to ldd, but in tree format.</text></comment>
<story><title>Picking Glibc Versions at Runtime</title><url>https://blogsystem5.substack.com/p/glibc-versions-runtime</url></story><parent_chain></parent_chain><comment><author>theamk</author><text>There are ways to switch glibc other than &amp;quot;rewrite every binary&amp;quot; and &amp;quot;full-on containers&amp;quot;.&lt;p&gt;In particular, if you need to replace not just glibc, but also a bunch of system libraries (pretty common case for complex apps), it&amp;#x27;s often easier to unshare(CLONE_NEWNS), followed by bind-mounting over new &amp;#x2F;lib64 and &amp;#x2F;usr&amp;#x2F;lib to override specific directories. This is much lighter than full-on containers, and allows overriding any specific directories - for example if your app looks at &amp;#x2F;usr&amp;#x2F;share&amp;#x2F;appname, you can override it too.&lt;p&gt;This method has a bunch of upsides: you can use binaries unmodified, subprocesses work, and hard-coded data locations can be taken care of as well.</text></comment>