Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 318773 - sci-physics/root-5.26.00-r2 fails to build
Summary: sci-physics/root-5.26.00-r2 fails to build
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Science Physics related packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 318469
  Show dependency tree
 
Reported: 2010-05-06 17:39 UTC by Andrew Savchenko
Modified: 2010-08-10 20:29 UTC (History)
0 users

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


Attachments
build.log.bz2 (build.log.bz2,100.25 KB, application/octet-stream)
2010-05-06 17:44 UTC, Andrew Savchenko
Details
environment (environment,134.11 KB, text/plain)
2010-05-06 17:44 UTC, Andrew Savchenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Savchenko gentoo-dev 2010-05-06 17:39:10 UTC
Hello there,

root-5.26.00-r2 fails to build. Yes, again.

lib/libThread.so: undefined reference to `__sync_fetch_and_add_4'
collect2: ld returned 1 exit status

I have a strong dejavu feeling, this error was present is some earlier releases, will check for this later.

$ emerge --info
Portage 2.2_rc67 (default/linux/x86/10.0, gcc-4.4.3, glibc-2.11.1-r0, 2.6.33.3-yoruichi i686)
=================================================================
System uname: Linux-2.6.33.3-yoruichi-i686-AMD_Athlon-tm-_XP_3200+-with-gentoo-2.0.1
Timestamp of tree: Mon, 03 May 2010 11:15:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
ccache version 2.4 [enabled]
app-shells/bash:     4.1_p5
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r2, 3.1.2-r3
dev-python/pycrypto: 2.1.0
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.8.1-r1
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
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
sys-devel/gcc:       3.3.6-r1, 4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.33
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -m32 --param l1-cache-line-size=64 --param l1-cache-size=64 --param l2-cache-size=512 -O2 -funswitch-loops -fpredictiv
e-commoning -fgcse-after-reload -fomit-frame-pointer -ftree-loop-linear -floop-interchange -floop-strip-mine -mfpmath=sse -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-reb
uild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=athlon-xp -m32 --param l1-cache-line-size=64 --param l1-cache-size=64 --param l2-cache-size=512 -O2 -funswitch-loops -fpredict
ive-commoning -fgcse-after-reload -fomit-frame-pointer -ftree-loop-linear -floop-interchange -floop-strip-mine -mfpmath=sse -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going --with-bdeps y"
FEATURES="assume-digests ccache collision-protect distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict 
unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS="-march=athlon-xp -m32 --param l1-cache-line-size=64 --param l1-cache-size=64 --param l2-cache-size=512 -O2 -funswitch-loops -fpredictive-commoning -fgcse-after-reload -fomit-frame-pointer -ftree-loop-linear -floop-interchange -floop-strip-mine -mfpmath=sse -pipe"
GENTOO_MIRRORS=" ftp://orionis/distributions/1Linux/gentoo/portage ftp://ftp.chg.ru/pub/Linux/gentoo http://mirror.yandex.ru/gentoo-distfiles  ftp://ftp.corbina.net/pub/Linux/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo http://mirror.netcologne.de/gentoo"
LANG="en_US.UTF-8" 
LC_ALL=""
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="ru en ja" 
MAKEOPTS="-j4 --load-average=5"
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="/var/lib/layman/science /var/lib/layman/java-overlay /var/lib/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow X a52 aac aalib acl acpi adns afs aften aim aio alsa amr amrnb amrwb ao artworkextra audiofile bash-completion bcmath bidi binfilter blas bluetooth branding bzip2 cairo calendar canna caps ccache cddb cdinstall cdparanoia cdr chasen chm cjk cleartype cli clisp colordiff cracklib crypt cscope css ctype cups curl curlwrappers cvs cxx cyrillic dbus device-mapper dga dhcp dia dirac directfb djvu dmx doc dri dts dv dvd dvdr dvdread dvi ebook editor elf encode enscript ermt examples exif expat faac faad fbcon festival ffmpeg fftw firefox flac fontconfig foomaticdb fortran fpx freetds freetype ftp gallium gcj gcrypt gd gdbm geoip ggi gif gimp ginac git glibc-omitfp glitz glut gmp gnuplot gnutls gpgme gphoto2 gpm gps graphite graphviz gs gsl gsm gtk gucharmap h224 h281 h323 hdf5 hdri iconv icq icu id3tag idn imagemagick imap imlib immqt-bc inkjar ipod iproute2 ipv6 jabber jack jadetex java6 javascript jbig jingle jpeg jpeg2k kdehiddenvisibility kerberos keyscrub kpathsea kqemu ladspa lame lapack lash latex lcms libcaca libnotify libsamplerate libwww lm_sensors logrotate lzma lzo mad maildir mailwrapper matroska md5sum mhash mikmod mime mjpeg mmap mmx mng modplug modules mp3 mpeg mplayer msn mudflap musepack musicbrainz mysql mysqli nas ncurses netcdf network network-cron nls nntp nocd nodrm nptlonly nsplugin nuv objc objc++ offensive ogg openal opencore-amr openexr opengl optimized-qmake oscar otr pam pango pcntl pcre pda pdf perl pgf plotutils png pop portaudio posix postproc postscript ppds pppd pronounce pstricks qt3support qt4 quicktime raw rdesktop readline recode reflection restrict-javascript rle rrdtool samba scanner schroedinger sdl session sharedmem shorten sip sipim slang slp smi smime sms smtp sndfile sockets socks5 soundtouch sox sparse speex spell spl sqlite sqlite3 srtp sse ssl startup-notification strong-optimization subversion supernodal svg svga sysfs syslog szip t1lib taglib tcpd theora tiff timezone timidity tordns truetype twolame type3 unicode usb utempter utils v4l v4l2 vamp vcd videos vim vim-syntax vnc vorbis wav wavpack wifi win32codecs wireshark wmf x264 x86 xattr xcb xface xft xinerama xorg xosd xpm xprint xrandr xscreensaver xv xvid yahoo yaz ziffy zlib" ALSA_CARDS="intel8x0" 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="authz_host dir mime" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru en ja" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia nv vesa 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, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Andrew Savchenko gentoo-dev 2010-05-06 17:44:04 UTC
Created attachment 230625 [details]
build.log.bz2

Log is compressed because it's too large.
Comment 2 Andrew Savchenko gentoo-dev 2010-05-06 17:44:52 UTC
Created attachment 230627 [details]
environment
Comment 3 Sébastien Fabbro (RETIRED) gentoo-dev 2010-05-06 17:52:06 UTC
(In reply to comment #0)

> CXXFLAGS="-march=athlon-xp -m32 --param l1-cache-line-size=64 --param
> l1-cache-size=64 --param l2-cache-size=512 -O2 -funswitch-loops -fpredict
> ive-commoning -fgcse-after-reload -fomit-frame-pointer -ftree-loop-linear
> -floop-interchange -floop-strip-mine -mfpmath=sse -pipe"

Does it still fail with simpler flags, such as CXXFLAGS="-O2 -march=native"?
Comment 4 Andrew Savchenko gentoo-dev 2010-05-06 21:24:28 UTC
It compiles with original complex CFLAGS, but with -j1 and ccache disabled.

Well, I blame my build system. So this bug may be considered as invalid.

However, I doubt why ccache failed. It never does so.
Comment 5 Andrew Savchenko gentoo-dev 2010-08-09 11:40:02 UTC
When I build 5.26.00-r4 I hit this bug again, but now it seems I found the reason for this problem. Formally this may be considered as a problem of my build system, but it reveals problems in the root build process itself.

My build setup is the following: x86 native host + ccache + distcc helper on amd64; -march=athlon-xp option is explicitly specified on CFLAGS/CXXFLAGS/FFLAGS, because -march=native can't be used with distcc. Default march on x86 (when no -march option is specified) is i686. amd64 host was set up to build x86 binaries using native gcc with -m32 option forcefully added (this was done via helper scripts), thus no crosscompilation is requeired, but for this setup default -march is i386 (when -march is absent in the original distcc client CFLAGS).

And here the problem lies: if *FLAGS options are passed to gcc for each compilation process, -march=athlon-xp is present and everything is fine, but if for some reason gcc/g++ is called without passing CFLAGS/CXXFLAGS to them, the problem occurs: __sync_fetch_and_add_4 builtin is not available on i386, thus link fails. Ideally *FLAGS should be passed everywhere for compiler, but for some small parts of the code they are not. Another side effect of this is that these usually small parts of the code are not optimized properly, because *FLAGS are not used on them.

At this moment I fixed this by forcing -march=i686 "$@" on amd64 distcc helper and purging miscompiled files from ccache's cache, and problem is gone now. But ideally the bug should be fixed so, that *FLAGS are used everywhere during the build process. Of course, this is not only the root package problem, I hit it on some other packages as well (like chromium) before it was fixed in the way described above.
Comment 6 Sébastien Fabbro (RETIRED) gentoo-dev 2010-08-10 20:29:47 UTC
(In reply to comment #5)

> ideally the bug should be fixed so, that *FLAGS are used everywhere during the
> build process.

Several portion of the ROOT code specifically seem to specifically require no optimization, see https://savannah.cern.ch/bugs/?63599 as an example. 
A patch is welcome if you have one around though.