With portage (2.0.50-r1), one cannot build glibc (2.3.3_pre20040207) with debugging symbols--let alone without having glibc's libraries stripped. Select contents from /etc/make.conf USE=".... debug ..." FEATURES+=nostrip DEBUGBUILD=1 nm /lib/libthread_db-1.0.so #part of glibc /lib/libthread_db-1.0.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped Reproducible: Always Steps to Reproduce: 1. Set USE="DEBUG" 2. Set FEATURES+=nostrip 3. Set DEBUGBUILD=1 4. Emerge glibc Actual Results: 1. nm /lib/libthread_db-1.0.so #Stripped, when it should not be stripped Expected Results: Unstripped /lib/libthread_db-1.0.so To compensate for these problems, I had to modify the stripping mechanisms contained in /usr/lib/portage/bin gorbachev pkg # emerge info Portage 2.0.50-r1 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3_pre20040207-r0, 2.6.4-gentoo-r1) ================================================================= System uname: 2.6.4-gentoo-r1 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 2.40GHz Gentoo Base System version 1.4.3.13p1 Autoconf: sys-devel/autoconf-2.59-r3 Automake: sys-devel/automake-1.8.3 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="http://128.213.5.34/gentoo/ ftp://vlaai.snt.ipv6.utwente.nl/pub/os/linux/gentoo/ http://open-systems.ufl.edu/mirrors/gentoo http://mirrors.tds.net/gentoo ftp://ftp.ipv6.uni-muenster.de/pub/linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X Xaw3d aalib acpi aim alsa apm arts avi berkdb bonobo cdr crypt cups debug dga doc dvd dvdr emacs encode esd ev6 evo fam fbcon flac flash foomaticdb gb gdbm ggi gif gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml icq imagemagick imap imlib ipv6 jabber java jpeg kde lesstif libg++ libwww mad maildir mbox mikmod mmx motif mozilla mpeg msn nas ncurses nls oggvorbis opengl oscar oss pam pcmcia pdflib perl png pnp ppds python qt quicktime readline samba scanner sdl slang spell sse ssl svga tcpd tetex threading threads tiff truetype unicode usb wmf wxwindows x86 xml2 xmms xv zlib" gorbachev pkg # gorbachev pkg # emerge info Portage 2.0.50-r1 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3_pre20040207-r0, 2.6.4-gentoo-r1) ================================================================= System uname: 2.6.4-gentoo-r1 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 2.40GHz Gentoo Base System version 1.4.3.13p1 Autoconf: sys-devel/autoconf-2.59-r3 Automake: sys-devel/automake-1.8.3 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="http://128.213.5.34/gentoo/ ftp://vlaai.snt.ipv6.utwente.nl/pub/os/linux/gentoo/ http://open-systems.ufl.edu/mirrors/gentoo http://mirrors.tds.net/gentoo ftp://ftp.ipv6.uni-muenster.de/pub/linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X Xaw3d aalib acpi aim alsa apm arts avi berkdb bonobo cdr crypt cups debug dga doc dvd dvdr emacs encode esd ev6 evo fam fbcon flac flash foomaticdb gb gdbm ggi gif gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml icq imagemagick imap imlib ipv6 jabber java jpeg kde lesstif libg++ libwww mad maildir mbox mikmod mmx motif mozilla mpeg msn nas ncurses nls oggvorbis opengl oscar oss pam pcmcia pdflib perl png pnp ppds python qt quicktime readline samba scanner sdl slang spell sse ssl svga tcpd tetex threading threads tiff truetype unicode usb wmf wxwindows x86 xml2 xmms xv zlib" gorbachev pkg #
I don't see why glibc should *ever* be stripped; stripped glibc makes it impossible to debug any threaded program (that is, if you set a breakpoint somewhere inside a child thread, gdb will get a SIGTRAP exception and quit instead of breaking at the breakpoint). I suggest adding RESTRICT="nostrip" to the ebuild.
Adding 'RESTRICT="nostrip"' is what I did to the ebuild to make debugging threaded programs possible. Unless there is a good reason not to, I would recommend adding it to the ebuild as well.
I personally kept banging my head against the wall for two months trying to figure out why I was unable to debug threaded programs, eventually to discover that a stripped glibc was the cause of the problem. This problem existed on RedHat in the past and being burnt, they no longer strip glibc. I would highly recommend adding the RESTRICT='nostrip' option to the glibc ebuild.
Yes, please, I would reiterate that this would be a good idea. I've built glibc a few times again and each time, sometime after, I try to debug a multi-threaded program and curse up a storm after I remember I need to change the ebuild, again.
*** This bug has been marked as a duplicate of 46186 ***