Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 276406 - sci-physics/root-5.22.00-r2 passes CFLAGS/CXXFLAGS to cint, this leads to compilation fail if --param option is used
Summary: sci-physics/root-5.22.00-r2 passes CFLAGS/CXXFLAGS to cint, this leads to com...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Science Physics related packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-03 22:48 UTC by Andrew Savchenko
Modified: 2009-09-23 23:53 UTC (History)
1 user (show)

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


Attachments
build.log.bz2 (build.log.bz2,80.43 KB, text/plain)
2009-07-03 22:51 UTC, Andrew Savchenko
Details
environment.bz2 (environment.bz2,30.89 KB, text/plain)
2009-07-03 22:52 UTC, Andrew Savchenko
Details
fix g4root dictionary generation (root-5.22.00-g4root-flags.patch,471 bytes, patch)
2009-07-04 02:18 UTC, Andrew Savchenko
Details | Diff
build.log, part0 (build.log.part0,762.94 KB, text/plain)
2009-07-04 13:54 UTC, Andrew Savchenko
Details
build.log, part1 (build.log.part1,752.91 KB, text/plain)
2009-07-04 13:54 UTC, Andrew Savchenko
Details
build.log, part2 (build.log.part2,748.21 KB, text/plain)
2009-07-04 13:55 UTC, Andrew Savchenko
Details
environment (environment,145.57 KB, text/plain)
2009-07-04 13:55 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 2009-07-03 22:48:51 UTC
Hello,

please note, this bug is really irrelevant to the root version.

Gentoo patched root's config/Makefile.in to honor $CFLAGS/$CXXFLAGS, but those flags are passed not only to gcc, but to cint too. And such behavior is a problem.

First of all, those flags are useless for cint, they even harm. cint ignores unknown options, and it doesn't understand any gcc optimization options except of -On, but -O levels are treated in a different way: for cint they take range -O1..-O5 and -O4 is default, thus gcc's -On will actually lower cint optimization level.

Secondly, despite cint ignores unknown options, it fails to handle "--param argument" gcc option. E.g "--param l1-cache-line-size=64
--param l1-cache-size=64 --param l2-cache-size=512" are valid gcc options (at least as of gcc-4.3.3) and they cause no problems for other software on my system to compile. Actually cint skips "--param" as unknown option, but treats its argument (e.g. l1-cache-size) as an input file thus failing to generate dictionary.

Unfortunately, flag-o-matic's filter-flags is not capable of filtering "--param argument" properly too. Filtering of all possible --param arguments by their value is unacceptable due to huge list of them and possible changes in this list between gcc versions. \

Thus the best solution will be to leave EXTRA_CFLAGS in config/Makefile.in unchanged and add new variable like EXTRA_GCC_CFAGS (or whatever) equals to "$(EXTRA_CFLAS) $(CFLAGS)" and patch every config/Makefile.$ARCH accordingly. Of course, CXXFLAGS should be treated in the same way.

Will post an appropriate patch as soon it will be done and tested. Of course, only supported $(ARCH)s will be updated.
Comment 1 Andrew Savchenko gentoo-dev 2009-07-03 22:49:43 UTC
Just for the case standard build info:

$ emerge --info
Portage 2.2_rc33 (default/linux/x86/2008.0, gcc-4.3.3, glibc-2.10.1-r0, 2.6.29.2-yoruichi i686)
=================================================================
System uname: Linux-2.6.29.2-yoruichi-i686-AMD_Athlon-tm-_XP_3200+-with-gentoo-2.0.1
Timestamp of tree: Fri, 03 Jul 2009 13:15:01 +0000
distcc 3.1 i686-pc-linux-gnu [disabled]
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p24
dev-java/java-config: 2.1.8-r1
dev-lang/python:     2.6.2-r1
dev-python/pycrypto: 2.0.1-r8
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.4
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r3
sys-apps/sandbox:    2.0
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.29
ACCEPT_KEYWORDS="x86 ~x86"
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 -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -fomit-frame-pointer -mfpmath=sse -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /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-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-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 -ftree-vectorize -fomit-frame-pointer -mfpmath=sse -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="ccache collision-protect distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict 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 -ftree-vectorize -fomit-frame-pointer -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"
LINGUAS="ru en ja"
MAKEOPTS="-j2"
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/layman/science /usr/local/portage/layman/java-overlay /usr/local/portage/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 alsa amr amrnb amrwb ao audiofile bash-completion bcmath bidi binfilter blas bluetooth branding bzip2 cairo calendar canna caps ccache cddb cdinstall cdparanoia cdr chasen cjk cli clisp colordiff cracklib crypt cscope css ctype cups curl curlwrappers cvs cxx cyrillic dbus device-mapper dga dia dirac directfb djvu dmx doc dri dts dv dvd dvdr dvdread dvi editor elf encode enscript ermt examples exif expat faac faad fbcon festival ffmpeg fftw firefox flac fontconfig foomaticdb fortran fpx freetds freetype ftp gcj gcrypt gd gdbm geoip ggi gif gimp ginac git glut gmp gnuplot gnutls gpgme gphoto2 gpm gps 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 isdnlog 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 lzo mad maildir mailwrapper matroska mbox md5sum mhash midi mikmod mime mjpeg mmap mmx mng modplug mp3 mpeg mplayer mppe-mppc msn mudflap musepack musicbrainz mysql mysqli nas ncurses netcdf network network-cron nls nntp nocd nodrm nptlonly nsplugin nuv objc objc++ offensive ogg openal openexr opengl oscar otr pam pango pch pcntl pcre pda pdf perl pgf plotutils png pop portaudio posix postproc postscript ppds pppd pronounce pstricks qt3 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 subversion supernodal svg svga sysfs syslog szip t1lib taglib tcpd theora tiff timezone timidity tordns truetype twolame type3 unicode usb 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 xulrunner 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" USERLAND="GNU" VIDEO_CARDS="nvidia nv vesa"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Andrew Savchenko gentoo-dev 2009-07-03 22:51:44 UTC
Created attachment 196550 [details]
build.log.bz2
Comment 3 Andrew Savchenko gentoo-dev 2009-07-03 22:52:05 UTC
Created attachment 196552 [details]
environment.bz2
Comment 4 Andrew Savchenko gentoo-dev 2009-07-04 02:18:05 UTC
Created attachment 196565 [details, diff]
fix g4root dictionary generation

