Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 394821 - sys-dev/gcc-4.5.3-r2 - .../work/gcc-4.5.3/gcc/config/i386/i386.md:360:1: internal compiler error: Bus error
Summary: sys-dev/gcc-4.5.3-r2 - .../work/gcc-4.5.3/gcc/config/i386/i386.md:360:1: inte...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 395093 396059 (view as bug list)
Depends on: 395093
Blocks:
  Show dependency tree
 
Reported: 2011-12-15 14:41 UTC by Graham Murray
Modified: 2012-02-10 17:30 UTC (History)
5 users (show)

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


Attachments
Build log (sys-devel:gcc-4.5.3-r2:20111215-082006.log.gz,80.26 KB, application/x-gzip)
2011-12-15 14:41 UTC, Graham Murray
Details
/var/tmp/portage/sys-devel/gcc-4.5.3-r1/temp/build.log (build.log.gz,73.23 KB, application/x-gzip)
2011-12-17 01:51 UTC, Maxim Kammerer
Details
Hardened gcc-4.5.3-r1 with PIE_VER="0.4.7" build log (sys-devel:gcc-4.5.3-r1:20111229-024423.log.gz,279.33 KB, application/x-gzip)
2011-12-29 04:09 UTC, Maxim Kammerer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Murray 2011-12-15 14:41:24 UTC
Created attachment 295929 [details]
Build log

/var/tmp/portage/sys-devel/gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/i386/i386.md: In function ‘internal_dfa_insn_code’:
/var/tmp/portage/sys-devel/gcc-4.5.3-r2/work/gcc-4.5.3/gcc/config/i386/i386.md:360:1: internal compiler error: Bus error

I get the same error on 2 ~x86 systems.

 emerge --info
Portage 2.2.0_alpha81 (default/linux/x86/10.0/desktop/gnome, gcc-4.6.2, glibc-2.14.1-r1, 3.1.3-gentoo i686)
=================================================================
System uname: Linux-3.1.3-gentoo-i686-Intel-R-_Core-TM-2_Duo_CPU_E8200_@_2.66GHz-with-gentoo-2.1
Timestamp of tree: Thu, 15 Dec 2011 07:30:01 +0000
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.6.7-r2, 2.7.2-r3, 3.1.4-r3, 3.2.2
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.7
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.10.3, 1.11.1-r1
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.4.6-r1, 4.5.3-r1, 4.6.2
sys-devel/gcc-config:     1.5-r2
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r1
Repositories: gentoo sunrise x11 bitcoin betagarden Grahams_local_portage
Installed sets: @system
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -mtune=native -pipe -ggdb"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /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"
CXXFLAGS="-O2 -march=native -mtune=native -pipe -ggdb"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --autounmask-write y"
FEATURES="assume-digests binpkg-logs buildsyspkg distlocks ebuild-locks fixlafiles news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch xattr"
FFLAGS=""
GENTOO_MIRRORS="http://de-mirror.org/distro/gentoo/ http://gentoo.tiscali.nl/ http://mirror.ovh.net/gentoo-distfiles/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://ftp.snt.utwente.nl/pub/os/linux/gentoo"
LANG="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_GB en"
MAKEOPTS="-j3"
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="/var/lib/layman/sunrise /var/lib/layman/x11 /var/lib/layman/bitcoin /var/lib/layman/betagarden /usr/portage/local"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa apache2 avahi bash-completion berkdb branding bzip2 cairo caps cdda cdr cli colord consolekit cracklib crypt cups curl cvs cxx dbus doc dri dts dvd dvdr eds emacs emboss encode evo examples exif expat fam ffmpeg flac fortran gd gdbm gdu geoip gif gnome gnome-keyring gnome-online-accounts gnutls gpm gstreamer gtk gtkhtml hardened htmlhandbook iconv icu idn imagemagick imlib ipv6 java jpeg kde kdehiddenvisibility lcms libnotify libsamplerate logrotate lzma lzo mad mmap mmx mng modules mono mp3 mp4 mpeg mudflap nautilus ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pango pcre pdf perl pic png policykit postgres ppds pppd pulseaudio python qt3support qt4 readline samba sdl semantic-desktop session socialweb speex spell sqlite sqlite3 sse sse2 ssl startup-notification subversion svg sysfs tcl tcpd theora threads tiff tk truetype udev unicode usb vim-syntax vorbis x264 x86 xattr xcb xcomposite xml xorg xulrunner xv xvid zlib" ALSA_CARDS="intel-hda" 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="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="worker" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="vesa fbdev nv nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 SpanKY gentoo-dev 2011-12-15 18:26:36 UTC
might be related to your -march=native and gcc-4.6.2 as your host compiler ...

