Anything and everything.
While messing about attempting to build a plethora of software with MinGW, I came across an oddity with Yasm. When building software for personal use, I generally pass gcc the “-march=native” option, which instructs gcc to figure out which features are available on the host system, and to tweak instruction scheduling to match it.
When building Yasm (an assembler) with this option, the resultant binary would immediately crash.
Compiling with -march set to “corei7” produced a program that ran just fine, but using “corei7-avx” again resulted in a crash.
$ gdb yasm.exe GNU gdb (GDB) 7.4 Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-mingw32". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from <...>\yasm-1.2.0\build.corei7-avx\yasm.exe...done. (gdb) run Starting program: <...>\yasm-1.2.0\build.corei7-avx\yasm.exe [New Thread 2292.0x7b8] Program received signal SIGILL, Illegal instruction. 0x00409fe2 in BitVector_Boot () (gdb)
Since I have no idea what BitVector_Boot is or does, and I really doubt that an assembler will have much of a noticeable improvement with AVX, the simplest solution is to just use “-march=corei7”.
I really don’t know why it wouldn’t work anyway. I have a Corei5-2500K processor, which supports AVX. I found but a single reference to someone else encountering this, so it doesn’t appear to be a common problem.