title: How to build glibc with modified malloc which uses shm_open()?
body: <p>I am modifying the <code>malloc.c</code> and <code>hooks.c</code> file in <code>glibc</code> library and my modification uses <code>shm_open()</code>.</p>
  
  <p>Now to build <code>glibc</code>, the <a href="http://man7.org/linux/man-pages/man3/shm_open.3.html" rel="nofollow noreferrer">Man page</a> of <code>shm_open()</code> says that I need to <strong>link with -lrt</strong>.</p>
  
  <p>The problem that I am facing is, as far as I know, <code>librt</code> is produced during the build process of <code>glibc</code>. How can I modify the makefile(s) to build <code>glibc</code> and also link <code>librt</code>?</p>
  
  <p>Or is there any other way to achieve this?</p>