Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 417271 (PR53113) - [4.7] - libitm/config/x86/x86_avx.cc:83:1: error: ‘_ITM_TYPE_M256’ does not name a type
Summary: [4.7] - libitm/config/x86/x86_avx.cc:83:1: error: ‘_ITM_TYPE_M256’ does not n...
Status: RESOLVED FIXED
Alias: PR53113
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL: http://gcc.gnu.org/PR53113
Whiteboard:
Keywords: InVCS
: 434864 436676 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-23 14:34 UTC by Jonathan Isom
Modified: 2013-02-25 04:43 UTC (History)
4 users (show)

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


Attachments
emerge --info (emerge-info.txt.bz2,6.94 KB, application/x-bzip)
2012-05-23 14:34 UTC, Jonathan Isom
Details
gcc-build-logs (gcc-build-logs.tar.bz2,216.59 KB, application/x-bzip)
2012-05-23 16:06 UTC, Jonathan Isom
Details
Full build.log (build.log.bz2,317.80 KB, application/x-bzip)
2012-05-23 16:06 UTC, Jonathan Isom
Details
gcc_enable_avx.patch (gcc_enable_avx.patch,589 bytes, text/plain)
2013-02-23 22:35 UTC, Andrew Aladjev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Isom 2012-05-23 14:34:10 UTC
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
Comment 1 Jonathan Isom 2012-05-23 16:06:20 UTC
Created attachment 312819 [details]
gcc-build-logs
Comment 2 Jonathan Isom 2012-05-23 16:06:58 UTC
Created attachment 312821 [details]
Full build.log
Comment 3 Jonathan Isom 2012-05-23 16:12:34 UTC
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}";
 *
Comment 4 Jonathan Isom 2012-05-23 16:15:22 UTC
 # 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 5 Jeroen Roovers (RETIRED) gentoo-dev 2012-05-24 01:23:27 UTC
Comment on attachment 312819 [details]
gcc-build-logs

Please attach separate files next time.
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2012-05-24 01:24:01 UTC
Comment on attachment 312821 [details]
Full build.log

And when you do attach compressed files, set the MIME type correctly too, please.
Comment 7 Jonathan Isom 2012-05-24 14:10:53 UTC
(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.
Comment 8 Xake 2012-05-24 14:22:16 UTC
(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
Comment 9 Magnus Kessler 2012-06-15 14:52:47 UTC
This is still an issue with gcc-4.7.1. See upstream bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53113
Comment 10 SpanKY gentoo-dev 2012-07-25 20:48:23 UTC
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
Comment 11 Jonathan Isom 2012-07-26 00:32:29 UTC
(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.
Comment 12 SpanKY gentoo-dev 2012-07-26 16:40:39 UTC
i merged a avx/libitm fix for bug 421305 ... maybe that implicitly fixed this
Comment 13 SpanKY gentoo-dev 2012-09-13 21:48:13 UTC
*** Bug 434864 has been marked as a duplicate of this bug. ***
Comment 14 Ryan Hill (RETIRED) gentoo-dev 2012-09-30 19:31:35 UTC
*** Bug 436676 has been marked as a duplicate of this bug. ***
Comment 15 SpanKY gentoo-dev 2012-10-04 18:57:14 UTC
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.
Comment 16 Kete Tefid 2012-12-12 19:34:21 UTC
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"
Comment 17 Ryan Hill (RETIRED) gentoo-dev 2013-02-22 01:23:40 UTC
Please use -march=native instead of that mess.
Comment 18 Ryan Hill (RETIRED) gentoo-dev 2013-02-22 01:38:00 UTC
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 19 Andrew Aladjev 2013-02-22 08:12:07 UTC
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
Comment 20 Ryan Hill (RETIRED) gentoo-dev 2013-02-23 00:47:44 UTC
...

how?
Comment 22 Andrew Aladjev 2013-02-23 22:35:13 UTC
Created attachment 339868 [details]
gcc_enable_avx.patch

Maybe we can do something like this, and then configure libitm with "--enable-avx"
Comment 23 Ryan Hill (RETIRED) gentoo-dev 2013-02-25 04:43:09 UTC
Fixed in 4.7.2 p1.4.