c - 使用 gcc -Q -v "options enabled"和 "options passed"有什么区别

标签 c linux gcc compiler-options

我正在寻找编译期间使用的默认编译器标志。因此我使用了命令 gcc -Q -v <example.c> 感兴趣的输出如下所示:

GNU C (Ubuntu 4.8.4-2ubuntu1~14.04.3) version 4.8.4 (x86_64-linux-gnu) compiled by GNU C version 4.8.4, GMP version 5.1.3, MPFR version 3.1.2-p3, MPC version 1.0.1

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072

options passed: -v -imultiarch x86_64-linux-gnu example.c -mtune=generic -march=x86-64 -fstack-protector -Wformat -Wformat-security

options enabled: -faggressive-loop-optimizations -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg -fcommon -fdelete-null-pointer-checks -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types -ffunction-cse -fgcse-lm -fgnu-runtime -fgnu-unique -fident -finline-atomics -fira-hoist-pressure -fira-share-save-slots -fira-share-spill-slots -fivopts -fkeep-static-consts -fleading-underscore -fmath-errno -fmerge-debug-strings -fmove-loop-invariants -fpeephole -fprefetch-loop-arrays -freg-struct-return -fsched-critical-path-heuristic -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock -fsched-last-insn-heuristic -fsched-rank-heuristic -fsched-spec -fsched-spec-insn-heuristic -fsched-stalled-insns-dep -fshow-column -fsigned-zeros -fsplit-ivs-in-unroller -fstack-protector -fstrict-volatile-bitfields -fsync-libcalls -ftrapping-math -ftree-coalesce-vars -ftree-cselim -ftree-forwprop -ftree-loop-if-convert -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize -ftree-parallelize-loops= -ftree-phiprop -ftree-pta -ftree-reassoc -ftree-scev-cprop -ftree-slp-vectorize -ftree-vect-loop-version -funit-at-a-time -funwind-tables -fvar-tracking -fvar-tracking-assignments -fzero-initialized-in-bss -m128bit-long-double -m64 -m80387 -maccumulate-outgoing-args -malign-stringops -mfancy-math-387 -mfp-ret-in-387 -mfxsr -mglibc -mieee-fp -mlong-double-80 -mmmx -mno-sse4 -mpush-args -mred-zone -msse -msse2 -mtls-direct-seg-refs

我现在想知道:已启用选项已通过选项有什么区别?

最佳答案

传递的选项是添加到命令行的选项,通过配置添加,如-march=x86-64 -fstack-protector,或通过命令调用添加,如-v。这意味着这些选项默认情况下不启用,必须由 gcc 命令指定。

Options enabled 是已启用的选项,并且始终用于在特定系统上使用特定的 gcc 进行编译,直到 option passed 你没有禁用其中的一些。

例如在清晰的环境中调用 gcc example.c 会给你 example.c 作为唯一传递的选项,但所有启用的选项仍然相同。

关于c - 使用 gcc -Q -v "options enabled"和 "options passed"有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38244309/

相关文章:

Linux - 如何修复可执行镜像中的共享库链接?

c++ - CUDA 7.0 提示不支持 gcc 4.9

c - Powerpc arch 上的 gcc 内联汇编程序隐式函数声明

c++ - gcc/c++ v2.96 上不存在 wstring

c - 为什么这不会产生错误?

c - 为什么我的代码没有给出正确的输出?

.net - P/Invoke 和非托管 DLL 状态

c - ptrace 在 Linux 中如何工作?

c - 在没有 main() 的情况下执行共享库

c - 如何使用递归技术检查值X是否是列表L的成员