This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: How to build Debug version of glibc
- From: "Chen (陈) Jun (军)" <chjfth at gmail dot com>
- To: libc-help at sourceware dot org
- Date: Wed, 10 Dec 2008 09:24:23 +0800
- Subject: Re: How to build Debug version of glibc
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=CxMKSd435P3DYyssFFjkVTkgB0bttkhMJKelpAUL/Qc=; b=WF7TY7PQNwpGrfbQ4L6q4mKhFo3njOGHrw+MhTZ0PH0pkQfngLnDlmkUryJgSk3cnk Eu0rz+pFpZGv0DR8u+PNC/NTbmSzFjL1N3OJRucan2/9nCPV6yHhcGFUonM1yLSfMXWm LvrXfgbN4bUdfOvS/vslrQtcFFkJ5bkkkmthQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=WovnCP5M7xJHkwtFdb9ONyvD091oEWPoFlgUDDvwz/eDKSOX6XP6Dzhdsj9yrOeXAg ktJY3qLQ/ZTfpc43lTNv7owZy3XaYRgJjzOSgIf5j8y6YRvfddf+15gOiEziv3ViknqM yv/Tl3Aqk9brEvtt99Zz7UlRuFL2AR98Te2Cw=
- References: <493C7979.7050900@gmail.com> <119aab440812081611x7a281996o351ba3d2eef12905@mail.gmail.com>
Carlos O'Donell wrote:
> To build a debug version of glibc you must build with debugging
> enabled e.g. CFLAGS="-O2 -g" and CPPFLAGS="-O2 -g".
>
>
>> Some more questions I'm interested:
>>
>> 1. For glibc developers themselves, do they build debug versions of glibc?
>>
> I build glibc with the above makefile flags.
>
>
>> 2. If they do, how do they debug it, use command line gdb, or a GUI frontend
>> of gdb? If later, which do they use?
>>
> I primarily use command-line gdb to debug glibc.
>
> Cheers,
> Carlos.
>
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?
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.
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?