Error compiling binutils (chapter 6.11) with -O3 optimization flag

Nicolas FRANCOIS nicolas.francois at free.fr
Mon Jul 30 08:19:19 PDT 2007


Hi.

I went into an error building binutils (LFS SVN). Being an old LFS user,
I wanted to go for some optimizations, so I followed the optimization
hint, aware of the fact that I could run into troubles.

So that's where I ran, and I wanted to signal this, which is in fact
allready in the knoledge base of binutils (or is it sourcemage ?) :

http://bugs.sourcemage.org/show_bug.cgi?id=12741

using gcc-4.1.1


gcc -DHAVE_CONFIG_H -I. -I../../binutils -I. -D_GNU_SOURCE -I.
-I../../binutils -I../bfd -I../../binutils/../bfd
-I../../binutils/../include -I../../binutils/../intl -I../intl
-DLOCALEDIR="\"/usr/share/locale\""
-Dbin_dummy_emulation=bin_vanilla_emulation   -W -Wall
-Wstrict-prototypes -Wmissing-prototypes -Werror -O -march=athlon-tbird
-mmmx -m3dnow -pipe -O3 -c ../../binutils/wrstabs.c cc1: warnings being
treated as errors ../../binutils/wrstabs.c: In function
'stab_tag_type': ../../binutils/wrstabs.c:1297: warning: 'size' is used
uninitialized in this function make[4]: *** [wrstabs.o] Error 1 make[4]:
Leaving directory `/usr/src/binutils-2.17/buildit/binutils'

Workaround :

It happens only when compiling with -O3. With -O3, if using
--disable-werror, the test suite fails badly afterwhile. With -O2 it is
OK. (Tested with gcc 4.1.1)
(In reply to comment #1)
> maybe the -Werror should be filtered out?

Hope this can be of some help. Maybe a note in the book ? Or maybe this
is up to the user of the book to be aware of this ? I remember there were
a few pages a while ago, in gcc, or glibc... to signal that optimization
was know to break some packages...

\bye

-- 

                   Nicolas FRANCOIS
            http://nicolas.francois.free.fr
 A TRUE Klingon programmer does NOT comment his code



More information about the lfs-support mailing list