Upgrading from gcc-3.4.3-r1. Worked fine on my non-hardened system. On my hardened system, I get the same ICE every time, early in the build process. Reproducible: Always Steps to Reproduce: 1. # emerge -avu gcc These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild U ] sys-devel/gcc-3.4.3.20050110 [3.4.3-r1] -bootstrap -boundschecking -build -debug +fortran -gcj +gtk +hardened (-ip28) (-multilib) -multislot (-n32) (-n64) -nls -nocxx -objc -static (-uclibc) 0 kB Total size of downloads: 0 kB Do you want me to merge these packages? [Yes/No] y Actual Results: gcc -c -DEFAULT_PIE_SSP -O -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I. -I/var/tmp/portage/gcc-3.4.3.20050110/work/gcc-3.4.3/gcc -I/var/tmp/portage/gcc-3.4.3.20050110/work/gcc-3.4.3/gcc/. -I/var/tmp/portage/gcc-3.4.3.20050110/work/gcc-3.4.3/gcc/../include /var/tmp/portage/gcc-3.4.3.20050110/work/gcc-3.4.3/gcc/cppcharset.c -o cppcharset.o gcc -c -DEFAULT_PIE_SSP -O -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I. -I/var/tmp/portage/gcc-3.4.3.20050110/work/gcc-3.4.3/gcc -I/var/tmp/portage/gcc-3.4.3.20050110/work/gcc-3.4.3/gcc/. -I/var/tmp/portage/gcc-3.4.3.20050110/work/gcc-3.4.3/gcc/../include /var/tmp/portage/gcc-3.4.3.20050110/work/gcc-3.4.3/gcc/hashtable.c -o hashtable.o /var/tmp/portage/gcc-3.4.3.20050110/work/gcc-3.4.3/gcc/hashtable.c: In function `approx_sqrt': /var/tmp/portage/gcc-3.4.3.20050110/work/gcc-3.4.3/gcc/hashtable.c:310: internal compiler error: in try_split, at emit-rtl.c:3314 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugs.gentoo.org/> for instructions. Preprocessed source stored into /var/tmp/portage/gcc-3.4.3.20050110/temp/cc5hGmZ1.out file, please attach this to your bugreport. make[2]: *** [hashtable.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/gcc-3.4.3.20050110/work/build/gcc' make[1]: *** [stage1_build] Error 2 make[1]: Leaving directory `/var/tmp/portage/gcc-3.4.3.20050110/work/build/gcc' make: *** [profiledbootstrap] Error 2 !!! ERROR: sys-devel/gcc-3.4.3.20050110 failed. !!! Function gcc_do_make, Line 1074, Exitcode 2 !!! make failed with profiledbootstrap !!! If you need support, post the topmost build error, NOT this status message. Expected Results: Should have merged successfully. Gentoo Base System version 1.6.8 Portage 2.0.51-r15 (default-linux/x86/2004.3, gcc-3.4.3, glibc-2.3.4.20041102-r0, 2.6.10-gentoo-r6-1 i686) ================================================================= System uname: 2.6.10-gentoo-r6-1 i686 AMD Athlon(tm) XP 2200+ Python: dev-lang/python-2.3.4 [2.3.4 (#1, Aug 1 2004, 02:52:47)] dev-lang/python: 2.3.4 sys-devel/autoconf: 2.59-r6, 2.13 sys-devel/automake: 1.8.5-r2, 1.5, 1.4_p6, 1.6.3, 1.7.9, 1.9.4 sys-devel/binutils: 2.15.92.0.2-r2 sys-devel/libtool: 1.5.10-r3 virtual/os-headers: 2.6.8.1-r2 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer -fstack-protector" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer -fstack-protector" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache collision-protect distlocks sandbox sfperms userpriv usersandbox" GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo http://gentoo.mirrors.pair.com/ http://open-systems.ufl.edu/mirrors/gentoo http://gentoo.osuosl.org/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" USE="x86 3dnow 3dnowex 3ds X X509 Xaw3d aac aalib aavm aim alsa apache2 arts artworkextra audiofile avi bcmath berkdb bidi bitmap-fonts bmp bonobo bootsplash bzip2 bzlib calendar canna cap caps cdb cddb cdparanoia cdr chroot cjk codecs cpdflib crypt cscope ctype cups curl curlwrappers dba dbx devfs26 dga dio divx4linux djbfft dv dvd dvdr dvdread edl encode erandom esd ethereal evo exif f77 faac faad fam fbcon ffmpeg fftw flac flash flatfile font-server foomaticdb fortran freetype freewnn fs ftp gd gdbm gif gimp gimpprint gmp gnome gphoto2 gpm graphviz gstreamer gtk gtk2 gtkhtml hal hardened hardenedphp iconv icq imagemagick imap imlib imlib2 immqt-bc innodb jabber java javascript jbig jce jit joystick jpeg jpeg2k kde ladcca lcms ldap libcaca libg++ libgda libwww live lzo lzw-tiff mad maildir mailwrapper matroska mcal memlimit mhash mikmod mime mmap mmx mmx2 mng monkey mono motif mozilla moznoirc mozp3p mp3 mpeg mpeg4 mpi mplayer msn mysql mysqli nas ncurses netcdf network nocardbus nocd nodrm nptl nvidia oci8 odbc offensive oggvorbis openal opengl oscar oss pam pcap pcntl pcre pda pdflib perl php physfs pic pie plotutils png pnp posix ppds prelude python qt quicktime readline real recode rtc samba scanner sdl session sftplogging shared sharedmem simplexml slang smartcard sndfile soap sockets socks5 spamassassin speex spell spl sqlite sse ssl svg sysvipc szip tcpd tga theora tidy tiff tokenizer transcode truetype truetype-fonts type1-fonts unicode usb uudeview vhosts videos vim-with-x wmf xine xml xml2 xmlrpc xmms xosd xprint xscreensaver xsl xv xvid xvmc yahoo yv12 zlib" Unset: ASFLAGS, CBUILD, CTARGET, LDFLAGS
Created attachment 49745 [details] Pre-processed output from ICE
Same issue here, this started after the update to gcc-3.4.3.20050110 and subsequent downgrade. Now I cannot build perl, or gcc-3.4.3.20050110 again: Looks like we are not the only ones: http://forums.gentoo.org/viewtopic.php?p=2005342&highlight=trysplit#2005342 Also have same error if I switch from hardened to vanilla with gcc-config. http://bugs.gentoo.org/show_bug.cgi?id=78666 is listed as fixed? emerge info: Portage 2.0.51-r15 (default-linux/x86/2004.3, gcc-3.4.3, glibc-2.3.4.20040808-r1, 2.6.10-gentoo-r5 i686) ================================================================= System uname: 2.6.10-gentoo-r5 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz Gentoo Base System version 1.6.8 Python: dev-lang/python-2.3.4 [2.3.4 (#1, Jan 4 2005, 09:02:37)] distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] dev-lang/python: 2.3.4 sys-devel/autoconf: 2.59-r6, 2.13 sys-devel/automake: 1.8.5-r2, 1.5, 1.4_p6, 1.6.3, 1.7.9, 1.9.4 sys-devel/binutils: 2.15.92.0.2-r1 sys-devel/libtool: 1.5.10-r4 virtual/os-headers: 2.6.8.1-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig buildpkg ccache distlocks sandbox sfperms" GENTOO_MIRRORS="http://mirrors.tds.net/gentoo http://mirror.datapipe.net/gentoo ftp://mirrors.tds.net/gentoo http://gentoo.ccccom.com http://mirror.clarkson.edu/pub/distributions/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 X acl alsa apm arts artswrappersuid audiofile avi berkdb bitmap-fonts cdparanoia cdr crypt cups dhcp divx4linux doc dvd dvdr emacs encode f77 fam ffmpeg flac font-server foomatic foomaticdb fortran gdbm gif gpm hardened imlib ipv6 ithreads jack java jpeg junit kde kerberos ladccakde ladspa libg++ libwww mad matroska mikmod mmx motif mpeg mppe-mppc mysql ncurses network nls nptl oggvorbis opengl oss pam pdflib perl png python qt quicktime readline real rtc samba scanner sdl snmpsoftmmu spell sse sse2 ssl svg svga tcltk tcpd theora threads tiff transcode truetype truetype-fonts type1-fonts unicode usb videos wifi xine xinerama xml2 xmms xosd xprint xv xvid zlib" Unset: ASFLAGS, CBUILD, CTARGET, LDFLAGS
Created attachment 49781 [details] preprocessed file for reproduction
The file in comment #3 is the preprocessed file created when it borks re-compiling gcc-3.4.3-r1. It borked with: gcc -c -DEFAULT_PIE_SSP -O -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I. -I/var/tmp/portage/gcc-3.4.3-r1/work/gcc-3.4.3/gcc -I/var/tmp/portage/gcc-3.4.3-r1/work/gcc-3.4.3/gcc/. -I/var/tmp/portage/gcc-3.4.3-r1/work/gcc-3.4.3/gcc/../include /var/tmp/portage/gcc-3.4.3-r1/work/gcc-3.4.3/gcc/hashtable.c -o hashtable.o /var/tmp/portage/gcc-3.4.3-r1/work/gcc-3.4.3/gcc/hashtable.c: In function `approx_sqrt': /var/tmp/portage/gcc-3.4.3-r1/work/gcc-3.4.3/gcc/hashtable.c:310: internal compiler error: in try_split, at emit-rtl.c:3314 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugs.gentoo.org/> for instructions. Preprocessed source stored into /var/tmp/portage/gcc-3.4.3-r1/temp/ccHoKKIV.out file, please attach this to your bugreport. make[2]: *** [hashtable.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/gcc-3.4.3-r1/work/build/gcc' make[1]: *** [stage1_build] Error 2 make[1]: Leaving directory `/var/tmp/portage/gcc-3.4.3-r1/work/build/gcc' make: *** [profiledbootstrap] Error 2 I tried removing flags one at a time. It appears to be -O causing the problem. Setting optimization below -O2 causes the error : straylight wirwzd # gcc -O -c ccHoKKIV.c /var/tmp/portage/gcc-3.4.3-r1/work/gcc-3.4.3/gcc/hashtable.c: In function `approx_sqrt': /var/tmp/portage/gcc-3.4.3-r1/work/gcc-3.4.3/gcc/hashtable.c:310: internal compiler error: in try_split, at emit-rtl.c:3314 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugs.gentoo.org/> for instructions. Preprocessed source stored into /tmp/ccmQXepE.out file, please attach this to your bugreport. straylight wirwzd # gcc -O1 -c ccHoKKIV.c /var/tmp/portage/gcc-3.4.3-r1/work/gcc-3.4.3/gcc/hashtable.c: In function `approx_sqrt': /var/tmp/portage/gcc-3.4.3-r1/work/gcc-3.4.3/gcc/hashtable.c:310: internal compiler error: in try_split, at emit-rtl.c:3314 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugs.gentoo.org/> for instructions. Preprocessed source stored into /tmp/ccpVpcNj.out file, please attach this to your bugreport. straylight wirwzd # gcc -O2 -c ccHoKKIV.c straylight wirwzd # gcc -O3 -c ccHoKKIV.c straylight wirwzd #
Tried removing optimizations added by -O2 one at a time. Adding -funit-at-a-time allowed for sucessfull compiliation: straylight wirwzd # sh -x test.sh + gcc -O -funit-at-a-time -c ./ccHoKKIV.c
OK to fix this I had to: 1) Switch to a vanilla profile with gcc-config. Otherwise I got: /portage/gcc-3.4.3-r1/work/gcc-3.4.3/gcc/genmodes.c -o genmodes.o cc1: stack smashing attack in function branch_prob() xgcc: Internal error: Aborted (program cc1) 2) Re-emerge gcc-3.4.3-r1 using the vanilla profile with: STAGE1_CFLAGS="-O -funit-at-a-time" emerge -av =sys-devel/gcc-3.4.3-r1 3) I could then re-emerge gcc gcc-3.4.3-r1 with a hardened profile. I can also now compile perl et.al. I can now also compile gcc-3.4.3.20050110 (I hit ^C before it installs for now as I need to sleep ;-)). Does this help others?
The steps outlined in comment #6 From Keith Landry worked for me.
I can't perform actions in <a href="http://bugs.gentoo.org/show_bug.cgi?id=79852#c6">Step #6</a> as I do not have vanilla profile. tux spijon # gcc-config -l [1] i686-pc-linux-gnu-3.4.3 * [2] i686-pc-linux-gnu-3.4.3-hardened [3] i686-pc-linux-gnu-3.4.3-hardenednopie [4] i686-pc-linux-gnu-3.4.3-hardenednossp
I worked with Igor on the forums. Worked for him too.
From comment #6, "I can now also compile gcc-3.4.3.20050110 (I hit ^C before it installs for now as I need to sleep ;-))." Everything works for me to this point as well, but if I recompile the toolchain (glibc binutils gcc) again after this point I get back to the same error on the gcc compile. I'm not so techy, but it seems that it is the building of glibc with the hardened gcc profile that borks the latter gcc compile. Anybody else have the error return after recompiling the tool chain?
I ended up doing the followng the following to upgrade and have no issues: 1) Switch to vanilla profile 2) STAGE1_CFLAGS="-O -funit-at-a-time" emerge -av =sys-devel/gcc-3.4.3-r1 3) Switch to hardened profile 4) emerge -av =sys-devel/gcc-3.4.3-r1 5) emerge -av =sys-devel/gcc-3.4.3-r1 6) emerge -av =sys-devel/gcc-3.4.3.20050110 7) emerge -e system
I'm getting this exact same error when upgrading from gcc-3.4.3.20050110 to gcc-3.4.3.20050110-r1
*** Bug 80118 has been marked as a duplicate of this bug. ***
The solution pointed out in comment #11 doesn't work if gcj is in USE. Step 4 completes successfully, but step 5 terminate always here: /home/data/portage/tmp/portage/gcc-3.4.3-r1/work/gcc-3.4.3/libjava/java/awt/geom/QuadCurve2D.java: In class `java.awt.geom.QuadCurve2D': /home/data/portage/tmp/portage/gcc-3.4.3-r1/work/gcc-3.4.3/libjava/java/awt/geom/QuadCurve2D.java: In method `java.awt.geom.QuadCurve2D.solveQuadratic(double[],double[])': /home/data/portage/tmp/portage/gcc-3.4.3-r1/work/gcc-3.4.3/libjava/java/awt/geom/QuadCurve2D.java:706: internal compiler error: in try_split, at emit-rtl.c:3314 Any idea?
*** Bug 82875 has been marked as a duplicate of this bug. ***
*** Bug 89031 has been marked as a duplicate of this bug. ***
*** Bug 87313 has been marked as a duplicate of this bug. ***
*** Bug 87314 has been marked as a duplicate of this bug. ***
*** Bug 88716 has been marked as a duplicate of this bug. ***
*** Bug 86570 has been marked as a duplicate of this bug. ***
*** Bug 84229 has been marked as a duplicate of this bug. ***
*** Bug 87011 has been marked as a duplicate of this bug. ***
*** Bug 81579 has been marked as a duplicate of this bug. ***
*** Bug 82400 has been marked as a duplicate of this bug. ***
*** Bug 87012 has been marked as a duplicate of this bug. ***
To Paper from Comment 14: Try omitting gjc unill you are on the new version of gcc then add it and rebuild then? You may want to to quickpkg your current version first.
My solution (see bug #89031) was to use an old gcc-3.3.5 package to recompile gcc-3.4.3-20050110. After some unfortunate experiences in the past, I've learned to always keep backups (using quickpkg) of toolchain binaries... Perhaps the best way to fix this bug is for someone with bandwidth to host an i386 binary gcc-3.3.5 package.
To #27: The trouble is, it's not just that you can't recompile the toolchain. I mean, there's plenty of hosted binary toolchain packages that you can find in an emergency. The problem is that even the newly recompiled GCC is still uncapable of compiling itself after N attempts, where N is somewhere between 1 and 3 depending on your hardware. After you use 3.3.5 to recompile hardened 3.4.3, try recompiling hardened 3.4.3 with itself two or three times. Then try compiling libperl. At some point in that process, I'm guessing it will break. See the experiences in #80118 for some examples. There appears to be something _honestly_flawed_ with the hardened 3.4.3 right now, to the point that it just can't compile stuff.
#28, yes, you're right, and the bug is mighty interesting - hopefully someone's looking into it too :)
*** Bug 89576 has been marked as a duplicate of this bug. ***
*** Bug 89088 has been marked as a duplicate of this bug. ***
any news on the progress of this bug?
*** Bug 62079 has been marked as a duplicate of this bug. ***
*** Bug 94563 has been marked as a duplicate of this bug. ***
(In reply to comment #34) > *** Bug 94563 has been marked as a duplicate of this bug. *** It's also there in gcc-3.4.4 hardened - I opened 94563 before seing this one.
I had a gcc 3.4.3-r1 on my server that culdn't compile itself, any updates nor libstdc++. They all failed with this error. But I changed toolchain.eclass to pass -O2 instead of -O to STAGE1_CFLAGS and that made gcc 3.4.4 compile. This is probably because -O2 includes -funit-at-a-time and -O doesn't. This bug could probably be resolved by letting toolchain.eclass check if gcc 3.4 is used and then append -funit-at-a-time to the stage1 flags. Alternatively -O2 could be used instead of -O for stage1 always.
*** Bug 94818 has been marked as a duplicate of this bug. ***
Changing the STAGE1_CFLAGS to include -O2 instead of just -O worked a treat. I had also been having troubles installing gcc-3.4.4 and other programs, but gcc-3.4.4 just finished compiling fine now.
*** Bug 96873 has been marked as a duplicate of this bug. ***
*** Bug 97282 has been marked as a duplicate of this bug. ***
Setting STAGE1_CFLAGS to -O2 fixed it for me, also.
*** Bug 97312 has been marked as a duplicate of this bug. ***
fwiw, comment #11 did (quite throughly it does seems) fix the issues I was having.
*** Bug 97538 has been marked as a duplicate of this bug. ***
Do anyone care to fix this bug? It has been open for half a year now and the fix is really easy! Just check comment #36.
can someone verify that using -funit-at-a-time actually fixes this ? i'd prefer to use that instead of -O2
emerge info from actual system: Portage 2.0.51.19 (default-linux/amd64/2005.0, gcc-3.4.3, glibc-2.3.4.20041102- r1, 2.6.11.12-grsec-20 x86_64) ================================================================= System uname: 2.6.11.12-grsec-20 x86_64 AMD Athlon(tm) 64 Processor 3000+ [...] emerge info from the chroot on that system where this error occurs: Portage 2.0.51.22-r1 (uclibc/x86/hardened, gcc-3.4.4, uclibc-0.9.27-r0, 2.6.11. 12-grsec-20 i686) ================================================================= System uname: 2.6.11.12-grsec-20 i686 AMD Athlon(tm) 64 Processor 3000+ Gentoo Base System version 1.6.12 dev-lang/python: 2.3.4-r1, 2.4.1-r1 sys-apps/sandbox: 1.2.10 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-gentoo-linux-uclibc" CFLAGS="-Os -march=athlon-xp -pipe -fomit-frame-pointer" CHOST="i686-gentoo-linux-uclibc" [...] emerge gcc with STAGE1_CFLAGS="-O": | gcc -c -DEFAULT_PIE_SSP -DEFAULT_RELRO -DEFAULT_BIND_NOW -DUSE_UCLIBC -O - DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes - pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I. -I/var/tmp/portage/gcc-3.4.4/work/gcc-3.4.4/gcc -I/var/tmp/portage/ gcc-3.4.4/work/gcc-3.4.4/gcc/. -I/var/tmp/portage/gcc-3.4.4/work/gcc-3.4.4/gcc/ ../include /var/tmp/portage/gcc-3.4.4/ work/gcc-3.4.4/gcc/hashtable.c -o hashtable.o | /var/tmp/portage/gcc-3.4.4/work/gcc-3.4.4/gcc/hashtable.c: In function `approx_sqrt': | /var/tmp/portage/gcc-3.4.4/work/gcc-3.4.4/gcc/hashtable.c:310: internal compiler error: in try_split, at emit-rtl.c:3343 | Please submit a full bug report, | with preprocessed source if appropriate. | See <URL:http://bugs.gentoo.org/> for instructions. | Preprocessed source stored into /var/tmp/portage/gcc-3.4.4/temp/ccOZThMl.out file, please attach this to your bugreport. | make[2]: *** [hashtable.o] Error 1 | make[2]: Leaving directory `/var/tmp/portage/gcc-3.4.4/work/build/gcc' with STAGE1_CFLAGS="-O -funit-at-a-time": | make[2]: Entering directory `/var/tmp/portage/gcc-3.4.4/work/build/gcc' | stage1/xgcc -Bstage1/ -B/usr/i686-gentoo-linux-uclibc/bin/ -c -DEFAULT_PIE_SSP -DEFAULT_RELRO -DEFAULT_BIND_NOW -DUSE_UCLIBC -march=athlon-xp -pipe -O2 - fprofile-use -DIN_GCC -W -Wall -Wwrite- strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wold- style-definition -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I/var/tmp/ portage/gcc-3.4.4/work/gcc-3.4.4/gcc -I/ var/tmp/portage/gcc-3.4.4/work/gcc-3.4.4/gcc/. -I/var/tmp/portage/gcc-3.4.4/ work/gcc-3.4.4/gcc/../include /var/tmp/portage/gcc-3.4.4/work/gcc-3.4.4/gcc/ genmodes.c -o genmodes.o | stage1/cc1: stack smashing attack in function branch_prob() | xgcc: Internal error: Killed (program cc1) | Please submit a full bug report. | See <URL:http://bugs.gentoo.org/> for instructions. | make[2]: *** [genmodes.o] Error 1 | make[2]: Leaving directory `/var/tmp/portage/gcc-3.4.4/work/build/gcc' with STAGE1_CFLAGS="-O2": | stage1/xgcc -Bstage1/ -B/usr/i686-gentoo-linux-uclibc/bin/ -c -DEFAULT_PIE_SSP -DEFAULT_RELRO -DEFAULT_BIND_NOW -DUSE_UCLIBC -march=athlon-xp -pipe -O2 - fprofile-generate -DIN_GCC -W -Wall -Ww rite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long - Wold-style-definition -DHAVE_CONFIG_H -I. -I. -I/var/tmp/portage/gcc-3.4. 4/work/gcc-3.4.4/gcc -I/var/tmp/port age/gcc-3.4.4/work/gcc-3.4.4/gcc/. -I/var/tmp/portage/gcc-3.4.4/work/gcc-3.4.4/ gcc/../include /var/tmp/portage/gcc-3.4.4/work/gcc-3.4.4/gcc/mkdeps.c -o mkdeps.o | xgcc: Internal error: Killed (program cc1) | Please submit a full bug report. | See <URL:http://bugs.gentoo.org/> for instructions. | make[2]: *** [mkdeps.o] Error 1 | make[2]: Leaving directory `/var/tmp/portage/gcc-3.4.4/work/build/gcc' + this from dmesg: | cc1[9902]: segfault at 0000000068736168 rip 0000000068736168 rsp 00000000bfffbcfc error 14 | PAX: execution attempt in: <NULL>, 00000000-00000000 00000000 | PAX: terminating task: /var/tmp/portage/gcc-3.4.4/work/build/gcc/stage1/ cc1(cc1):9902, uid/euid: 250/250, PC: 0000000068736168, SP: 00000000bfffbcfc | PAX: bytes at PC: <1>grsec: (g32:S:/mnt/g32/jn) denied resource overstep by requesting 1468833792 for RLIMIT_STACK against limit 2088960 for /mnt/g32/jn/ var/tmp/portage/gcc-3.4.4/work/build/gcc/stage1/cc1[cc1:9902] uid/euid:250/250 gid/egid:250/250, parent /mnt/g32/jn/var/tmp/portage/gcc-3.4.4/work/build/gcc/ stage1/xgcc[xgcc:24227] uid/euid:250/250 gid/egid:250/250 | <invalid address>. | grsec: (g32:S:/mnt/g32/jn) denied resource overstep by requesting 4096 for RLIMIT_CORE against limit 0 for /mnt/g32/jn/var/tmp/portage/gcc-3.4.4/work/ build/gcc/stage1/cc1[cc1:9902] uid/euid:250/250 gid/egid:250/250, parent /mnt/ g32/jn/var/tmp/portage/gcc-3.4.4/work/build/gcc/stage1/xgcc[xgcc:24227] uid/ euid:250/250 gid/egid:250/250 (Note that I am running an 64-Bit-Kernel with a 64-Bit-System on AMD64, all of the above (except for the dmesg) was from a 32-Bit-system on a chroot, for which the MPROTECT-feature is disabled using GRSecurity's ACL system. (otherwise I cannot run 32-Bit-executables, see also bug #93769 for this.) That is, setting STAGE1_CFLAGS to -O2 or -O -funit-at-a-time doesn't fix anything here. (also passing -funit-at-a-time to emerge-perl-CFLAGS doesn't prevent the emit-rtl.c:3343-one from happening there. This was submitted in bug #99247, which is a duplicate of bug #97538, which has in turn been marked as being a duplicate of this bug.) I will now try as suggested in comment #11. Regards, Milan
The steps in comment #11 (basically rebuilding the entire toolchain from the correctly built hardened gcc-3.4.4) worked for gcc. It also worked when I went back and tried to build links (where I first experienced this bug) in bug 97312. However, I experienced it in one/two more packages after this (sadly, I forget which), and I gave up currently working with the hardened gcc. I am fairly certain that I rebuilt the entire toolchain in the correct, repeated order, but this is where the other errors I had may come from if they are more "my fault" than gcc hardened's "fault".
I could reproduce this error on my server. I had to recompile gcc twice before it would happend again. Setting STAGE1_CFLAGS to -O -funit-at-a-time gets me past this error but then I get the same error as Milan instead: make[2]: Entering directory `/var/tmp/portage/gcc-3.4.4/work/build/gcc' stage1/xgcc -Bstage1/ -B/usr/i686-pc-linux-gnu/bin/ -c -DEFAULT_PIE_SSP - DEFAULT_RELRO -DEFAULT_BIND_NOW -O2 -march=pentium3 -pipe -fprofile-use -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes - pedantic -Wno-long-long -Wold-style-definition -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -I. -I/var/tmp/portage/gcc-3.4.4/work/gcc-3.4.4/gcc -I/ var/tmp/portage/gcc-3.4.4/work/gcc-3.4.4/gcc/. -I/var/tmp/portage/gcc-3.4.4/work/gcc-3.4.4/gcc/../include /var/tmp/portage/ gcc-3.4.4/work/gcc-3.4.4/gcc/genmodes.c -o genmodes.o cc1: stack smashing attack in function branch_prob() xgcc: Internal error: Aborted (program cc1) Please submit a full bug report. See <URL:http://bugs.gentoo.org/> for instructions. make[2]: *** [genmodes.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/gcc-3.4.4/work/build/gcc' make[1]: *** [stagefeedback_build] Error 2 make[1]: Leaving directory `/var/tmp/portage/gcc-3.4.4/work/build/gcc' make: *** [profiledbootstrap] Error 2 However setting STAGE1_CFLAGS to -O2 gets me past this error too and gcc installs successfully.
Out of curiosity, has anyone looked at Robert Connolly's work for the Hardened Linux from Scratch project? While I'm not savvy enough myself to follow his toolchain patches from one end to the other, they do seem to produce a working toolchain capable of recompiling itself. Maybe one of the devs would be willing to investigate what you folks and Hardened LFS are doing differently? The links are http://lfs.osuosl.org/patches/downloads/gcc/ http://lfs.osuosl.org/patches/downloads/binutils/ http://lfs.osuosl.org/patches/downloads/glibc/
we know Robert Connolly (he goes by 'ashes' on irc), but i dont think we've chatted about ssp much
*** Bug 95298 has been marked as a duplicate of this bug. ***
OK, gcc-3.4.4 was working for me. Today I upgraded to gcc-3.4.4-r1 and got this error with lm_sensors. The working one was emerged on: $ genlop -s gcc Sun Jul 10 20:08:45 2005 >>> sys-devel/gcc-3.4.4 Downgraded again from 3.4.4-r1 to 3.4.4 using the binary package and lm_sensors-2.9.1-r1 compiles without a hitch.
Created attachment 67180 [details, diff] Fixes the STAGE1 default in the toolchain eclass Yep, I also found that recompiling gcc lost the previous temporary patch i'd applied. It seems as though the toolchain.eclass hasn't been fixed to apply -O2 rather than just -O when build gcc. The attached patch does this, but when applied to the main portage tree it will get overwritten after the next sync. It would be best if this got fixed in the main tree...
*** Bug 104457 has been marked as a duplicate of this bug. ***
(In reply to comment #54) > Created an attachment (id=67180) [edit] > Fixes the STAGE1 default in the toolchain eclass > Yep, I also found that recompiling gcc lost the previous temporary patch i'd > applied. It seems as though the toolchain.eclass hasn't been fixed to apply > -O2 rather than just -O when build gcc. The attached patch does this, but when > applied to the main portage tree it will get overwritten after the next sync. > It would be best if this got fixed in the main tree... This patch works fine for me, unless it breaks something else, I'd vote for this solution.
*** Bug 106138 has been marked as a duplicate of this bug. ***
Any reason why the patch from Comment #54 cannot be used? It works.
*** Bug 106182 has been marked as a duplicate of this bug. ***
I just hit this on a new system. I'm verifying that adding -funit-at-a-time corrects the problem here, and I'll use that if the compiler being used is 3.4 (since is works fine with 3.3, and 3.3 doesn't have -funit-at-a-time). If that doesn't work, I'll try -O2.
Created attachment 68918 [details, diff] toolchain.eclass.patch I added -funit-at-a-time to STAGE1_CFLAGS if we're building with gcc-3.4, then I rebuild gcc-3.4.4-r1 using gcc-3.3.6. I switched to 3.4.4-vanilla and rebuilt gcc-3.4.4-r1 3 times successfully. I then switched to 3.4.4 (hardened) and it failed to build gcc. I then changed the stage1_cflags to be -O2, and it's built gcc once so far, and I'll leave it going overnight. At the very least this suggests that just adding -funit-at-a-time is not the solution. I'm curious what combination of flags in -O2 alleviates this bug, but I've got better things to do with my time than dig further into that... Attached is a patch which bumps to -O2 only if using a hardened 3.4 compiler to build a 3.4 compiler because I don't like the idea of bumping to -O2 globally. Please verify that this fixes the problem for you guys as well, and I'll commit it.
*** Bug 78544 has been marked as a duplicate of this bug. ***
*** Bug 115968 has been marked as a duplicate of this bug. ***
Have we fixed this?
(In reply to comment #64) > Have we fixed this? I reckon so, since we've had no dups for three months :) Anyone still having the problem, yell.