Well, problem was indeed in dictionary generation, but it is local to g4root, no global changes needed.
Comment 5 Andrew Savchenko gentoo-dev 2009-07-04 02:57:32 UTC
And really, you should consider emake -j1 usage. With parallel build I ran into a lot of weird random errors, like gcc ICE, gnu ld internal errors, emerge eternal loop etc; with -j1 everything works ok.

Originally I suspected hardware problems, but tests are ok and I do not observe this behaviour with other builds.
Comment 6 Justin Lecher (RETIRED) gentoo-dev 2009-07-04 09:37:25 UTC
Please attach everything in plain text!!!!!!!!!!
Comment 7 Andrew Savchenko gentoo-dev 2009-07-04 13:48:43 UTC
(In reply to comment #6)
> Please attach everything in plain text!!!!!!!!!!

Please tell me how to attach >2MB file. Thats why I used bz2.
I can split it if you really want me to.
Comment 8 Andrew Savchenko gentoo-dev 2009-07-04 13:54:20 UTC
Created attachment 196633 [details]
build.log, part0
Comment 9 Andrew Savchenko gentoo-dev 2009-07-04 13:54:38 UTC
Created attachment 196635 [details]
build.log, part1
Comment 10 Andrew Savchenko gentoo-dev 2009-07-04 13:55:07 UTC
Created attachment 196636 [details]
build.log, part2
Comment 11 Andrew Savchenko gentoo-dev 2009-07-04 13:55:30 UTC
Created attachment 196638 [details]
environment
Comment 12 Jeroen Roovers (RETIRED) gentoo-dev 2009-07-20 02:30:02 UTC
(In reply to comment #6)
> Please attach everything in plain text!!!!!!!!!!

Why don't you stop giving bad advice about bugs.gentoo.org usage instead? There's nothing wrong with using binaries here.
Comment 13 Sébastien Fabbro (RETIRED) gentoo-dev 2009-07-26 00:38:39 UTC
Hi Andrew,

Thanks for reporting!
Could you summarize what your current problem is? I am not sure to understand if your patch in comment #4 fixes your original problem.

(In reply to comment #5)
> And really, you should consider emake -j1 usage. With parallel build I ran into a lot of weird random errors, 

I compile ROOT with -j33 and observe no problem. Also I had discussion with upstream and they constantly compile root with -j8 and more. Forcing to -j1 will be really a hit considering ROOT compile time, so we'd rather try to find the origin of the problem.

Thanks.
Comment 14 Andrew Savchenko gentoo-dev 2009-07-28 05:51:28 UTC
Hello Sébastien,

(In reply to comment #13)
> Thanks for reporting!
> Could you summarize what your current problem is? I am not sure to understand
> if your patch in comment #4 fixes your original problem.

Currently ROOT does not compile if your CXXFLAGS contains --param arg=value. E.g. with "--param l1-cache-line-size=64" in CXXFLAGS, ROOT compilation will fail at g4root module (logs are above).

I found that the reason of this failure is passing of CXXFLAGS to rootcint, despite rootcint was developed to ignore unknown flags, it fails to ignore more complicated "--param arg=value" options (actually it ignores --param and treats arg=value as a filename). This problem occurs only at a single place: in g4root module, so my patch disables passing of CXXFLAGS to rootcint here.

Of course, the best way to fix this bug will be to fix rootcint 8-).
 
> I compile ROOT with -j33 and observe no problem. Also I had discussion with
> upstream and they constantly compile root with -j8 and more. Forcing to -j1
> will be really a hit considering ROOT compile time, so we'd rather try to find
> the origin of the problem.

Hmm, maybe this is distcc-related problem (I use distcc on my system via CCACHE_PREFIX=distcc). For now just forget it, because it is not firmly reproducible, I'll open a new bug if this problem will occur later.
Comment 15 Sébastien Fabbro (RETIRED) gentoo-dev 2009-09-23 23:53:21 UTC
Fixed in 5.22.00-r3.
Thanks!