Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 114407 - valgrind 3.1.0 fails to emerge due to incompatible libgcc
Summary: valgrind 3.1.0 fails to emerge due to incompatible libgcc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Maurice van der Pot (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-03 18:50 UTC by Scott Robert Ladd
Modified: 2006-03-07 10:40 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
really hackishly ugly temporary quickfix (configure.patch,302 bytes, patch)
2006-02-20 15:03 UTC, Marco Matthies
Details | Diff
ebuild with the fix for amd64 no-multilib (valgrind-3.1.0-r1.ebuild,2.31 KB, text/plain)
2006-02-21 07:18 UTC, Marco Matthies
Details
valgrind-3.1.0-amd64-nomultilib-uglyfix.patch (valgrind-3.1.0-amd64-nomultilib-uglyfix.patch,302 bytes, patch)
2006-02-21 07:19 UTC, Marco Matthies
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Robert Ladd 2005-12-03 18:50:22 UTC
Note to Jakub: Before you do your usual "toss out Scott's bugs", this is NOT the
same as bug 114347.

valigrind 3.1.0 failed to emerge on my system with the following errors:

ar  clq libvex.a priv/ir/irdefs.o priv/ir/irmatch.o priv/ir/iropt.o
priv/main/vex_main.o priv/main/vex_globals.o priv/main/vex_util.o
priv/host-x86/hdefs.o priv/host-amd64/hdefs.o priv/host-arm/hdefs.o
priv/host-ppc32/hdefs.o priv/host-x86/isel.o priv/host-amd64/isel.o
priv/host-arm/isel.o priv/host-ppc32/isel.o priv/host-generic/h_generic_regs.o
priv/host-generic/h_generic_simd64.o priv/host-generic/reg_alloc2.o
priv/guest-generic/g_generic_x87.o priv/guest-generic/bb_to_IR.o
priv/guest-x86/ghelpers.o priv/guest-amd64/ghelpers.o priv/guest-arm/ghelpers.o
priv/guest-ppc32/ghelpers.o priv/guest-x86/toIR.o priv/guest-amd64/toIR.o
priv/guest-arm/toIR.o priv/guest-ppc32/toIR.o
mv -f libvex.a libvex_x86_linux.a
make[4]: Leaving directory `/var/tmp/portage/valgrind-3.1.0/work/valgrind-3.1.0/VEX'
x86_64-pc-linux-gnu-gcc  -m64 -fomit-frame-pointer  -O -g -Wmissing-prototypes
-Winline -Wall -Wshadow -Wpointer-arith -Wstrict-prototypes
-Wmissing-declarations -O2 -march=opteron -pipe -fno-pie -Wno-long-long
-Wdeclaration-after-statement   -o memcheck-x86-linux -static
-Wl,-defsym,valt_load_address=0x70000000 -nodefaultlibs -nostartfiles -u _start
-m32 -Wl,-T,../valt_load_address_x86_linux.lds
memcheck_x86_linux-mac_leakcheck.o memcheck_x86_linux-mac_malloc_wrappers.o
memcheck_x86_linux-mc_main.o memcheck_x86_linux-mac_shared.o
memcheck_x86_linux-mc_translate.o ../coregrind/libcoregrind_x86_linux.a
../VEX/libvex_x86_linux.a -lgcc
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld:
skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/./libgcc.a when
searching for -lgcc
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld:
skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/libgcc.a when
searching for -lgcc
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld:
skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/./libgcc.a when
searching for -lgcc
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld:
skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/libgcc.a when
searching for -lgcc
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld:
cannot find -lgcc
collect2: ld returned 1 exit status
make[3]: *** [memcheck-x86-linux] Error 1
make[3]: Leaving directory
`/var/tmp/portage/valgrind-3.1.0/work/valgrind-3.1.0/memcheck'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
`/var/tmp/portage/valgrind-3.1.0/work/valgrind-3.1.0/memcheck'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/valgrind-3.1.0/work/valgrind-3.1.0'
make: *** [all] Error 2

My system is:

Portage 2.0.53 (default-linux/amd64/2005.1/no-multilib, gcc-3.4.4,
glibc-2.3.6-r1, 2.6.14-gentoo x86_64)
=================================================================
System uname: 2.6.14-gentoo x86_64 AMD Opteron(tm) Processor 246
Gentoo Base System version 1.12.0_pre11
dev-lang/python:     2.3.5, 2.4.2
sys-apps/sandbox:    1.2.16
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r1
sys-devel/libtool:   1.5.20-r1
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=opteron -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env
/usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib64/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-O2 -march=opteron -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo
http://gentoo.mirrors.pair.com/ ftp://gentoo.mirrors.pair.com/
http://mirror.datapipe.net/gentoo http://mirror.datapipe.net/gentoo
ftp://ftp.ussg.iu.edu/pub/linux/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/scott/projects/ebuilds"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X acl alsa apache2 arts audiofile avi berkdb bitmap-fonts
browserplugin bzip2 cdr crypt cups curl doc dvd eds effects emboss encode esd
exif expat fam ffmpeg firefox flac font-server foomaticdb fortran gd gdbm gif
gimpprint glut gmp gnome gpm grammar gstreamer gtk gtk2 guile hal idn
imagemagick imlib ipv6 jpeg junit kde lcms libwww lm-sensors lua lzw lzw-tiff
mad math mikmod mjpeg mng motif mozilla mozsvg mp3 mpeg ncurses nls nptl ogg
oggvorbis openal opengl pam pcre pdf pdflib perl plotutils plugin png povray
ppds python qt quicktime readline samba sdk sdl slang smp spell ssl svg tcltk
tcpd tetex theora thesaurus threads tiff truetype truetype-fonts type1
type1-fonts udev usb userlocales vorbis wmf xml xml2 xmms xpm xscreensaver xv
xvid zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
Comment 1 Maurice van der Pot (RETIRED) gentoo-dev 2005-12-04 02:18:33 UTC
Oops, nm me
Comment 2 Maurice van der Pot (RETIRED) gentoo-dev 2006-01-26 10:56:52 UTC
Have you remerged/upgraded gcc in the mean time? Is this still an issue right now?
Comment 3 Scott Robert Ladd 2006-01-27 09:07:59 UTC
(In reply to comment #2)
> Have you remerged/upgraded gcc in the mean time? Is this still an issue right
> now?

I emerge GCC 4.0.2 some time back, and the problem persists (I reported the error while running GCC 3.4.4). I just tried emerging valgrind again, with the same failure.
Comment 4 Marco Matthies 2006-02-20 12:42:46 UTC
(In reply to comment #0)
[snip]
> x86_64-pc-linux-gnu-gcc  -m64 -fomit-frame-pointer  -O -g -Wmissing-prototypes
> -Winline -Wall -Wshadow -Wpointer-arith -Wstrict-prototypes
> -Wmissing-declarations -O2 -march=opteron -pipe -fno-pie -Wno-long-long
> -Wdeclaration-after-statement   -o memcheck-x86-linux -static
> -Wl,-defsym,valt_load_address=0x70000000 -nodefaultlibs -nostartfiles -u _start
> -m32 -Wl,-T,../valt_load_address_x86_linux.lds
> memcheck_x86_linux-mac_leakcheck.o memcheck_x86_linux-mac_malloc_wrappers.o
> memcheck_x86_linux-mc_main.o memcheck_x86_linux-mac_shared.o
> memcheck_x86_linux-mc_translate.o ../coregrind/libcoregrind_x86_linux.a
> ../VEX/libvex_x86_linux.a -lgcc
> /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld:
> skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/./libgcc.a when
> searching for -lgcc
[/snip]

The command invoked has -m64 and -m32 and -m32 comes last, building a 32-bit binary, while libgcc afaik is only built 64-bit.  I unfortunately do not know where the -m32 is coming from though.
Comment 5 Marco Matthies 2006-02-20 15:03:14 UTC
Created attachment 80322 [details, diff]
really hackishly ugly temporary quickfix

Ok, i think i found out a bit more about valgrind today :)
Apparently, valgrind assumes that when it's running on amd64 it will be able to compile it's libs for x86 as well, but this fails on the no-multilib profile due to the 32-bit libs not being built (ok this is my working assumption here, please correct me if i'm wrong).  The attached patch is just a quick band-aid for Scott to try out, the proper fix would be to add a switch to configure to tell it to not build 32-bit code on amd64 and activate that switch in the ebuild for the no-multilib case.  Unfortunately, my autoconf-fu is not good enough yet to produce that patch, so this is all i can offer at the moment.
Comment 6 Marco Matthies 2006-02-21 07:18:18 UTC
Created attachment 80364 [details]
ebuild with the fix for amd64 no-multilib

Valgrind svn has a fix for this already, configure --enable-only64bit.  Unfortunately some other things seem to have changed in the build system as well, so until the next version fixes this problem, the current hackish fix might suffice.  This ebuild applies the ugly workaround on amd64 no-multilib -- does this fix your problem, Scott?
Comment 7 Marco Matthies 2006-02-21 07:19:46 UTC
Created attachment 80365 [details, diff]
valgrind-3.1.0-amd64-nomultilib-uglyfix.patch
Comment 8 Maurice van der Pot (RETIRED) gentoo-dev 2006-03-06 13:13:20 UTC
Marco, have you been able to check if the patch worked for you?
If not I'll wait for Scott to confirm.
Comment 9 Scott Robert Ladd 2006-03-06 15:13:08 UTC
Yes, the patch appears to solve my problem. Thanks!

My apologies for being slow in repsonding; I've been doing a lot of traveling.
Comment 10 Marco Matthies 2006-03-06 16:00:51 UTC
(In reply to comment #8)
> Marco, have you been able to check if the patch worked for you?
> If not I'll wait for Scott to confirm.

Sorry for not giving more info about this earlier, i have been testing this patch on an amd64-nomultilib install running under qemu, and there valgrind compiled with this patch but did not run correctly (triggered an assertion in valgrind, e.g. when running valgrind on /bin/ls or hello-world).

Just now i've also tested this on my normal amd64-multilib install (by making the patch apply unconditionally and not just for nomultilib) and it compiles and seems to run fine.

So, i guess i can write this one off as a qemu error if everything compiles and runs fine for Scott.
Comment 11 Maurice van der Pot (RETIRED) gentoo-dev 2006-03-07 10:40:26 UTC
My thanks to both of you. I just checked in the fix.