Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does -march=native boil down to? [duplicate]

Currently we compile and run code on same hardware, so -march=native flag is used.

We are going to keep running on this hardware but compile on different architecture. So I need to replace native with whatever it is equivalent to on current hardware.

Is there a way to get gcc to report what native is equivalent to on particular hardware?

like image 577
user2052436 Avatar asked Dec 31 '22 22:12

user2052436


1 Answers

Yes, you can run the command

gcc -march=native -Q --help=target

to see the flags applied, including the resolved -march flag.

like image 180
nos Avatar answered Jan 08 '23 10:01

nos