Search code examples
linuxgcccompilationlinkerglibc

Compiling glibc from source with debug symbols


I need to compile glibc from source with debug symbols.

  1. Where do I specify the -g option for this?
  2. How do I later make a sample code link to this particular glibc rather than the one installed on my system?

Solution

  • I need to compile glibc from source with debug symbols

    You will have hard time compiling glibc without debug symbols. A default ./configure && make will have -g on compile line.

    How do i later make a sample code link to this particular glibc rather than the one installed on my system?

    This is somewhat tricky, and answered here.