Re: Bad option: -march=native on gcc 4.2.1?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Aug 21, 2007, at 10:19 PM, Ian Lance Taylor wrote:

Matt Fago <fago@xxxxxxxxxxxxx> writes:

I've built and installed gcc 4.2.1 on a MacBook Pro.

This works:
/usr/local/bin/gcc -O3 -mtune=native -c Weapon.c

This does not:
/usr/local/bin/gcc -march=native Weapon.c -c -O3
Weapon.c:1: error: bad value (native) for -march= switch
Weapon.c:1: error: bad value (native) for -mtune= switch


gcc -v yields:
Using built-in specs.
Target: i386-apple-darwin8.10.1
Configured with: ../gcc-4.2.1/configure --disable-checking --enable-
languages=c,c++,fortran --with-arch=nocona
Thread model: posix
gcc version 4.2.1

Have I misunderstood something here, or is this some wierd bug?

This is some weird bug.  It should work as you expect.  It does work
in my testing on GNU/Linux.

Try using the -v option when you compile.  It should show how
-march=native is transformed when the gcc driver invokes the compiler
proper.

Ian


I'm not sure this gets anything useful? I usually build gcc on Linux as well, so ...


/usr/local/bin/gcc -v -c -O3 -march=native Weapon.c

Using built-in specs.
Target: i386-apple-darwin8.10.1
Configured with: ../gcc-4.2.1/configure --disable-checking --enable- languages=c,c++,fortran --with-arch=nocona
Thread model: posix
gcc version 4.2.1
/usr/local/libexec/gcc/i386-apple-darwin8.10.1/4.2.1/cc1 -quiet -v - D__DYNAMIC__ Weapon.c -fPIC -quiet -dumpbase Weapon.c -march=native - auxbase Weapon -O3 -version -o /var/tmp//ccSVG0aD.s
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/lib/gcc/i386-apple- darwin8.10.1/4.2.1/../../../../i386-apple-darwin8.10.1/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/lib/gcc/i386-apple-darwin8.10.1/4.2.1/include
 /usr/include
 /System/Library/Frameworks
 /Library/Frameworks
End of search list.
Weapon.c:1: error: bad value (native) for -march= switch
Weapon.c:1: error: bad value (native) for -mtune= switch
GNU C version 4.2.1 (i386-apple-darwin8.10.1)
        compiled by GNU C version 4.2.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min- heapsize=131072


 - Matt



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux