Issue
Summary: What do the -f
and -m
in gcc
and clang
compiler options stand for?
Details:
When using clang
I've noticed that many compiler options start with -f
and others start with -m
. I assume that there is some historical reason for this and I was curious so I looked at the gcc
help and saw the following:
Options starting with -g, -f, -m, -O, -W, or --param are automatically passed on to the various sub-processes invoked by gcc. In order to pass other options on to these processes the -W options must be used.
If I had to guess I think that -f
might stand for frontend and -m
for machine. But I'd be interested to hear a more comprehensive answer, possibly including the other sub-processes that gcc invokes.
Solution
I don't have specific sources that state what 'f' and 'm' mean, but we can infer based on usage patterns found in documentation.
'f' stands for 'flag'.
Flags are on if specified via '-fFLAG
' and off via '-fno-FLAG
'
ex:
-fpic # flag to set position independent code
-fno-builtin # don't recognize build in functions ...
The technical definition is that 'f' defines "Control the interface conventions used in code generation".
Src: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html (e.g -fpci, when this flag is set)
'm' stands for mode. One general characteristic is that it sometimes has parameters. e.g
-mabi=name #abi mode = name
-mcpu=cpu
Src: https://gcc.gnu.org/onlinedocs/gccint/Standard-Names.html (e.g ... when this mode...)
Answered By - Leo Ufimtsev Answer Checked By - Candace Johnson (WPSolving Volunteer)