Hoor-j for broken gcc updates!
So I’m doing the usual stuff, updating systems at work… and ran into some unusual results…
Basically, gentoo just marked gcc 4.1.1 and glibc 2.4-r3 stable, and on three of my systems (all webserver-setups), I got compile failures (see behind the cut for the spammy failure message).
Well, it turns out, gcc 3.4.6 can’t compile gcc 4.x with the “hardened” use flag in place. So it would seem, anyway. I’m not sure why this is, but it is.
Which is fine, because I’ve been questioning the benefits of the hardened flag for a while anyway. I’m not sure what it actually does, how it does it, or whether it matters, but it seems like it provides a pretty substantial performance hit to use it, which I’m not really down with… sort of like enabling bsd process accounting, or using selinux.
Anyway, the solution is: remove “hardened” use flag (at least for gcc/glibc, you can leave it for php, syslog-ng, other stuff that uses it if you want). Then emerge –oneshot =gcc-3.4.6-r1 =glibc-2.3.6-r4 && env-update && source /etc/profile && emerge -u gcc glibc.
Annoying!
/var/tmp/portage/gcc-4.1.1/work/build/./gcc/xgcc -shared-libgcc -B/var/tmp/portage/gcc-4.1.1/work/build/./gcc -nostdinc++ -L/var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3/src -L/var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3/src/.libs -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -isystem /usr/i686-pc-linux-gnu/sys-include -I/var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu -I/var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3/include -I/var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/libstdc++-v3/libsupc++ -O2 -march=pentium4 -pipe -D_GNU_SOURCE -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -c /var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/libstdc++-v3/src/codecvt.cc -fPIC -DPIC -o .libs/codecvt.o
In file included from /var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3/include/memory:61,
from /var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3/include/string:48,
from /var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3/include/bits/locale_classes.h:47,
from /var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3/include/locale:46,
from /var/tmp/portage/gcc-4.1.1/work/gcc-4.1.1/libstdc++-v3/src/codecvt.cc:30:
/var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3/include/limits:990: error: stray '\226' in program
/var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3/include/limits:1047: error: stray '\374' in program
/var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3/include/limits:1104: error: stray '\226' in program
make[5]: *** [codecvt.lo] Error 1
make[5]: Leaving directory `/var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3/src'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/var/tmp/portage/gcc-4.1.1/work/build/i686-pc-linux-gnu/libstdc++-v3'
make[2]: *** [all-target-libstdc++-v3] Error 2
make[2]: Leaving directory `/var/tmp/portage/gcc-4.1.1/work/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/var/tmp/portage/gcc-4.1.1/work/build'
make: *** [profiledbootstrap] Error 2
!!! ERROR: sys-devel/gcc-4.1.1 failed.
Call stack:
ebuild.sh, line 1543: Called dyn_compile
ebuild.sh, line 936: Called src_compile
ebuild.sh, line 1252: Called toolchain_src_compile
toolchain.eclass, line 24: Called gcc_src_compile
toolchain.eclass, line 1528: Called gcc_do_make
toolchain.eclass, line 1402: Called die
!!! emake failed with profiledbootstrap
!!! If you need support, post the topmost build error, and the call stack if relevant.
September 17th, 2006 at 12:28 pm
Thanks for solving this. I’ve been banging my head for weeks now. Only when searching the right “error: stray ‘\226′ in program” did I come across this blog.
September 17th, 2006 at 12:33 pm
no prob. I figured putting the error text up would help someone or another out, guess I was right
.
September 23rd, 2006 at 12:13 pm
Weird…. how did you know that those cryptic errors were related to hardened gcc-3.4.6? That was a really weird error to me too. Thanks for the help.
-ninja
September 23rd, 2006 at 5:37 pm
I have about a dozen gentoo systems in various configs. The ones that had USE=hardened failed the update. The ones that didn’t succeeded. So that pretty much told me what was up with that. Checking the gentoo forums, I found a couple people with the same problems and different configs, but always with that USE=hardened, so that helped cement the idea.