The gcc info file says in the section on x86-64 specific flags, among other things:
There is no `-march=generic' option because `-march'
indicates the instruction set the compiler can use, and there
is no generic instruction set applicable to all processors.
In contrast, `-mtune' indicates the processor (or, in this
case, collection of processors) for which the code is
optimized.
My question then is, what instruction (sub-)set does gcc compile for when no -march option is given? There is a lot of related information about -march and -mtune in the webosphere, but none that I could find which answers this simple question. It can't be march=native, or else it would be impossible to compile generic distribution kernels and binary packages.
By default, gcc does not conform to any of the ANSI/ISO C standards. The current default is equivalent to -std=gnu90 , which is the 1989/1990 standard with GNU-specific extensions. (Some diagnostics required by the language standard are not issued.)
When you invoke GCC, it normally does preprocessing, compilation, assembly and linking. The "overall options" allow you to stop this process at an intermediate stage. For example, the -c option says not to run the linker.
The default executable output of gcc is "a.out", which can be run by typing ./a.out. It is also possible to specify a name for the executable file at the command line by using the syntax -o outputfile , as shown in the following example: gcc filename -o outputfile. Again, you can run your program with "./outputfile".
The default flags for gcc can be set when gcc itself is compiled. Run:
gcc -Q --help=target
to see what the default is on your machine. Likely it'll just be x86-64 even though the man page doesn't document that as a value for -march-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With