-march=x86-64 (was: illegal instruction (CPU mismatch))

Jeffrey Walton noloader@gmail.com
Sun Sep 18 00:45:00 GMT 2016


>> Actually, I tried with march and got the same, dropping march (the default is native) also results the same. I will try with mtune.
>
> The default should not be native, that compiles code that can only run
> on a particular machine (or identical ones). That's a very bad
> default.
>
> Using a more generic instruction set would produce binaries that run
> on all hardware, e.g. -march=x86-64

Forgive my ignorance....

That switch caught my eye because its the opposite of -mach=native,
and I thought I would add a compile test using it. The problem is, I
can't find its documentation. Confer,
https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html. I also tried the
usual variants like x86_64-Options.html and x86-64-Options.html.

Do you know if the option is documented, and what versions of GCC support it?

Jeff



More information about the Gcc-help mailing list