Created attachment 312809 [details] emerge --info Can't get it to build on a bdver1 amd64 system. Fails in libitm. Tried using gcc 4.5.3 and 4.6.3 to compile. Found upstream bug report: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53113
Created attachment 312819 [details] gcc-build-logs
Created attachment 312821 [details] Full build.log
libtool: compile: /var/tmp/portage/sys-devel/gcc-4.7.0/work/build/./gcc/g++ -B/var/tmp/portage/sys-devel/gcc-4.7.0/work/build/./gcc/ -nostdinc++ -nostdinc++ -I/var/tmp/portage/sys-devel/gcc-4.7.0/work/build/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -I/var/tmp/portage/sys-devel/gcc-4.7.0/work/build/x86_64-pc-linux-gnu/libstdc++-v3/include -I/var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libstdc++-v3/libsupc++ -I/var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libstdc++-v3/include/backward -I/var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libstdc++-v3/testsuite/util -L/var/tmp/portage/sys-devel/gcc-4.7.0/work/build/x86_64-pc-linux-gnu/libstdc++-v3/src -L/var/tmp/portage/sys-devel/gcc-4.7.0/work/build/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -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.7.0/work/gcc-4.7.0/libitm -I/var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/linux/x86 -I/var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/linux -I/var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86 -I/var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/posix -I/var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/generic -I/var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm -Wall -pthread -Werror -mavx -std=gnu++0x -funwind-tables -fno-exceptions -fno-rtti -fabi-version=4 -march=native -pipe -mno-sse4.1 -O2 -D_GNU_SOURCE -MT x86_avx.lo -MD -MP -MF .deps/x86_avx.Tpo -c /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc -fPIC -DPIC -o .libs/x86_avx.o /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:83:1: error: ‘_ITM_TYPE_M256’ does not name a type /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:83:1: error: ‘_ITM_TYPE_M256’ does not name a type /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:83:1: error: ‘_ITM_TYPE_M256’ does not name a type /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:83:1: error: ‘_ITM_TYPE_M256’ does not name a type /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:83:1: error: variable or field ‘_ITM_WM256’ declared void /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:83:1: error: ‘_ITM_TYPE_M256’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:83:1: error: ‘ptr’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:83:1: error: ‘_ITM_TYPE_M256’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:83:1: error: variable or field ‘_ITM_WaRM256’ declared void /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:83:1: error: ‘_ITM_TYPE_M256’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:83:1: error: ‘ptr’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:83:1: error: ‘_ITM_TYPE_M256’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:83:1: error: variable or field ‘_ITM_WaWM256’ declared void /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:83:1: error: ‘_ITM_TYPE_M256’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:83:1: error: ‘ptr’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:83:1: error: ‘_ITM_TYPE_M256’ was not declared in this scope /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:86:19: error: ‘_ITM_TYPE_M256’ does not name a type /var/tmp/portage/sys-devel/gcc-4.7.0/work/gcc-4.7.0/libitm/config/x86/x86_avx.cc:86:35: error: ISO C++ forbids declaration of ‘ptr’ with no type [-fpermissive] make[4]: *** [x86_avx.lo] Error 1 make[4]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.7.0/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.0/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.0/work/build/x86_64-pc-linux-gnu/libitm' make[1]: *** [all-target-libitm] Error 2 make[1]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.7.0/work/build' make: *** [bootstrap-lean] Error 2 emake failed * ERROR: sys-devel/gcc-4.7.0 failed (compile phase): * emake failed with bootstrap-lean * * Call stack: * ebuild.sh, line 85: Called src_compile * environment, line 3930: Called toolchain_src_compile * environment, line 4580: Called gcc_do_make * environment, line 2285: Called die * The specific snippet of code: * emake LDFLAGS="${LDFLAGS}" STAGE1_CFLAGS="${STAGE1_CFLAGS}" LIBPATH="${LIBPATH}" BOOT_CFLAGS="${BOOT_CFLAGS}" ${GCC_MAKE_TARGET} || die "emake failed with ${GCC_MAKE_TARGET}"; *
# emerge -pqv '=sys-devel/gcc-4.7.0' [ebuild NS ] sys-devel/gcc-4.7.0 [3.4.6-r2, 4.4.6-r1, 4.5.3-r2, 4.6.3] USE="cxx fortran gcj gtk mudflap (multilib) nls nptl objc objc++ openmp (-altivec) -bootstrap -build -doc (-fixed-point) -go -graphite (-hardened) (-libssp) -multislot -nocxx -nopie -nossp -objc-gc -test -vanilla"
Comment on attachment 312819 [details] gcc-build-logs Please attach separate files next time.
Comment on attachment 312821 [details] Full build.log And when you do attach compressed files, set the MIME type correctly too, please.
(In reply to comment #5) > Comment on attachment 312819 [details] > gcc-build-logs > > Please attach separate files next time. portage packed it and told me to post it. I was doing as told.
(In reply to comment #5) > Comment on attachment 312819 [details] > gcc-build-logs > > Please attach separate files next time. toolchain.eclass tells you otherwise since 2011/12/13. For reference: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/toolchain.eclass?r1=1.510&r2=1.511
This is still an issue with gcc-4.7.1. See upstream bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53113
hmm, i don't see those errors over here, and i'm pretty sure i have the same configure settings coming down in the libitm dir: checking whether __AVX__ is declared... no checking if the assembler supports AVX... yes
(In reply to comment #10) > hmm, i don't see those errors over here, and i'm pretty sure i have the same > configure settings coming down > > in the libitm dir: > checking whether __AVX__ is declared... no > checking if the assembler supports AVX... yes I don't know what cheanged in portage/ the ebuild. I just tried 4.7.1 a 2 or 3 days ago and it failed for the same reason. However tonight it installed just fine.
i merged a avx/libitm fix for bug 421305 ... maybe that implicitly fixed this
*** Bug 434864 has been marked as a duplicate of this bug. ***
*** Bug 436676 has been marked as a duplicate of this bug. ***
the build output shows that your assembler supports avx: checking if the assembler supports AVX... yes that means HAVE_AS_AVX should be defined then the code is compiled with -mavx: /var/tmp/portage/sys-devel/gcc-4.7.0/work/build/./gcc/g++ ... -mavx ... \ -c ${S}/libitm/config/x86/x86_avx.cc ... which means __AVX__ should be defined can you go into the libitm build dir and check the config.h to see if HAVE_AS_AVX is defined. if it is, run the compile command again but change the -c to -E -dD and attach the output.
Same here. Emerging gcc 4.7.2 on a clarkdale i3 380m which doesn't support avx leads to the same error message and I have set -mno-avx in my make.conf. I'm trying to build gcc-4.7.2 by gcc-4.6.3. CFLAGS="-O2 -pipe -march=corei7 -mcx16 -msahf -mno-movbe -mno-aes -mno-pclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx -msse4.2 -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072 -mtune=corei7 -I/usr/include/opencore-amrnb" # These settings were set by the catalyst build script that automatically built this stage # Please consult /etc/make.conf.example for a more detailed example #CFLAGS="-O2 -march=corei7 -pipe" CHOST="x86_64-pc-linux-gnu" CXXFLAGS="${CFLAGS}" LDFLAGS="-Wl,-z,now,--as-needed,-O1,--hash-style=gnu,--sort-common" #LDFLAGS="-Wl,-O1 -Wl,--as-needed" DISTDIR=/usr/portage/distfiles/ #DISTDIR=/media/MY\ PASSPORT/distfiles/ PORTAGE_TMPDIR=/usr/portage/prtgtmp PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes" PORTDIR_OVERLAY="/usr/portage/lymnprtg/" #GENTOO_MIRRORS="http://192.168.0.150" #MAKEOPTS="-j5" MAKEOPTS="-j5 -l8" EMERGE_DEFAULT_OPTS="--keep-going --jobs=5 --load-average=10.0 --with-bdeps y" CCACHE_SIZE="2G" FEATURES="ccache -strict sandbox buildpkg -distcc -unmerge-orphans -parallel-fetch" USE="3dnow 3dnowext 3gp X a52 aac aalib acpi alsa amr archive asf automount \ avahi bittorrent bmp bzip2 cdda cddb cdio cdparanoia cdr crypt dbus \ directfb djvu double-precision dts dv dvb dvd dvdnav dvdr encode faac \ faad fbcon fbcondecor fbsplash ffmpeg firefox flac flash fortran95 fuse \ gif gmp gpg gstreamer gzip h323 html id3tag inotify jingle jpeg jpeg2k \ kde lame libnotify live lm_sensors lzma mad matroska mjpeg mms mmxext \ mozilla mp3 mp4 mpeg network nfs nls nptl nptlonly nsplugin ogg ogm \ openal opengl oss pdf png pnm policykit postscript python3 qt3support \ qt4 quicktime rar real samba scanner sdl search sftp sip slp smp socks \ socks5 spell sse sse3 sse4 sse4_1 sse4a ssh ssl ssse3 stream svg \ symlink taglib theora tiff tk truetype type3 udev unicode usb v4l vaapi \ vcd vcdx vlm vorbis vpx wav wavpack webgl wifi wma wmf x264 xattr xcb \ xml xpm xv xvid yahoo youtube zeroconf -apm -ati -debug -gnome -gphoto2 \ -gtk3 -lirc -nvidia -portaudio -pulseaudio -static -static-libs" #CAMERAS=stv0680 PKGDIR="/usr/portage/GentooPackages/" SANE_BACKENDS="gt68xx" VIDEO_CARDS="intel" INPUT_DEVICES="evdev synaptics" #LIRC_DEVICES="pctv" LINGUAS="en ar fa" ACCEPT_LICENSE = "PUEL sun-bcla-java-vm skype-eula dlj-1.1 RTCW-ETEULA AdobeFlash-10.3 AdobeFlash-10 Nero-EULA-US skype-4.0.0.7-copyright" #FETCHCOMMAND="/usr/bin/axel -n4 -a -o \${DISTDIR}/\${FILE} \${URI}" #RESUMECOMMAND="${FETCHCOMMAND}" source /usr/portage/lymnprtg/make.conf PORTDIR_OVERLAY="${PORTDIR_OVERLAY} /usr/portage/lymnprtg/localoverlays/" GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://trumpetti.atm.tut.fi/gentoo/ http://portage.org.ua/" SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
Please use -march=native instead of that mess.
As mentioned on the upstream bug the issue is caused by -mno flags overriding the earlier -mavx on the command line. Even something like -mno-sse3 will cause __AVX__ to be undeclared. caribou ~ $ gcc -march=corei7-avx -E -dM -x c /dev/null | grep AVX #define __AVX__ 1 caribou ~ $ gcc -march=corei7-avx -mno-sse3 -E -dM -x c /dev/null | grep AVX
comment from gcc bugzilla: >> That is a user error, just don't do that. As the user provided CFLAGS/CXXFLAGS override the default flags, you really shouldn't be using -mno-this and -mno-that when building gcc, because that will disable what is required to compile gcc successfully. If you want to build gcc to support some CPU that doesn't have AVX etc., just configure it for such a CPU. cd /var/tmp/portage/sys-devel/gcc-4.7.2/work/gcc-4.7.2/libitm grep -Rin "avx" config.h.in 9:/* Define to 1 if the assembler supports AVX. */ 10:#undef HAVE_AS_AVX So, can you guys add "avx" use flag to gcc ebuild? It will resolve the issue
... how?
http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/gcc/4.7.2/gentoo/48_all_x86_pr53113_libitm-avx.patch?rev=1.1&view=markup
Created attachment 339868 [details] gcc_enable_avx.patch Maybe we can do something like this, and then configure libitm with "--enable-avx"
Fixed in 4.7.2 p1.4.