-Wl,`编译器标志的前缀 [英] `-Wl,` prefix to compiler flag
问题描述
我是代码库的新手,正在浏览Makefile.我看到几个用-Wl,
前缀指定的编译器标志(即指定了-Wl,--no-undefined
).我之前从未遇到过这种语法,因此很难通过Google搜索.
I'm new to a codebase and I'm looking through a Makefile. I see several compiler flags specified with a -Wl,
prefix (i.e. -Wl,--no-undefined
specified). I have not encountered this syntax before and it is difficult to Google search.
前缀在做什么?看起来它与警告有关,但是我不知道,并且我很犹豫是否将其弄乱.
What is the prefix doing? It looks like it has to do with warnings, but I don't know and I'm hesitant to mess with it.
推荐答案
它与警告无关.
来自GCC手册:
-Wl,option
通过选项作为链接器的选项.如果选项包含逗号,则将其拆分为
逗号处有多个选项.您可以使用此语法传递参数
的选项.例如,"-Wl,-Map,output.map
"通过"-Map output.map
"
链接器.使用GNU链接器时,您也可以获得相同的效果
和"-Wl,-Map=output.map
".
Pass option as an option to the linker. If option contains commas, it is split into
multiple options at the commas. You can use this syntax to pass an argument
to the option. For example, ‘-Wl,-Map,output.map
’ passes ‘-Map output.map
’
to the linker. When using the GNU linker, you can also get the same effect
with ‘-Wl,-Map=output.map
’.
这篇关于-Wl,`编译器标志的前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!