gcc, as, AVX, binutils and MacOS X 10.7
vince at macports.org
Mon Oct 3 12:50:05 PDT 2011
Ok, finally I figured out a way to compile AVX instructions. But it is somewhat crooked. The old ‘as’ assembler in /usr/bin/as must be discarded and replaced by this script, that uses the clang assembler:
while [ $# -ne 0 ]; do
# Skip options
if [ $ARG == "-arch" ] || [ $ARG == "-o" ]; then
# Skip next token
if [ `echo $ARG | head -c1` == "-" ]; then
if [ $HAS_INPUT_FILE -eq 1 ]; then
clang -c -x assembler $ARGS
clang -c -x assembler $ARGS -
Obviously, since this is a shell script, the assembly phase is slowed down. But it seems to work, at least it compiles AVX assembly properly (gcc-mp-4.5 avx.s works, and I have even recompiled gcc45 with the script as assembler).
Well, I have filed a RADAR asking Apple to give us an assembler that supports AVX. We’ll see.
More information about the macports-dev