Obtaining current GCC architecture

前端 未结 5 1989
长情又很酷
长情又很酷 2020-12-14 05:57

How can I find out what the -march default argument is for the current architecture if I don\'t supply any?

5条回答
  •  有刺的猬
    2020-12-14 06:50

    I found this gem on the GCC mailing list that prints the default -march and mtune parameters:

    $ echo | gcc -v -E - 2>&1 | grep cc1
     /usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/cc1 -E -quiet -v - -mtune=generic -march=x86-64
    

    Basically, you are compiling an empty file from stdin and while doing so, you print the commands.

提交回复
热议问题