On Thu, 2021-09-16 at 22:46 -0400, NightStrike via Gcc-help wrote: > On Tue, Sep 7, 2021 at 3:57 AM Jonathan Wakely via Gcc-help > <gcc-help@xxxxxxxxxxx> wrote: > > > > On Tue, 7 Sep 2021, 08:03 unlvsur unlvsur via Gcc-help, < > > gcc-help@xxxxxxxxxxx> wrote: > > > > > I try to cross compile to another slower machine. -march=native > > > works on > > > that architectures, but I would like to know what is the value of > > > -march=??? For -march=native. Is there a way to print march value > > > out?? > > > > > > > It doesn't choose a single value. It enables all the individual > > options > > like -msse and that combination of options might not correspond to any > > particular -march value. > > Is that true? I mean, in principle, I know I've reported a bug where > -march=native scanned /proc/cpuinfo (or however it got the info) and > came up with a different result than -march=k8 (or whatever I was > reporting at the time), but that was a bug that some helpful people > fixed. If gcc doesn't have an -march for a particular esoteric arch, > then fine, but if it does, I'd think that this would be a bug similar > to what I experienced previously. It's documented clearly: native This selects the CPU to generate code for at compilation time by determining the processor type of the compiling machine. Using -march=native enables all instruction subsets supported by the local machine (hence the result might not run on different machines). Using -mtune=native produces code optimized for the local machine under the constraints of the selected instruction set. However if it produce something can't run on your machine, this is a bug. -- Xi Ruoyao <xry111@xxxxxxxxxxxxxxxx> School of Aerospace Science and Technology, Xidian University