btw, -mtune=native with -march=native makes no sense.  the -march trumps it.
Comment 2 Maxim Kammerer 2011-12-16 22:30:25 UTC
This is not related to native arch switch / different host compiler. Self-compiling on hardened 4.5.3-r1 produces exactly the same error here. I am quite sure that 4.5.3-r1 compiled itself fine previously (i.e., due to -uDN when set of USE flags for gcc was changed). The kernel is *not* hardened (compilation happens inside chroot).

Curiously, my system is the same: "Intel(R) Core(TM)2 Duo CPU E8200 @ 2.66GHz". No idea whether it's a coincidence.

See also https://sourceforge.net/projects/liberte/forums/forum/1137582/topic/4797655?message=10925738

You can reproduce the whole environment (and probably the bug) by building Liberté Linux from scratch — gcc is rebuilt very early on in the process.

# emerge -pv gcc
[ebuild   R    ] sys-devel/gcc-4.5.3-r1  USE="cxx hardened nls nptl openmp (-altivec) -bootstrap -build -doc (-fixed-point) -fortran -gcj -graphite -gtk (-libffi) (-libssp) -lto -mudflap (-multilib) -multislot -nocxx -nopie -nossp -objc -objc++ -objc-gc -test -vanilla" 0 kB

Portage 2.1.10.11 (hardened/linux/x86, gcc-4.5.3, glibc-2.13-r4, 2.6.32-gentoo-r7 i686)
=================================================================
System uname: Linux-2.6.32-gentoo-r7-i686-with-gentoo-2.0.3
Timestamp of tree: Fri, 16 Dec 2011 00:45:01 +0000
app-shells/bash:          4.1_p9
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.9.6-r3, 1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo liberte
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="@FREE freedist unRAR lha @BINARY-REDISTRIBUTABLE ipw3945 Atmel radeon-ucode SIL-freeware amd-ucode"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -march=pentium3 -mtune=core2 -mfpmath=sse -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc/locale.gen"
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/splash /etc/terminfo"
CXXFLAGS="-Os -march=pentium3 -mtune=core2 -mfpmath=sse -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-unmerge-warn --autounmask=n"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org                 http://mirrors.kernel.org/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-O,1,-z,combreloc"
LINGUAS="*"
MAKEOPTS="-j3"
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"
SYNC="rsync://disabled"
USE="X X509 aac acl acpi alsa archive aspell bluetooth bs2b bzip2 cairo caps cdda cjk cli consolekit crypt cue dbus dhcp djvu dri dynamic eap-tls exif expat fbcondecor flac gconf gmp gpm grammar groupwise gtk hardened hires-icons hybrid-auth iconv id3tag idn iproute2 irda jbig jpeg jpeg2k lcms libkms libnotify lzma mad madwifi mktemp mmx modules mp3 multicall ncurses networkmanager nls nptl nptlonly ogg opengl openmp ots pam pax_kernel pcmcia pcre pcsc-lite pic pkcs11 png policykit pppd pth readline scsi silc smartcard smime sndfile speex spell sse startup-notification staticsocket svg symlink sysfs thesaurus threads tiff tordns truetype unicode urandom usb v4l vorbis wavpack wimax wmf x86 x86emu xattr xinerama xmp xorg xv zlib" ALSA_CARDS="sb16" 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="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev synaptics vmmouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="*" NGINX_MODULES_HTTP="access fastcgi gzip limit_req limit_zone map rewrite stub_status" PHP_TARGETS="php5-3" QEMU_SOFTMMU_TARGETS="x86_64" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 intel mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa via vmware virtualbox qxl" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

