gcc and possibly binutils debug symbols are installed in wrong path (/usr/lib/debug/usr/lib) on amd64 multilib when using splitdebug feature. Valgrind searches for these symbols in /usr/lib/debug/usr/lib64 . There are 2 workarounds: 1. make symbolic links in /usr/lib/debug/usr/lib64 for every directory or file in /usr/lib/debug/usr/lib 2. for every directory or file in /usr/lib/debug/usr/lib move it to /usr/lib/debug/usr/lib64, rmdir /usr/lib/debug/usr/lib, make symbolic link /usr/lib/debug/usr/lib pointing to /usr/lib/debug/usr/lib64 Reproducible: Always Steps to Reproduce: 1. cat >main.cpp int main() { return 0; } 2. g++ -g -ggdb main.cpp 3. valgrind -v ./a.out 2>&1 | grep --after 1 libstdc++.so.6 Actual Results: --11960-- Reading syms from /usr/lib64/gcc/x86_64-pc-linux-gnu/4.4.4/libstdc++.so.6.0.13 (0x4e2c000) --11960-- object doesn't have a symbol table Expected Results: --17168-- Reading syms from /usr/lib64/gcc/x86_64-pc-linux-gnu/4.4.4/libstdc++.so.6.0.13 (0x4e2c000) --17168-- Reading debug info from /usr/lib/debug/usr/lib64/gcc/x86_64-pc-linux-gnu/4.4.4/libstdc++.so.6.0.13.debug .. --17168-- Reading syms from /lib64/libm-2.12.1.so (0x515d000) Portage 2.1.9.2 (hardened/linux/amd64/10.0, gcc-4.4.4, glibc-2.12.1-r1, 2.6.35-gentoo-r5 x86_64) ================================================================= System uname: Linux-2.6.35-gentoo-r5-x86_64-Intel-R-_Core-TM-_i5_CPU_M_430_@_2.27GHz-with-gentoo-2.0.1 Timestamp of tree: Fri, 10 Sep 2010 11:00:01 +0000 app-shells/bash: 4.1_p7 dev-java/java-config: 2.1.11 dev-lang/python: 2.6.5-r3, 3.1.2-r4 dev-util/cmake: 2.8.1-r2 sys-apps/baselayout: 2.0.1 sys-apps/openrc: 0.6.3 sys-apps/sandbox: 2.3-r1 sys-devel/autoconf: 2.13, 2.67 sys-devel/automake: 1.4_p6-r1, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1 sys-devel/binutils: 2.20.1-r1 sys-devel/gcc: 4.3.5, 4.4.4-r1 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.10 sys-devel/make: 3.81-r2 virtual/os-headers: 2.6.35 (sys-kernel/linux-headers) ACCEPT_KEYWORDS="amd64 x86 ~amd64 ~x86" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -g -ggdb" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config /var/lib/hsqldb /var/spool/torque" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/portage /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -pipe -g -ggdb" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--with-bdeps y" FEATURES="assume-digests distlocks fixlafiles fixpackages metadata-transfer news parallel-fetch protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="pl_PL.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="pl en" MAKEOPTS="" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage /var/lib/layman/haskell /usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X acl acpi alsa amd64 apm avahi bash-completion berkdb bluetooth bzip2 cairo caps cli consolekit cracklib crypt cups cxx dbus device-mapper dhcpcd dnotify dri exif fftw fontconfig fuse gadu gdbm gg gif gnome gnome-keyring gnutls google-gadgets gphoto2 gpm gstreamer gtk hal hardened hscolour iconv inotify jack java jpeg justify kde laptop latex libedit libnotify mailwrapper mmx mmxext modules mono moonlight mp3 mpi mpi-threads mudflap multilib multimedia mysql ncurses network networkmanager nls nptl nptlonly nsplugin openexr opengl openmp pam pcre perl phonon pic plasma png policykit postgres pppd python qt3support qt4 readline reflection semantic-desktop session skey smp sqlite sse sse2 sse3 ssl startup-notification svg sysfs tcl tcpd threads tiff truetype udev unicode upnp urandom usb utf-8 utf8 v4l2 vim-syntax webcam webkit xcb xinerama xml xmlpatterns xorg xpm xulrunner zlib" ALSA_CARDS="hdsp hdspm emu10k1x emu10k1 maestro3 ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias auth_digest" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl en" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia nv fbdev nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
they're in lib64 for me.
sorry ignore that comment.
we set LIBPATH like so: 105: LIBPATH=${TOOLCHAIN_LIBPATH:-${PREFIX}/lib/gcc/${CTARGET}/${GCC_CONFIG_VER}} and later call prepstrip with: 1833: env RESTRICT="" CHOST=${CTARGET} prepstrip "${D}${LIBPATH}" it seems we're purposely not using $(get_libdir) for the former, since if GCC_VAR_TYPE="non-versioned" we do use it.
Yes, debug symbols for sys-devel/gcc are installed exactly in: /usr/lib/debug/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/* when every other package (except sys-devel/binutils AFAIK) installs them in: /usr/lib/debug/usr/lib64/* and valgrind searches for them in: /usr/lib/debug/usr/lib64/* (for sys-devel/gcc it is: /usr/lib/debug/usr/lib64/gcc/x86_64-pc-linux-gnu/4.4.4/* ) So either toolchain.eclass should be fixed to install debug symbols in /usr/lib/debug/usr/lib64/* or valgrind patched to search for them also in /usr/lib/debug/usr/lib/* or both.
toolchain.eclass has nothing to do with installation of .debug files the setting of LIBPATH has historically been that way and no one complained, so no one bothered "fixing" it. would have to experiment a little to see if changing it would cause trouble.
i question whether this makes sense to bother with. this dir is only holding the gcc internal files, not the system libs. it handles multilib itself: /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/ - root dir for native multilib (amd64) |--- 32/ - root dir for ABI=x86 `--- x32/ - root dir for ABI=x32