https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66594
--- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> --- Some notes: The following archs seem to implement a "host_detect_local_cpu" C++ callback, implementing the spec-language function "local_cpu_detect": grep -nH -e host_detect_local_cpu */*/*.h config/aarch64/aarch64.h:944:extern const char *host_detect_local_cpu (int argc, const char **argv); config/aarch64/aarch64.h:946: { "local_cpu_detect", host_detect_local_cpu }, \ config/alpha/linux.h:95:extern const char *host_detect_local_cpu (int argc, const char **argv); config/alpha/linux.h:97: { "local_cpu_detect", host_detect_local_cpu }, config/arm/arm.h:2246:extern const char *host_detect_local_cpu (int argc, const char **argv); config/arm/arm.h:2248: { "local_cpu_detect", host_detect_local_cpu }, \ config/i386/i386.h:604:extern const char *host_detect_local_cpu (int argc, const char **argv); config/i386/i386.h:606: { "local_cpu_detect", host_detect_local_cpu }, config/mips/gnu-user.h:111:extern const char *host_detect_local_cpu (int argc, const char **argv); config/mips/gnu-user.h:113: { "local_cpu_detect", host_detect_local_cpu }, config/rs6000/rs6000.h:204:extern const char *host_detect_local_cpu (int argc, const char **argv); config/rs6000/rs6000.h:206: { "local_cpu_detect", host_detect_local_cpu }, config/s390/s390.h:129:extern const char *s390_host_detect_local_cpu (int argc, const char **argv); config/s390/s390.h:131: { "local_cpu_detect", s390_host_detect_local_cpu }, config/sparc/linux64.h:133:extern const char *host_detect_local_cpu (int argc, const char **argv); config/sparc/linux64.h:135: { "local_cpu_detect", host_detect_local_cpu }, config/sparc/linux.h:44:extern const char *host_detect_local_cpu (int argc, const char **argv); config/sparc/linux.h:46: { "local_cpu_detect", host_detect_local_cpu }, config/sparc/sol2.h:203:extern const char *host_detect_local_cpu (int argc, const char **argv); config/sparc/sol2.h:205: { "local_cpu_detect", host_detect_local_cpu }, aarch64.h has: # define MCPU_MTUNE_NATIVE_SPECS \ " %{march=native:%<march=native %:local_cpu_detect(arch)}" \ " %{mcpu=native:%<mcpu=native %:local_cpu_detect(cpu)}" \ " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}" alpha/linux.h has: # define MCPU_MTUNE_NATIVE_SPECS \ " %{mcpu=native:%<mcpu=native %:local_cpu_detect(cpu)}" \ " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}" arm.h has: # define MCPU_MTUNE_NATIVE_SPECS \ " %{march=native:%<march=native %:local_cpu_detect(arch)}" \ " %{mcpu=native:%<mcpu=native %:local_cpu_detect(cpu)}" \ " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}" i386.h has: #ifndef HAVE_LOCAL_CPU_DETECT #define CC1_CPU_SPEC CC1_CPU_SPEC_1 #else #define CC1_CPU_SPEC CC1_CPU_SPEC_1 \ "%{march=native:%>march=native %:local_cpu_detect(arch) \ %{!mtune=*:%>mtune=native %:local_cpu_detect(tune)}} \ %{mtune=native:%>mtune=native %:local_cpu_detect(tune)}" #endif #endif mips/gnu-user.h has: # define MARCH_MTUNE_NATIVE_SPECS \ " %{march=native:%<march=native %:local_cpu_detect(arch)}" \ " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}" #define HAVE_LOCAL_CPU_DETECT #define ASM_CPU_NATIVE_SPEC "%:local_cpu_detect(asm)" #else #define ASM_CPU_NATIVE_SPEC "%(asm_default)" #endif rs6000.h has: #ifndef CC1_CPU_SPEC #ifdef HAVE_LOCAL_CPU_DETECT #define CC1_CPU_SPEC \ "%{mcpu=native:%<mcpu=native %:local_cpu_detect(cpu)} \ %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}" #else #define CC1_CPU_SPEC "" #endif #endif s390.h has: # define MARCH_MTUNE_NATIVE_SPECS \ " %{march=native:%<march=native %:local_cpu_detect(arch)}" \ " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}" sparc/linux64.h, sparc/linux.h and sparc/sol2.h have: # define MCPU_MTUNE_NATIVE_SPECS \ " %{mcpu=native:%<mcpu=native %:local_cpu_detect(cpu)}" \ " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}"