Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 506202 - [4.8] sys-devel/gcc - libitm fails to build with -mno-rtm (‘_xbegin’ was not declared in this scope)
Summary: [4.8] sys-devel/gcc - libitm fails to build with -mno-rtm (‘_xbegin’ was not ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-30 00:01 UTC by Thomas Deutschmann (RETIRED)
Modified: 2014-05-20 10:41 UTC (History)
0 users

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


Attachments
gcc-build-logs.tar.bz2 (gcc-build-logs.tar.bz2,380.46 KB, application/x-bzip-compressed-tar)
2014-03-30 00:02 UTC, Thomas Deutschmann (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Deutschmann (RETIRED) gentoo-dev 2014-03-30 00:01:48 UTC
Hi,

I upgraded to sys-libs/glibc-2.19:2.2 and decided to rebuild @system. This failed it was time to rebuild sys-devel/gcc-4.8.2.

build.log excerpt from the first error to end:

libtool: compile:  /var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include -DHAVE_CONFIG_H -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/config/x86 -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/config/posix -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic -I. -Wall -pthread -g -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt -mno-rtm -mtune=generic -MT tas_4_.lo -MD -MP -MF .deps/tas_4_.lo.Ppo -DN=4 -c /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/tas_n.c  -fPIC -DPIC -o .libs/tas_4_.o
In file included from /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/libitm_i.h:82:0,
                 from /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/alloc.cc:25:
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h: In function ‘uint32_t GTM::htm_begin()’:
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h:100:18: error: ‘_xbegin’ was not declared in this scope
   return _xbegin();
                  ^
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h: In function ‘bool GTM::htm_begin_success(uint32_t)’:
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h:106:23: error: ‘_XBEGIN_STARTED’ was not declared in this scope
   return begin_ret == _XBEGIN_STARTED;
                       ^
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h: In function ‘void GTM::htm_commit()’:
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h:112:9: error: ‘_xend’ was not declared in this scope
   _xend();
         ^
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h: In function ‘void GTM::htm_abort()’:
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h:120:15: error: ‘_xabort’ was not declared in this scope
   _xabort(0xff);
               ^
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h: In function ‘bool GTM::htm_abort_should_retry(uint32_t)’:
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h:126:22: error: ‘_XABORT_RETRY’ was not declared in this scope
   return begin_ret & _XABORT_RETRY;
                      ^
/bin/sh ./libtool --tag=CC   --mode=compile /var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include    -DHAVE_CONFIG_H -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/config/x86 -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/config/posix -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic -I.    -Wall  -pthread -g -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt -mno-rtm -mtune=generic -MT load_8_.lo -MD -MP -MF .deps/load_8_.lo.Ppo -DN=8  -c -o load_8_.lo /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/load_n.c
libtool: compile:  /var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include -DHAVE_CONFIG_H -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/config/x86 -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/config/posix -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic -I. -Wall -pthread -g -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt -mno-rtm -mtune=generic -MT tas_4_.lo -MD -MP -MF .deps/tas_4_.lo.Ppo -DN=4 -c /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/tas_n.c -o tas_4_.o >/dev/null 2>&1
Makefile:517: recipe for target 'alloc.lo' failed
make[4]: *** [alloc.lo] Error 1
/bin/sh ./libtool --tag=CC   --mode=compile /var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include    -DHAVE_CONFIG_H -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/config/x86 -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/config/posix -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic -I.    -Wall  -pthread -g -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt -mno-rtm -mtune=generic -MT store_8_.lo -MD -MP -MF .deps/store_8_.lo.Ppo -DN=8  -c -o store_8_.lo /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/store_n.c
depbase=`echo math/ilogbq.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool --tag=CC   --mode=compile /var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include    -DHAVE_CONFIG_H -I. -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libquadmath     -g -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt -mno-rtm -mtune=generic  -m32 -MT math/ilogbq.lo -MD -MP -MF $depbase.Tpo -c -o math/ilogbq.lo /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libquadmath/math/ilogbq.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  /var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include -DHAVE_CONFIG_H -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/config/x86 -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/config/posix -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic -I. -Wall -pthread -g -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt -mno-rtm -mtune=generic -MT load_8_.lo -MD -MP -MF .deps/load_8_.lo.Ppo -DN=8 -c /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/load_n.c  -fPIC -DPIC -o .libs/load_8_.o
libtool: compile:  /var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include -DHAVE_CONFIG_H -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/config/x86 -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/config/posix -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic -I. -Wall -pthread -g -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt -mno-rtm -mtune=generic -MT store_8_.lo -MD -MP -MF .deps/store_8_.lo.Ppo -DN=8 -c /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/store_n.c  -fPIC -DPIC -o .libs/store_8_.o
In file included from /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/libitm_i.h:82:0,
                 from /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/alloc_c.cc:25:
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h: In function ‘uint32_t GTM::htm_begin()’:
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h:100:18: error: ‘_xbegin’ was not declared in this scope
   return _xbegin();
                  ^
libtool: compile:  /var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include -DHAVE_CONFIG_H -I. -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libquadmath -g -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt -mno-rtm -mtune=generic -m32 -MT math/fminq.lo -MD -MP -MF math/.deps/fminq.Tpo -c /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libquadmath/math/fminq.c  -fPIC -DPIC -o math/.libs/fminq.o
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h: In function ‘bool GTM::htm_begin_success(uint32_t)’:
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h:106:23: error: ‘_XBEGIN_STARTED’ was not declared in this scope
   return begin_ret == _XBEGIN_STARTED;
                       ^
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h: In function ‘void GTM::htm_commit()’:
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h:112:9: error: ‘_xend’ was not declared in this scope
   _xend();
         ^
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h: In function ‘void GTM::htm_abort()’:
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h:120:15: error: ‘_xabort’ was not declared in this scope
   _xabort(0xff);
               ^
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h: In function ‘bool GTM::htm_abort_should_retry(uint32_t)’:
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libitm/config/x86/target.h:126:22: error: ‘_XABORT_RETRY’ was not declared in this scope
   return begin_ret & _XABORT_RETRY;
                      ^
/bin/sh ./libtool --tag=CC   --mode=compile /var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include    -DHAVE_CONFIG_H -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/config/x86 -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/config/posix -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic -I.    -Wall  -pthread -g -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt -mno-rtm -mtune=generic -MT cas_8_.lo -MD -MP -MF .deps/cas_8_.lo.Ppo -DN=8  -c -o cas_8_.lo /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/cas_n.c
libtool: compile:  /var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-4.8.2/work/build/./gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include -DHAVE_CONFIG_H -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/config/x86 -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/config/posix -I/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic -I. -Wall -pthread -g -O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt -mno-rtm -mtune=generic -MT store_8_.lo -MD -MP -MF .deps/store_8_.lo.Ppo -DN=8 -c /var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/libatomic/store_n.c -o store_8_.o >/dev/null 2>&1
Makefile:517: recipe for target 'alloc_c.lo' failed
make[4]: *** [alloc_c.lo] Error 1
make[4]: Leaving directory '/var/tmp/portage/sys-devel/gcc-4.8.2/work/build/x86_64-pc-linux-gnu/libitm'
Makefile:697: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/var/tmp/portage/sys-devel/gcc-4.8.2/work/build/x86_64-pc-linux-gnu/libitm'
Makefile:360: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-4.8.2/work/build/x86_64-pc-linux-gnu/libitm'
Makefile:17432: recipe for target 'all-target-libitm' failed
make[1]: *** [all-target-libitm] Error 2
make[1]: *** Waiting for unfinished jobs....
[...]
make[3]: Leaving directory '/var/tmp/portage/sys-devel/gcc-4.8.2/work/build/x86_64-pc-linux-gnu/libquadmath'
make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-4.8.2/work/build/x86_64-pc-linux-gnu/libquadmath'
make[1]: Leaving directory '/var/tmp/portage/sys-devel/gcc-4.8.2/work/build'
Makefile:18737: recipe for target 'bootstrap-lean' failed
make: *** [bootstrap-lean] Error 2
emake failed



dmesg is clean.

I tried to rebuild sys-devel/gcc-4.8.2 several times but the error will be the same. I also restarted the system without a change.


Reproducible: Always
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2014-03-30 00:01:59 UTC
# emerge --info
Portage 2.2.10 (default/linux/amd64/13.0, gcc-4.8.2, glibc-2.19, 3.10.34-gentoo x86_64)
=================================================================
System uname: Linux-3.10.34-gentoo-x86_64-Intel-R-_Core-TM-_i7-3770K_CPU_@_3.50GHz-with-gentoo-2.2
KiB Mem:     4050868 total,   1985960 free
KiB Swap:    1048572 total,   1048572 free
Timestamp of tree: Sat, 29 Mar 2014 19:45:01 +0000
ld GNU ld (GNU Binutils) 2.24
app-shells/bash:          4.2_p45-r1
dev-lang/python:          2.7.6, 3.3.5
dev-util/cmake:           2.8.12.2
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.14.1
sys-devel/binutils:       2.24-r2
sys-devel/gcc:            4.8.2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.11 (virtual/os-headers)
sys-libs/glibc:           2.19
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.de.gentoo.org/gentoo-portage/
    priority: -1000

ABI="amd64"
ABI_X86="64"
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
ACCEPT_PROPERTIES="*"
ACCEPT_RESTRICT="*"
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"
ARCH="amd64"
AUTOCLEAN="yes"
BOOTSTRAP_USE="cxx unicode python_targets_python3_3 python_targets_python2_7 multilib"
CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author"
CAMERAS="ptp2"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt -mno-rtm -mno-hle -mno-rdseed -mno-prfchw -mno-adx -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic"
CFLAGS_amd64="-m64"
CFLAGS_x32="-mx32"
CFLAGS_x86="-m32"
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x32="x86_64-pc-linux-gnux32"
CHOST_x86="i686-pc-linux-gnu"
CLEAN_DELAY="5"
COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog"
COLLISION_IGNORE="/lib/modules/* *.py[co] *$py.class */dropin.cache"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt -mno-rtm -mno-hle -mno-rdseed -mno-prfchw -mno-adx -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic"
DEFAULT_ABI="amd64"
DISTDIR="/usr/portage/distfiles"
EDITOR="/bin/nano"
ELIBC="glibc"
EMERGE_DEFAULT_OPTS="--quiet-build=n --verbose --buildpkg-exclude 'virtual/* net-firewall/xtables-addons'"
EMERGE_WARNING_DELAY="10"
EPREFIX=""
EROOT="/"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs cgroup config-protect-if-modified distlocks downgrade-backup 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"
GCC_SPECS=""
MAKEOPTS="--jobs 6"
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2014-03-30 00:02:24 UTC
Created attachment 373860 [details]
gcc-build-logs.tar.bz2
Comment 3 Ryan Hill (RETIRED) gentoo-dev 2014-03-30 09:47:53 UTC
Try again with sane CFLAGS (glibc and gcc).  libitm can get touchy when you override -m flags.
Comment 4 Thomas Deutschmann (RETIRED) gentoo-dev 2014-03-30 12:56:38 UTC
Hi,

well, 'sane CFlags'... since I started with Gentoo that's the way I set my CFlags:

1) I run

  # echo "" | gcc -march=native -v -E - 2>&1 | grep cc1

On my test system this will output

  /usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.2/cc1 -E -quiet -v - -march=core-avx-i -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mavx -mno-avx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=core-avx-i


2) I use the march value from the first output for the second command:

  # echo "int main() { return 0; }" | gcc -march=core-avx-i -v -Q -x c - 2>&1

On my system this will be the output:

[...]
options enabled:  -faggressive-loop-optimizations
 -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg -fcommon
 -fdelete-null-pointer-checks -fdwarf2-cfi-asm -fearly-inlining
 -feliminate-unused-debug-types -ffunction-cse -fgcse-lm -fgnu-runtime
 -fident -finline-atomics -fira-hoist-pressure -fira-share-save-slots
 -fira-share-spill-slots -fivopts -fkeep-static-consts -fleading-underscore
 -fmath-errno -fmerge-debug-strings -fmove-loop-invariants -fpeephole
 -fprefetch-loop-arrays -freg-struct-return -fsched-critical-path-heuristic
 -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock
 -fsched-last-insn-heuristic -fsched-rank-heuristic -fsched-spec
 -fsched-spec-insn-heuristic -fsched-stalled-insns-dep -fshow-column
 -fsigned-zeros -fsplit-ivs-in-unroller -fstrict-volatile-bitfields
 -fsync-libcalls -ftrapping-math -ftree-coalesce-vars -ftree-cselim
 -ftree-forwprop -ftree-loop-if-convert -ftree-loop-im -ftree-loop-ivcanon
 -ftree-loop-optimize -ftree-parallelize-loops= -ftree-phiprop -ftree-pta
 -ftree-reassoc -ftree-scev-cprop -ftree-slp-vectorize
 -ftree-vect-loop-version -funit-at-a-time -funwind-tables -fvar-tracking
 -fvar-tracking-assignments -fzero-initialized-in-bss -m128bit-long-double
 -m64 -m80387 -maccumulate-outgoing-args -maes -malign-stringops -mavx
 -mavx256-split-unaligned-load -mavx256-split-unaligned-store -mcx16 -mf16c
 -mfancy-math-387 -mfp-ret-in-387 -mfsgsbase -mfxsr -mglibc -mieee-fp
 -mlong-double-80 -mmmx -mpclmul -mpopcnt -mpush-args -mrdrnd -mred-zone
 -msahf -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2 -mssse3
 -mtls-direct-seg-refs -mxsave -mxsaveopt
[...]

From what I have learned, the second command shows the default options GCC will set based on the chosen march value.
Therefore I'll compare the options from the first output with the options from the second output and remove redundant options.

So for my system, I'll end with

  "-march=core-avx-i -mno-movbe -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx2 -mno-lzcnt -mno-rtm -mno-hle -mno-rdseed -mno-prfchw -mno-adx --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=generic"

Is my approach wrong?


However, for testing I set CFlags to

  "-march=core-avx-i -O2 -pipe"

like you asked me to do and gcc-4.8.2 now builds again.

I restored my previous CFlags and after multiple attempts to build gcc I found the CFlag which seems to cause my problems:

  "-mno-rtm"

When "-mno-rtm" is set, sys-devel/gcc-4.8.2 will fail with this error. Without this CFlag, everything works fine.

I am wondering because the first command indicates that GCC would set this CFlag...

Feel free to close this bug if you think that's not gcc/package bug. Thanks!


PS: The failing system is virtual machine (using VMware Workstation as host; the host CPU is mentioned in c1).
Comment 5 Thomas Deutschmann (RETIRED) gentoo-dev 2014-03-30 20:17:33 UTC
OK, this looks like a problem with the "-mno-rtm" CFlag:

I tried to compile sys-devel/gcc-4.8.2 on various physical systems, for example

- Intel(R) Xeon(R) CPU E5405  @ 2.00GHz
- Intel(R) Xeon(R) CPU E31270 @ 3.40GHz
- Intel(R) Core(TM) i7-2600 CPU
- Intel(R) Core(TM) i7-3770K CPU
- AMD Opteron(TM) Processor 6272
- AMD Opteron(tm) Processor 6164 HE

On each system,

  # echo "" | gcc -march=native -v -E - 2>&1 | grep cc1

reports that GCC would activate "-mno-rtm", that's why I set this flag (have I misunderstand the command?).

But with this flag set, sys-devel/gcc-4.8.2 won't build on these systems. It will fail with the quoted error.

When I don't set the "-mno-rtm" flag, everything works fine...
Comment 6 Ryan Hill (RETIRED) gentoo-dev 2014-03-31 03:41:31 UTC
libitm is a transactional memory library.  -mno-rtm disables transactional memory instructions.  So I can see how that would cause a build failure.

-mrtm is added when libitm is built but your -mno-rtm is overriding it.  We'll have to do something about that.
Comment 7 Ryan Hill (RETIRED) gentoo-dev 2014-05-20 10:41:35 UTC
Fixed.