This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to build Debug version of glibc


On Tue, Dec 9, 2008 at 8:24 PM, "Chen (陈) Jun (军)" <chjfth@gmail.com> wrote:
> Thank you Carlos, but there is still one question remain. What is the
> proper and conventional way to install a debug version and release
> version of glibc side by side, and when calling gcc to link an
> executable, how should I tell gcc which version of glibc to link?

There is no standardized method for distributing debug libraries. It
could be added to the LSB specification, but it has not been done.

Debian setup:
1. Build and install normal stripped libraries in /lib and /usr/lib
2. Build and install debug libraries in /usr/lib/debug/lib and
/usr/lib/debug/usr/lib

Using Debian debug libraries:
1. Build application normally.
2. Run binary with LD_LIBRARY_PATH env var set to debug library paths.

Fedora core:
1. Build and install normal stripped libraries in /lib and /usr/lib
2. Store stripped debug information in /usr/lib/debug/*.debug files.
3. Store source code related to package (for source debugging) in
/usr/src/debug/*

Using Fedora core debug libraries:
1. Run binary as normaly, the FC debugger is responsible for loading
the *.debug files that match the DSO.

> Microsoft does this by naming his debug/release CRT library different
> names(the importlibs named MSVCRTD.LIB vs MSVCRT.LIB), and provides
> compiler options -MDd vs -MD; these options puts in obj a linker
> directive( -defaultlib:MSVCRTD vs -defaultlib:MSVCRT) so different
> flavor of the CRT gets linked.

The Linux dynamic loader can do this at runtime with LD_LIBRARY_PATH.

> I think installing a debug version of glibc side by side with the
> pre-installed one is important, otherwise, I have to overwrite the
> pre-installed one provided by Linux distribution, which may cause the
> danger of failing some pre-installed software in my Linux box to fail,
> right?

No. The debug libraries should be ABI and API compatible with the
normal libraries.

Cheers,
Carlos.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]