Check out my first novel, midnight's simulacra!

Libc: Difference between revisions

From dankwiki
No edit summary
No edit summary
Line 43: Line 43:
* be linked with -rdynamic/--export-dynamic, and
* be linked with -rdynamic/--export-dynamic, and
* provide frame pointers (none for inlined code, omitted with most [[gcc]] optimization levels)
* provide frame pointers (none for inlined code, omitted with most [[gcc]] optimization levels)
==Using an alternate Glibc==
So you've installed a local build of Glibc to, say, $HOME/glibc, eh?
Trying to run with <tt>LD_LIBRARY_PATH=$HOME/glibc/lib</tt> will result in all dynamically-linked executables segfaulting immediately. That's because they're using a mismatched loader. Try running the correct loader directly to sanity-check your library install, e.g.:
<pre>
[schwarzgerat](0) $ /bin/echo
Segmentation fault (core dumped)
[schwarzgerat](139) $ ~/glibc/lib/ld-linux-x86-64.so.2 /bin/echo this will work
this will work
[schwarzgerat](0) $
</pre>