“启用选项”与“启用选项”之间有什么区别?和“通过的选项” usind gcc -Q -v [英] What is the difference between "options enabled" and "options passed" usind gcc -Q -v

查看:289
本文介绍了“启用选项”与“启用选项”之间有什么区别?和“通过的选项” usind gcc -Q -v的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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


GNU C(Ubuntu 4.8.4-2ubuntu1〜14.04.3)版本4.8.4(x86_64-linux-gnu)
由GNU C版本4.8.4编译,GMP版本5.1.3,MPFR版本3.1.2-p3,MPC版本1.0.1

GGC启发式:--param ggc-min-expand = 100 - param
ggc-min-heapsize = 131072

传递的选项:-v -imultiarch x86_64-linux-gnu example.c
-mtune = generic -march = x86-64 -fstack-protector -Wformat -Wformat-security

选项已启用:-faggressive-loop-optimizations
-fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg -fcommon -fdelete-null-pointer-checks -fdwarf2-cfi -asm -fearly -inlining -feeliminate -unused-debug-types -ffunction -cse -fgcse -lm -fgnu -runtime -fgnu-unique -fident -finline-atomics -fira-hoist -press -fira-share-save-slots -fira-share-spill-slots -fivopts -fkeep-static-consts -fleading-underscore -fmath-errno -fmerge-debug-strings -fmove-loop -a 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 -free-loop-ivcanon -ftree-loop-optimize -ftree-parallelize-loops = -ftree -phiprop -free -pta -ftree-reassoc -free-scev-cprop -float -free -free -float -cop- ftree -slp-vectorize -ftree -vect-loop-version -funit-at-a-time -funwind-tables -fvar-tracking -fvar-tracking-assignment -fzero-initialized-in-bss -m128bit-long-double - m64 -m80387 -maccumulate-outgoing-args -malign-stringops -mfancy-math -387 -mfp-ret-in-387 -mfxs r -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命令指定。

选项enebled 是启用且始终使用的选项在特定系统上使用特定 gcc 进行编译,只要选项通过,您不会禁用其中的一部分。

例如,在一个清晰的环境中调用 gcc example.c 将会给你 example.c 作为只传递的选项,但所有选项都启用仍然是一样的。


I am looking for the default compiler flags used during compilation. Therefore I used the command gcc -Q -v <example.c> the output of interest looks like this:

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

I am now wondering: what is the difference between options enabled and options passed?

解决方案

Options passed are options added to the command line, added by configuration, like -march=x86-64 -fstack-protector, or by command invocation, like -v. That means those options are not enabled by default and must be specified by gcc command.

Options enebled are options that are enabled and are always used to compile with that specific gcc on the specific system, as far as into option passed you are not disabling some of them.

E.g. On a clear environment calling gcc example.c will give you example.c as only passed option, but all options enabled still the same.

这篇关于“启用选项”与“启用选项”之间有什么区别?和“通过的选项” usind gcc -Q -v的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