*** glibc detected *** /var/tmp/portage/sys-devel/gcc-4.5.3-r1/work/build/./prev-gcc/cc1: free(): invalid next size (normal): 0xffe66a70 ***
======= Backtrace: =========
/lib/libc.so.6(+0x6ec6f)[0xf69f6c6f]
/lib/libc.so.6(+0x705db)[0xf69f85db]
/lib/libc.so.6(+0x72258)[0xf69fa258]
/lib/libc.so.6(realloc+0xe4)[0xf69fb954]
/var/tmp/portage/sys-devel/gcc-4.5.3-r1/work/build/./prev-gcc/cc1(xrealloc+0x5e)[0xf76cddbb]
/var/tmp/portage/sys-devel/gcc-4.5.3-r1/work/build/./prev-gcc/cc1(+0x67bb8e)[0xf7266b8e]
...
/lib/libc.so.6(__libc_start_main+0xe7)[0xf69a2277]
/var/tmp/portage/sys-devel/gcc-4.5.3-r1/work/build/./prev-gcc/cc1(+0xb1d51)[0xf6c9cd51]
======= Memory map: ========
...
/var/tmp/portage/sys-devel/gcc-4.5.3-r1/work/gcc-4.5.3/gcc/config/i386/i386.md: In function ‘internal_dfa_insn_code’:
/var/tmp/portage/sys-devel/gcc-4.5.3-r1/work/gcc-4.5.3/gcc/config/i386/i386.md:360:1: internal compiler error: Aborted
Comment 3 Maxim Kammerer 2011-12-16 22:54:35 UTC
I suspect that the latest stable binutils update caused this problem. Will do a full rebuild from stage 3 and report here whether the problem persists.
Comment 4 Maxim Kammerer 2011-12-17 00:02:47 UTC
So far, gcc from stage3 compiles itself fine (quick summary of first stages of Liberté Linux build follows):

stage3-i686-20111213
portage-20111215.tar.bz2

Setting a hardened profile

>>> Installing (1 of 12) sys-devel/autoconf-wrapper-10-r1
>>> Installing (2 of 12) sys-devel/automake-wrapper-5
>>> Installing (3 of 12) sys-devel/m4-1.4.15
>>> Installing (4 of 12) dev-perl/Locale-gettext-1.50.0
>>> Installing (5 of 12) sys-devel/autoconf-2.68
>>> Installing (6 of 12) sys-apps/help2man-1.38.2
>>> Installing (7 of 12) sys-devel/bison-2.4.3
>>> Installing (8 of 12) sys-devel/automake-1.11.1
>>> Installing (9 of 12) virtual/yacc-0
>>> Installing (10 of 12) sys-devel/libtool-2.4-r1
>>> Installing (11 of 12) sys-devel/flex-2.5.35_p10
>>> Installing (12 of 12) sys-devel/binutils-2.21.1-r1

cat /var/db/pkg/sys-devel/binutils-2.21.1-r1/USE 
elibc_glibc kernel_linux nls userland_GNU x86 zlib

cat /var/db/pkg/sys-devel/gcc-4.5.3-r1/USE
cxx elibc_glibc fortran kernel_linux mudflap nls nptl openmp userland_GNU x86

>>> Installing (1 of 1) sys-devel/gcc-4.5.3-r1

cat /var/db/pkg/sys-devel/gcc-4.5.3-r1/USE
cxx elibc_glibc hardened kernel_linux nls nptl openmp userland_GNU x86
Comment 5 Maxim Kammerer 2011-12-17 01:49:13 UTC
Second self-compilation fails:

/var/tmp/portage/sys-devel/gcc-4.5.3-r1/work/gcc-4.5.3/gcc/config/i386/i386.md: In function ‘internal_dfa_insn_code’:
/var/tmp/portage/sys-devel/gcc-4.5.3-r1/work/gcc-4.5.3/gcc/config/i386/i386.md:360:1: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.gentoo.org/> for instructions.
make[3]: *** [insn-attrtab.o] Error 1

