Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 43004 - dev-libs/icu-2.6, dev-libs/icu-2.8 dies on compilation with some CFLAGS
Summary: dev-libs/icu-2.6, dev-libs/icu-2.8 dies on compilation with some CFLAGS
Status: VERIFIED LATER
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Markus Nigbur (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-26 10:40 UTC by Robert Moss (RETIRED)
Modified: 2004-04-19 19:48 UTC (History)
1 user (show)

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


Attachments
Updated ebuild for icu-2.8 (icu-2.8.ebuild,629 bytes, text/plain)
2004-02-26 13:26 UTC, Robert Moss (RETIRED)
Details
Updated ebuild for icu-2.6 (icu-2.6.ebuild,653 bytes, text/plain)
2004-02-26 13:27 UTC, Robert Moss (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Moss (RETIRED) gentoo-dev 2004-02-26 10:40:14 UTC
LD_LIBRARY_PATH=../common:../i18n:../tools/toolutil:../layout:../layoutex:../ext ra/ustdio:../tools/ctestfw:../data/out:../data:../stubdata/:$LD_LIBRARY_PATH  .. /tools/genbrk/genbrk -i ../data/out/build -r ../data/brkitr/title.txt -o ../data /out/build/icudt28l_title.brk
genbrk: tool completed successfully.
LD_LIBRARY_PATH=../common:../i18n:../tools/toolutil:../layout:../layoutex:../ext ra/ustdio:../tools/ctestfw:../data/out:../data:../stubdata/:$LD_LIBRARY_PATH  .. /tools/genbrk/genbrk -i ../data/out/build -r ../data/brkitr/word_th.txt -o ../da ta/out/build/icudt28l_word_th.brk
genbrk: tool completed successfully.
LD_LIBRARY_PATH=../common:../i18n:../tools/toolutil:../layout:../layoutex:../ext ra/ustdio:../tools/ctestfw:../data/out:../data:../stubdata/:$LD_LIBRARY_PATH  .. /tools/genrb/genrb -k -q -p icudt28l -i ../data/out/build -s ../data/locales -d ../data/out/build root.txt
make[1]: *** [../data/out/build/icudt28l_root.res] Segmentation fault
make[1]: Leaving directory `/var/tmp/portage/icu-2.8/work/icu/source/data'
make: *** [all-recursive] Error 2
 
!!! ERROR: dev-libs/icu-2.8 failed.
!!! Function src_compile, Line 18, Exitcode 2
!!! emake failed

This is the output. My emerge info:

Portage 2.0.50-r1 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3_pre20040207-r0, 2.6.3-gentoo-r2)
=================================================================
System uname: 2.6.3-gentoo-r2 i686 AMD Athlon(tm) XP 1600+
Gentoo Base System version 1.4.3.13
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=athlon-xp -msse -mmmx -m3dnow -momit-leaf-frame-pointer -fomit-frame-pointer -funroll-loops -ftracer -ffast-math -fprefetch-loop-arrays -freduce-all-givs -finline-limit=600 -mfpmath=387 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/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/env.d"
CXXFLAGS="-O3 -march=athlon-xp -msse -mmmx -m3dnow -momit-leaf-frame-pointer -fomit-frame-pointer -funroll-loops -ftracer -ffast-math -fprefetch-loop-arrays -freduce-all-givs -finline-limit=600 -mfpmath=387 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs fixpackages sandbox"
GENTOO_MIRRORS="ftp://mirror.ac.uk/sites/www.ibiblio.org/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.uk.gentoo.org/gentoo-portage"
USE="3dnow X Xaw3d aalib acpi adns alsa avi bonobo cdr crypt cups dga dvd encode esd ethereal faad flac foomatic gdbm ggi gif gnome gnomedb gpm gstreamer gtk gtk2 gtkhtml guile imap imlib innodb ipv6 java joystick jpeg lirc mad md5sum memlimit mikmod mmx motif mozilla moznocompose moznoirc moznomail mozsvg mpeg mpi mysql nas ncurses net nls nogcj offensive ofx oggvorbis openal opengl oss pam parse-clocks pda pdflib perl png ppds python quicktime readline ruby samba sdl slang slp spell sse ssl svga tcltk tcpd tetex tiff truetype unicode usb videos vim-with-x wmf x86 xml xml2 xmms xv xvid zlib"

Obviously those are a pretty extreme set of CFLAGS. Once I work out which one it is (this happens with both icu-2.6 and icu-2.8) I'll report back with a flag to either filter (-f*) or add (-fno*). For now, icu-2.6 compiles with "-O2 -march=athlon-xp -pipe" and not the above - all the info I have.
Comment 1 Robert Moss (RETIRED) gentoo-dev 2004-02-26 12:46:48 UTC
Okay, I've got it - it's the "-freduce-all-givs" CFLAG (not CXXFLAG).

I'll submit an updated ebuild. Unsure as to whether or not this fixes 2.6; will test.
Comment 2 Robert Moss (RETIRED) gentoo-dev 2004-02-26 13:26:23 UTC
Created attachment 26423 [details]
Updated ebuild for icu-2.8

This ebuild adds the following lines to the original one to prevent a compile
failure:

inherit flag-o-matic
filter-flags "-freduce-all-givs"

This allows successful compilation.
Comment 3 Robert Moss (RETIRED) gentoo-dev 2004-02-26 13:27:09 UTC
Created attachment 26424 [details]
Updated ebuild for icu-2.6

This ebuild adds the following lines to the original one to prevent a compile
failure:

inherit flag-o-matic
filter-flags "-freduce-all-givs"

This allows successful compilation.
Comment 4 Robert Moss (RETIRED) gentoo-dev 2004-02-26 13:27:54 UTC
Note that this fixes both 2.6 and 2.8 (both have been tested).
Comment 5 Markus Nigbur (RETIRED) gentoo-dev 2004-03-05 17:15:02 UTC
Well, it's nice you found the problematic flag, but I'm not going to filter it out. It may work properly on systems with non agressive CFLAGS.

Over-optimization will break things.
Comment 6 Robert Moss (RETIRED) gentoo-dev 2004-03-05 18:50:03 UTC
The problem is a GCC bug. There is a conflict between -O3 and -freduce-all-givs when presented with invalid assembly.

Try it. I have. Try compiling a system from stage 1 with CFLAGS="-O -march=i386" CXXFLAGS="-O -march=i386" CBUILD="i386-pc-linux-gnu" CHOST="i386-pc-linux-gnu" MAKEOPTS="-j1" and then for dev-libs/icu/2.{6,8} do CFLAGS="-freduce-all-givs". Compilation doesn't break. Then try CFLAGS="-O3 -freduce-all-givs". It will break. This is not exactly a non-standard configuration. In fact, I would be willing to guess that a very large number of Gentoo-ers use this flag in combination with -O3.

-freduce-all-givs is not a dangerous flag. It only breaks things which use invalid assembly. If you don't believe me, check it out. Have a look at the assembly. The code is broken, so the binary is too.

I'd be interested to hear why you think that leaving a flag in for the purposes of allowing people to overoptimise, as you put it, helps stability. This is clearly broken and should be fixed. I cannot see a valid argument against filtering this flag out. "It might work for me" is NOT a valid method of 'fixing' obvious bugs for which there is an easy fix. If I get the time to look at the assembly, I will, but unfortunately I have my mathematics finals papers to attend to at the moment. Are you saying that the flag-o-matic eclass simply shouldn't be there so that people who use "non-agressive" CFLAGS can break particular packages through trial and error? We should NOT be putting ebuilds in portage which are known to break!!!
Comment 7 Jon Portnoy (RETIRED) gentoo-dev 2004-03-05 20:01:04 UTC
It isn't unreasonable to not wish to pollute ebuilds with filter-flags for extremist flags to work around GCC bugs, especially when the GCC folks will likely fix it someday.
Comment 8 Jon Portnoy (RETIRED) gentoo-dev 2004-03-05 20:03:47 UTC
Oh, also: wouldn't you rather fix the assembly and send a patch upstream?
Comment 9 Robert Moss (RETIRED) gentoo-dev 2004-03-06 05:24:10 UTC
Yes, I would. Like I said, I don't have the time at the moment. I just think that a workaround like this should be used in order to ensure that the package works on as many configurations as possible - an ebuild isn't meant to be as neat as possible, it's meant to work - until such time as I have time to fix this properly. I'm no assembly guru, this sort of thing would take me a few hours!
Comment 10 Robert Moss (RETIRED) gentoo-dev 2004-03-06 05:52:02 UTC
I'll fix this properly when I get time.

Closing.
Comment 11 Robert Moss (RETIRED) gentoo-dev 2004-04-19 19:48:15 UTC
I'm closing this bug. It shouldn't be fixed later. The assembly isn't too bad now I've looked at it again and have more of an idea what's going on. The problem here now is the fact that the -freduce-all-givs, a nice stable flag not too long ago, has been modified and modified to someone's heart's content, and now it's all over the place. It breaks all sorts of things. This one broke with the first change - there have been several since. I've started something of a campaign on the forums to make sure that people don't use it...