Setting up libc6 sources for analysis on Debian/Ubuntu

I used to work on development of a tracing tool at work, that required me reading some glibc code to understand internals of core library functions (following the “Use the source, Luke” Open Source principle for developer documentation). I use Ubuntu, so it seemed simpler to use its glibc sources so I don’t have to recompile glibc myself. Here are the instructions I use for setting up my environment for glibc code navigation (tested on Hardy running on x86):

# gcc 4.2 is required to configure libc6
$ sudo apt-get install build-essential gcc-4.2

# download sources
$ sudo apt-get source libc6
$ cd glibc-2.6.1/

# the "configure_i686" rule also calls other rules that
# unpack the sources and apply distro-specific patches
$ ./debian/rules configure_i686

# create a tags file to easily navigate between functions with Vim
$ cd build-tree/glibc-2.6.1/ && ctags -R --exclude=.pc

About lizardo

My hobby: figure out how systems are expected to work; induce them to work unexpectedly; and responsibly disclose.
This entry was posted in Debian/Ubuntu, Linux. Bookmark the permalink.

One Response to Setting up libc6 sources for analysis on Debian/Ubuntu

  1. Pingback: Unix/Linux:How to unpack libc6 source on Hardy using debian/rules? – Unix Questions

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s