See the attachment for details (my guess it's very similar to the one by bug submitter).

To replicate:
  git clone https://github.com/mkdesu/liberte.git
  liberte/build /tmp/livecd

The second time gcc is compiled, the compilation will fail. To investigate:
  liberte/enter /tmp/livecd
Comment 6 Maxim Kammerer 2011-12-17 01:51:15 UTC
Created attachment 296095 [details]
/var/tmp/portage/sys-devel/gcc-4.5.3-r1/temp/build.log
Comment 7 Maxim Kammerer 2011-12-17 13:42:47 UTC
This seems like a hardened-only issue. Note that the submitter has "hardened" in their USE flags as well.

Using vanilla profile of "faulty" gcc to build itself works, it then can build a hardened version of itself, and another self-build (using hardened profile) fails. Flags like "fortran" and "mudflap" don't matter.
Comment 8 Xake 2011-12-17 17:48:33 UTC
(In reply to comment #1)
> might be related to your -march=native and gcc-4.6.2 as your host compiler ...
> 
> btw, -mtune=native with -march=native makes no sense.  the -march trumps it.

Vapier, I think I have told you before that this is bogus.

Take my hardened stable machine.

# emerge -1 glibc && grep -E '(mtune|march)' /var/log/portage/sys-libs\:glibc*

On my system without -mtune=native in /etc/make.conf I get:
 * Auto adding -march=x86_64 to CFLAGS_x86 #185404
 * Auto adding -march=x86_64 to CFLAGS_x86 #185404
checking for assembler -mtune=i686 support... yes
 * Auto adding -march=x86_64 to CFLAGS_x86 #185404

However if I add -mtune=native to /etc/make.conf I get:
 * Auto adding -march=x86_64 to CFLAGS_x86 #185404
 * Auto adding -march=x86_64 to CFLAGS_x86 #185404
checking for assembler -mtune=i686 support... yes
 * Auto adding -march=x86_64 to CFLAGS_x86 #185404
 * Auto adding -march=x86_64 to CFLAGS_x86 #185404
 * Auto adding -march=x86_64 to CFLAGS_x86 #185404
 *          CFLAGS:   -pipe -mtune=native -ggdb -O2 -fno-strict-aliasing -fno-stack-protector
checking for assembler -mtune=i686 support... yes
 * Auto adding -march=x86_64 to CFLAGS_x86 #185404
...and after here every call to gcc made during the operation...


Now, it may be a bug that "-march=x86_64" never gets added to CFLAGS for real (I think we have had a discussion in a old bug about why you filter -march to begin with), however "-mtune=native -march=x86_64" gives a better optimization according to "man gcc" then just "-march=x86_64".
But mostly this proves that there are at least one case on every gentoo system where there is a reason to set both -march and -mtune: sys-libs/glibc...
Comment 9 Magnus Granberg gentoo-dev 2011-12-20 18:44:53 UTC
Can confirm the bug but i get it 1 of ~5
Comment 10 Magnus Granberg gentoo-dev 2011-12-20 18:46:33 UTC
*** Bug 395093 has been marked as a duplicate of this bug. ***
Comment 11 Maxim Kammerer 2011-12-20 18:53:05 UTC
(In reply to comment #9)
> Can confirm the bug but i get it 1 of ~5

When compiling a hardened gcc, or regular? I get it only when compiling hardened gcc (doesn't matter which host compiler is used), 80% of the time. What's your hardware?
Comment 12 Magnus Granberg gentoo-dev 2011-12-20 22:14:17 UTC
jasmin / # emerge --info
Portage 2.1.10.41 (hardened/linux/x86, gcc-4.5.3, glibc-2.13-r4, 3.0.4-hardened-r1 i686)
=================================================================
System uname: Linux-3.0.4-hardened-r1-i686-Intel-R-_Xeon-R-_CPU_E5420_@_2.50GHz-with-gentoo-2.0.3
Timestamp of tree: Tue, 20 Dec 2011 16:45:01 +0000
app-shells/bash:          4.1_p9
dev-lang/python:          2.6.5-r3, 2.7.2-r3, 3.1.4-r3
dev-util/cmake:           2.8.1-r2
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.0.3
sys-apps/openrc:          0.9.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.4.5, 4.5.3-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=i686"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /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"
CXXFLAGS="-O2 -pipe -march=i686"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news nostrip parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="ftp://ftp.sunet.se/pub/Linux/distributions/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
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=""
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="acl berkdb bzip2 cli cracklib crypt cups cxx dri gdbm gpm hardened iconv modules mudflap ncurses nls nptl nptlonly openmp pam pax_kernel pcre pic pppd readline session ssl sysfs tcpd urandom x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="peruser" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 intel mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa via vmware nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 13 Magnus Granberg gentoo-dev 2011-12-22 17:33:51 UTC
Can someone test a updated piepatchset for gcc-4.5.3
Change PIE_VER="0.4.5" or PIE_VER="0.4.6" to 0.4.7 in the ebuild
Have disable that we build gcc with PIE
It will lover the mem and hw use.
We allready do this in gcc-4.6.2
Else you should lover the MAKEOPTS to see if that helps
Comment 14 Maxim Kammerer 2011-12-22 18:38:13 UTC
(In reply to comment #13)
> Else you should lover the MAKEOPTS to see if that helps

MAKEOPTS don't matter — once emerge fails, you can manually run xgcc on insn-attrtab.c as shown in bug #395093 and see the error happening only part of the time.
Comment 15 Magnus Granberg gentoo-dev 2011-12-26 12:51:07 UTC
*** Bug 396059 has been marked as a duplicate of this bug. ***
Comment 16 Magnus Granberg gentoo-dev 2011-12-28 15:36:11 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > Else you should lover the MAKEOPTS to see if that helps
> 
> MAKEOPTS don't matter — once emerge fails, you can manually run xgcc on
> insn-attrtab.c as shown in bug #395093 and see the error happening only part of
> the time.

Have you tested the new piepatchset from comment 14?
Did fix the same problem for bulding the autostage3 files for hardened x86
Comment 17 Maxim Kammerer 2011-12-29 04:07:23 UTC
(In reply to comment #16)
> Have you tested the new piepatchset from comment 14?
> Did fix the same problem for bulding the autostage3 files for hardened x86

Just tested building hardened sys-devel/gcc-4.5.3-r1 on x86 with piepatchset 0.4.7.

Building with FEATURES+=test, MAKEOPTS=-j5 and USE="cxx hardened nls nptl openmp test" succeeds, but with some tests failed (see attached build log). Not sure whether it's a problem, though.

Running the offending "xgcc ... insn-attrs.c" command which caused 8 out of 10 failures previously now succeeded 12 times out of 12 (side note — build needs to be stopped in the middle for that, otherwise prev-gcc directory is removed).
Comment 18 Maxim Kammerer 2011-12-29 04:09:49 UTC
Created attachment 297269 [details]
Hardened gcc-4.5.3-r1 with PIE_VER="0.4.7" build log
Comment 19 Maxim Kammerer 2011-12-29 04:13:01 UTC
The attachment got compressed again by Bugzilla for some reason, so uncompress twice.
Comment 20 Ryan Hill (RETIRED) gentoo-dev 2011-12-29 04:49:05 UTC
tests always fail.  prob unrelated.
Comment 21 Magnus Granberg gentoo-dev 2011-12-30 20:18:00 UTC
Fixed in gcc-4.5.3-r2 with piepatchset bump to 0.4.7
Comment 22 Francisco Blas Izquierdo Riera (RETIRED) gentoo-dev 2012-02-10 17:30:58 UTC
(In reply to comment #13)
> Can someone test a updated piepatchset for gcc-4.5.3
> Change PIE_VER="0.4.5" or PIE_VER="0.4.6" to 0.4.7 in the ebuild
> Have disable that we build gcc with PIE
> It will lover the mem and hw use.
> We allready do this in gcc-4.6.2
> Else you should lover the MAKEOPTS to see if that helps

@Zorry, To me it would make more sense trying first to filter pipe since this tends to be a big memory hog with gcc's dfas. I hit that same problem on amd64 and the recommendation by upstream was just disabling pipe to prevent the command from holding the copies of the data in memory.