总结 : -f
做什么和 -m
在 gcc
和 clang
编译器选项代表什么?
详情 :
使用 clang
时我注意到许多编译器选项以 -f
开头和其他以 -m
开头.我认为这有一些历史原因,我很好奇,所以我查看了 gcc
帮助并看到以下内容:
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.
如果我不得不猜测,我认为
-f
可能代表前端和 -m
为机器。但我很想听听更全面的答案,可能包括 gcc 调用的其他子流程。
最佳答案
我没有具体的资料来说明“f”和“m”的含义,但我们可以根据文档中的使用模式进行推断。
“f”代表“标志”。
如果通过 ' -fFLAG
指定,标志将打开' 并通过 ' -fno-FLAG
关闭'
前任:
-fpic # flag to set position independent code
-fno-builtin # don't recognize build in functions ...
技术定义是“f”定义“控制代码生成中使用的接口(interface)约定”。源:
https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html
(例如 -fpci,设置此标志时)
'm' 代表模式。一个普遍的特征是它有时具有参数。例如
-mabi=name #abi mode = name
-mcpu=cpu
源:https://gcc.gnu.org/onlinedocs/gccint/Standard-Names.html (例如......当这种模式......)
关于gcc - gcc/clang 编译器选项中的 -f 和 -m 代表什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16227501/