有没有办法找出特定二进制文件编译时使用的 gcc 标志?
最佳答案
快速查看 GCC 文档并没有发现任何问题。
Boost 人员是一些最聪明的 C++ 开发人员,他们 resort到命名conventions因为这通常是不可能的任何其他方式(可执行文件可以用任何数量的语言,由任何数量的编译器版本创建,毕竟)。
(稍后添加):Turns out GCC has this feature in 4.3 if asked for when you compile the code :
A new command-line switch -frecord-gcc-switches ... causes the command line that was used to invoke the compiler to be recorded into the object file that is being created. The exact format of this recording is target and binary file format dependent, but it usually takes the form of a note section containing ASCII text.
关于c++ - 检测二进制文件的 GCC 编译时标志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9989662/