Compiling fails with gcc-4.6.3 hardened Full log follows. First errors: In file included from /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/x86intrin.h:27:0, from /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-4.7.3/libitm/config/x86/target.h:72, from /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-4.7.3/libitm/libitm_i.h:82, from /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/gcc-4.7.3/libitm/aatree.cc:28: /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h: In function ‘int __bsrd(int)’: /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h:41:35: error: ‘__builtin_ia32_bsrsi’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h: In function ‘long long unsigned int __rdpmc(int)’: /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h:89:35: error: ‘__builtin_ia32_rdpmc’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h: In function ‘long long unsigned int __rdtsc()’: /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h:97:32: error: ‘__builtin_ia32_rdtsc’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h: In function ‘long long unsigned int __rdtscp(unsigned int*)’: /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h:105:36: error: ‘__builtin_ia32_rdtscp’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h: In function ‘unsigned char __rolb(unsigned char, int)’: /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h:113:40: error: ‘__builtin_ia32_rolqi’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h: In function ‘short unsigned int __rolw(short unsigned int, int)’: /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h:121:40: error: ‘__builtin_ia32_rolhi’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h: In function ‘unsigned char __rorb(unsigned char, int)’: /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h:137:40: error: ‘__builtin_ia32_rorqi’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h: In function ‘short unsigned int __rorw(short unsigned int, int)’: /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h:145:40: error: ‘__builtin_ia32_rorhi’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h: In function ‘void __pause()’: /var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/./gcc/include/ia32intrin.h:161:25: error: ‘__builtin_ia32_pause’ was not declared in this scope configure: FPU dependent file will be fpu-387.h checking POSIX version of getpwuid_r with 5 arguments... make[8]: *** [aatree.lo] Error 1 make[8]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/x86_64-pc-linux-gnu/32/libitm' make[7]: *** [all-recursive] Error 1 make[7]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/x86_64-pc-linux-gnu/32/libitm' make[6]: *** [all] Error 2 make[6]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/x86_64-pc-linux-gnu/32/libitm' make[5]: *** [multi-do] Error 1 make[5]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/x86_64-pc-linux-gnu/libitm' make[4]: *** [all-multi] Error 2 make[4]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/x86_64-pc-linux-gnu/libitm' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/x86_64-pc-linux-gnu/libitm' make[2]: *** [all] Error 2 make[2]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.7.3-r1/work/build/x86_64-pc-linux-gnu/libitm' make[1]: *** [all-target-libitm] Error 2 make[1]: *** Waiting for unfinished jobs.... Reproducible: Always Portage 2.2.1 (hardened/linux/amd64, gcc-4.6.3, glibc-2.15-r3, 3.10.1-hardened-r1 x86_64) ================================================================= System uname: Linux-3.10.1-hardened-r1-x86_64-AMD_Athlon-tm-_64_Processor_3000+-with-gentoo-2.2 KiB Mem: 2041220 total, 933676 free KiB Swap: 995992 total, 979408 free Timestamp of tree: Mon, 30 Sep 2013 03:45:01 +0000 ld GNU ld (GNU Binutils) 2.23.1 ccache version 3.1.9 [enabled] app-shells/bash: 4.2_p45 dev-lang/python: 2.7.5-r2, 3.2.5-r2 dev-util/ccache: 3.1.9 dev-util/cmake: 2.8.10.2-r2 dev-util/pkgconfig: 0.28 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.11.8 sys-apps/sandbox: 2.6-r1 sys-devel/autoconf: 2.13, 2.69 sys-devel/automake: 1.12.6, 1.13.4 sys-devel/binutils: 2.23.1 sys-devel/gcc: 4.6.3 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4.2 sys-devel/make: 3.82-r4 sys-kernel/linux-headers: 3.9 (virtual/os-headers) sys-libs/glibc: 2.15-r3 Repositories: gentoo repo_name-portage-disturbed repo_name-portage-snix ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe" CHOST="x86_64-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/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=native -O2 -pipe" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs candy ccache collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://de-mirror.org/gentoo/ ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo" LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage-disturbed /usr/portage-snix" SYNC="rsync://linux.rz.ruhr-uni-bochum.de/gentoo-portage" USE="acpi amd64 bash-completion berkdb bzip2 cdb crypt curl encode gd gif gmp gpm hardened iconv idn imagemagick ipv6 jpeg jpeg2k kerberos krb4 logrotate mbox multilib ncurses nls nptl nptlonly offensive pam pcre perl pic png python readline sasl session skey spell sqlite ssl tcpd threads tiff truetype ucs2 unicode vhosts xml zlib" ABI_X86="64" CURL_SSL="openssl" ELIBC="glibc" KERNEL="linux" LINGUAS="en de" NGINX_MODULES_HTTP="access addition auth_basic autoindex browser cache_purge charset dav empty_gif fastcgi flv geo geoip gunzip gzip gzip_static headers_more image_filter limit_req map memcached mp4 naxsi perl proxy push random_index realip referer rewrite scgi secure_link spdy split_clients ssi stub_status sub upload_progress upstream_ip_hash userid uwsgi xslt concat limit_zone redis" NGINX_MODULES_MAIL="imap pop3 smtp" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7 python 3_2" PYTHON_TARGETS="python2_7 python3_2" USERLAND="GNU" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Created attachment 359782 [details] build.log.tar.bz2
Created attachment 360282 [details] A different set of build logs having the same problem I've had the same issue. emerge --info '=sys-devel/gcc-4.7.3-r1::gentoo' Portage 2.2.1 (default/linux/amd64/13.0, gcc-4.6.3, glibc-2.15-r3, 3.4.9-gentoo x86_64) ================================================================= System Settings ================================================================= System uname: Linux-3.4.9-gentoo-x86_64-AMD_Athlon-tm-_64_Processor_3400+-with-gentoo-2.2 KiB Mem: 2052564 total, 112516 free KiB Swap: 4194300 total, 4073176 free Timestamp of tree: Sun, 06 Oct 2013 05:00:01 +0000 ld GNU ld (GNU Binutils) 2.23.1 app-shells/bash: 4.2_p45 dev-java/java-config: 2.1.12-r1 dev-lang/python: 2.7.5-r2, 3.2.5-r2 dev-util/cmake: 2.8.10.2-r2 dev-util/pkgconfig: 0.28 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.11.8 sys-apps/sandbox: 2.6-r1 sys-devel/autoconf: 2.13, 2.69 sys-devel/automake: 1.9.6-r3, 1.11.6, 1.12.6, 1.13.4 sys-devel/binutils: 2.23.1 sys-devel/gcc: 4.6.3 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4.2 sys-devel/make: 3.82-r4 sys-kernel/linux-headers: 3.9 (virtual/os-headers) sys-libs/glibc: 2.15-r3 Repositories: gentoo ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -march=native" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/lib/hsqldb" 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" CXXFLAGS="-O2 -pipe -march=native" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LDFLAGS="-Wl,-O1 -Wl,--as-needed" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" USE="3dnow 3dnowext X a52 aac acl alsa amd64 apng audiofile bash-completion berkdb branding bzip2 cdda cdr cli consolekit cracklib crypt css cxx dbus dri dts dv dvd dvdr encode exif ffmpeg firefox fortran gdbm gif gsm gzip iconv ipv6 jack java java6 javascript jit jpeg lame libnotify lock lzma mad matroska midi mmap mmx modules mp3 mp4 mpeg mplayer mudflap multilib ncurses nls nptl nptlonly nsplugin nvidia offensive ogg openal opengl openmp pam pch pcre png posix python readline sdl session sharedmem sound sse sse2 ssl startup-notification tcpd theora threads thunar tiff timidity truetype udev unicode usb v4l vcd videos vorbis win32codecs x264 xcb xcomposite xine xinetd xpm xscreensaver xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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 sheets stage tables krita karbon braindump author" 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" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_US" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" QEMU_SOFTMMU_TARGETS="arm i386 ppc x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="nv vga vesa" 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, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON emerge -pqv '=sys-devel/gcc-4.7.3-r1::gentoo' [ebuild NS ] sys-devel/gcc-4.7.3-r1 [4.6.3] USE="cxx fortran mudflap (multilib) nls nptl openmp (-altivec) -doc (-fixed-point) -gcj -go -graphite -gtk (-hardened) (-libssp) -lto -multislot -nopie -nossp -objc -objc++ -objc-gc -regression-test -vanilla"
What is the output of `echo "" | gcc -march=native -v -E - 2>&1 | grep cc1`? Can you try a different -march value than native?
echo "" | gcc -march=native -v -E - 2>&1 | grep cc1 /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1 -E -quiet -v - -march=k8 -mno-cx16 -mno-sahf -mno-movbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx -mno-sse4.2 -mno-sse4.1 --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=k8 -fno-strict-overflow -fPIE -fstack-protector-all What should I set other than march=k8 or native here?
echo "" | gcc -march=native -v -E - 2>&1 | grep cc1 /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1 -E -quiet -v - -march=k8 -mno-cx16 -mno-sahf -mno-movbe -mno-aes -mno-pclmul -mno-popcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx -mno-sse4.2 -mno-sse4.1 --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=k8 echo "" | gcc -march=k8 -v -E - 2>&1 | grep cc1 /usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1 -E -quiet -v - -march=k8 I just set CFLAGS="-O2 -pipe -march=k8" in /etc/make.conf and was able to build successfully.
Can you add this line right before toolchain_src_unpack in src_unpack() in gcc-4.7.3-r1.ebuild: EPATCH_EXCLUDE+=" 97_all_native-ivybridge.patch" and try building with -march=native? I'm assuming 4.7.3 worked previously?
Actually scratch that. That patch only touches the intel path.
Try the above but with 49_all_x86_pr52695_libitm-m64.patch instead (hopefully you don't hit the bug that patch fixes).
So, there are already two build logs concerning this blocking problem, the first one dating almost three months ago. Does it make sense to add more build logs showing the same symptom, in a 'Me Too' type of style? Or would that just be seen as adding redundant noise to the bug report?
No, more build logs are not useful. I already said what I need.
I have had the same problem compiling sys-devel/gcc-4.7.3-r1 with -march=native on non-hardened x86. The proposed solution of excluding patch 49_all_x86_pr52695_libitm-m64.patch worked for me.
Thanks. Can you try 4.8?
*** Bug 497350 has been marked as a duplicate of this bug. ***
sys-devel/gcc-4.8.2 emerged fine. No patches needed.
Confirm that 4.8.2 built on my system as well.
4.8/4.9 are stable now. punting bugs like this for older versions.