Closed mihkhub closed 5 years ago
--target-help
Print (on the standard output) a description of target-specific command-line options for each tool. For some targets extra target-specific information may also be printed.
$ gcc --target-help
The following options are target specific:
-m128bit-long-double sizeof(long double) is 16
-m32 Generate 32bit i386 code
-m3dnow Support 3DNow! built-in functions
-m64 Generate 64bit x86-64 code
-m80387 Use hardware fp
-m8bit-idiv Expand 32bit/64bit integer divide into 8bit
unsigned integer divide with run-time check
-m96bit-long-double sizeof(long double) is 12
-mabi= Generate code that conforms to the given ABI
-mabm Support code generation of Advanced Bit
Manipulation (ABM) instructions.
-maccumulate-outgoing-args Reserve space for outgoing arguments in the
function prologue
-maddress-mode= Use given address mode
-madx Support flag-preserving add-carry instructions
-maes Support AES built-in functions and code generation
-malign-double Align some doubles on dword boundary
-malign-functions= Function starts are aligned to this power of 2
-malign-jumps= Jump targets are aligned to this power of 2
-malign-loops= Loop code aligned to this power of 2
-malign-stringops Align destination of the string operations
-mandroid Generate code for the Android platform.
-march= Generate code for given CPU
-masm= Use given assembler dialect
-mavx Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1,
SSE4.2 and AVX built-in functions and code
generation
-mavx2 Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1,
SSE4.2, AVX and AVX2 built-in functions and code
generation
-mavx256-split-unaligned-load Split 32-byte AVX unaligned load
-mavx256-split-unaligned-store Split 32-byte AVX unaligned store
-mbionic Use Bionic C library
-mbmi Support BMI built-in functions and code generation
-mbmi2 Support BMI2 built-in functions and code
generation
-mbranch-cost= Branches are this expensive (1-5, arbitrary units)
-mcld Generate cld instruction in the function prologue.
-mcmodel= Use given x86-64 code model
-mcrc32 Support code generation of crc32 instruction.
-mcx16 Support code generation of cmpxchg16b instruction.
-mdispatch-scheduler Do dispatch scheduling if processor is bdver1 or
bdver2 or bdver3 and Haifa scheduling is selected.
-mf16c Support F16C built-in functions and code
generation
-mfancy-math-387 Generate sin, cos, sqrt for FPU
-mfentry Emit profiling counter call at function entry
before prologue.
-mfma Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1,
SSE4.2, AVX and FMA built-in functions and code
generation
-mfma4 Support FMA4 built-in functions and code
generation
-mforce-drap Always use Dynamic Realigned Argument Pointer
(DRAP) to realign stack
-mfp-ret-in-387 Return values of functions in FPU registers
-mfpmath= Generate floating point mathematics using given
instruction set
-mfsgsbase Support FSGSBASE built-in functions and code
generation
-mfxsr Support FXSAVE and FXRSTOR instructions
-mglibc Use GNU C library
-mhard-float Use hardware fp
-mhle Support Hardware Lock Elision prefixes
-mieee-fp Use IEEE math for fp comparisons
-mincoming-stack-boundary= Assume incoming stack aligned to this power of 2
-minline-all-stringops Inline all known string operations
-minline-stringops-dynamically Inline memset/memcpy string operations, but
perform inline version only for small blocks
-mlarge-data-threshold= Data greater than given threshold will go into
.ldata section in x86-64 medium model
-mlong-double-64 Use 64-bit long double
-mlong-double-80 Use 80-bit long double
-mlwp Support LWP built-in functions and code
generation
-mlzcnt Support LZCNT built-in function and code
generation
-mmmx Support MMX built-in functions
-mmovbe Support code generation of movbe instruction.
-mms-bitfields Use native (MS) bitfield layout
-mno-sse4 Do not support SSE4.1 and SSE4.2 built-in
functions and code generation
-momit-leaf-frame-pointer Omit the frame pointer in leaf functions
-mpc32 Set 80387 floating-point precision to 32-bit
-mpc64 Set 80387 floating-point precision to 64-bit
-mpc80 Set 80387 floating-point precision to 80-bit
-mpclmul Support PCLMUL built-in functions and code
generation
-mpku Support PKU built-in functions and code generation
-mpopcnt Support code generation of popcnt instruction.
-mprefer-avx128 Use 128-bit AVX instructions instead of 256-bit
AVX instructions in the auto-vectorizer.
-mpreferred-stack-boundary= Attempt to keep stack aligned to this power of 2
-mprfchw Support PREFETCHW instruction
-mpush-args Use push instructions to save outgoing arguments
-mrdrnd Support RDRND built-in functions and code
generation
-mrdseed Support RDSEED instruction
-mrecip Generate reciprocals instead of divss and sqrtss.
-mrecip= Control generation of reciprocal estimates.
-mred-zone Use red-zone in the x86-64 code
-mregparm= Number of registers used to pass integer arguments
-mrtd Alternate calling convention
-mrtm Support RTM built-in functions and code generation
-msahf Support code generation of sahf instruction in
64bit x86-64 code.
-msoft-float Do not use hardware fp
-msse Support MMX and SSE built-in functions and code
generation
-msse2 Support MMX, SSE and SSE2 built-in functions and
code generation
-msse2avx Encode SSE instructions with VEX prefix
-msse3 Support MMX, SSE, SSE2 and SSE3 built-in
functions and code generation
-msse4 Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and
SSE4.2 built-in functions and code generation
-msse4.1 Support MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
built-in functions and code generation
-msse4.2 Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and
SSE4.2 built-in functions and code generation
-msse4a Support MMX, SSE, SSE2, SSE3 and SSE4A built-in
functions and code generation
-msseregparm Use SSE register passing conventions for SF and
DF mode
-mssse3 Support MMX, SSE, SSE2, SSE3 and SSSE3 built-in
functions and code generation
-mstack-arg-probe Enable stack probing
-mstackrealign Realign stack in prologue
-mstringop-strategy= Chose strategy to generate stringop using
-mtbm Support TBM built-in functions and code generation
-mtls-dialect= Use given thread-local storage dialect
-mtls-direct-seg-refs Use direct references against %gs when accessing
tls data
-mtune= Schedule code for given CPU
-muclibc Use uClibc C library
-mveclibabi= Vector library ABI to use
-mvect8-ret-in-mem Return 8-byte vectors in memory
-mvzeroupper Generate vzeroupper instruction before a transfer
of control flow out of the function.
-mx32 Generate 32bit x86-64 code
-mxop Support XOP built-in functions and code
generation
-mxsave Support XSAVE and XRSTOR instructions
-mxsaveopt Support XSAVEOPT instruction
Known assembler dialects (for use with the -masm-dialect= option):
att intel
Known ABIs (for use with the -mabi= option):
ms sysv
Known code models (for use with the -mcmodel= option):
32 kernel large medium small
Valid arguments to -mfpmath=:
387 387+sse 387,sse both sse sse+387 sse,387
Known vectorization library ABIs (for use with the -mveclibabi= option):
acml svml
Known address mode (for use with the -maddress-mode= option):
long short
Valid arguments to -mstringop-strategy=:
byte_loop libcall loop rep_4byte rep_8byte rep_byte unrolled_loop
Known TLS dialects (for use with the -mtls-dialect= option):
gnu gnu2
Assembler options
=================
Use "-Wa,OPTION" to pass "OPTION" to the assembler.
-Q ignored
-V print assembler version number
-k ignored
-n Do not optimize code alignment
-q quieten some warnings
-s ignored
--32/--64/--x32 generate 32bit/64bit/x32 code
--divide ignored
-march=CPU[,+EXTENSION...]
generate code for CPU and EXTENSION, CPU is one of:
generic32, generic64, i386, i486, i586, i686,
pentium, pentiumpro, pentiumii, pentiumiii, pentium4,
prescott, nocona, core, core2, corei7, l1om, k1om,
k6, k6_2, athlon, opteron, k8, amdfam10, bdver1,
bdver2, bdver3, bdver4, znver1, btver1, btver2
EXTENSION is combination of:
8087, 287, 387, no87, mmx, nommx, sse, sse2, sse3,
ssse3, sse4.1, sse4.2, sse4, nosse, avx, avx2,
avx512f, avx512cd, avx512er, avx512pf, avx512dq,
avx512bw, avx512vl, noavx, vmx, vmfunc, smx, xsave,
xsaveopt, xsavec, xsaves, aes, pclmul, fsgsbase,
rdrnd, f16c, bmi2, fma, fma4, xop, lwp, movbe, cx16,
ept, lzcnt, hle, rtm, invpcid, clflush, nop, syscall,
rdtscp, 3dnow, 3dnowa, padlock, svme, sse4a, abm,
bmi, tbm, adx, rdseed, prfchw, smap, mpx, sha,
clflushopt, prefetchwt1, se1, clwb, pcommit,
avx512ifma, avx512vbmi, ospke, clzero, mwaitx
-mtune=CPU optimize for CPU, CPU is one of:
generic32, generic64, i8086, i186, i286, i386, i486,
i586, i686, pentium, pentiumpro, pentiumii,
pentiumiii, pentium4, prescott, nocona, core, core2,
corei7, l1om, k1om, k6, k6_2, athlon, opteron, k8,
amdfam10, bdver1, bdver2, bdver3, bdver4, znver1,
btver1, btver2
-msse2avx encode SSE instructions with VEX prefix
-msse-check=[none|error|warning]
check SSE instructions
-moperand-check=[none|error|warning]
check operand combinations for validity
-mavxscalar=[128|256] encode scalar AVX instructions with specific vector
length
-mevexlig=[128|256|512] encode scalar EVEX instructions with specific vector
length
-mevexwig=[0|1] encode EVEX instructions with specific EVEX.W value
for EVEX.W bit ignored instructions
-mevexrcig=[rne|rd|ru|rz]
encode EVEX instructions with specific EVEX.RC value
for SAE-only ignored instructions
-mmnemonic=[att|intel] use AT&T/Intel mnemonic
-msyntax=[att|intel] use AT&T/Intel syntax
-mindex-reg support pseudo index registers
-mnaked-reg don't require `%' prefix for registers
-mold-gcc support old (<= 2.8.1) versions of gcc
-madd-bnd-prefix add BND prefix for all valid branches
-momit-lock-prefix=[no|yes]
strip all lock prefixes
Linker options
==============
Use "-Wl,OPTION" to pass "OPTION" to the linker.
elf_x86_64:
--audit=AUDITLIB Specify a library to use for auditing
-Bgroup Selects group name lookup rules for DSO
--build-id[=STYLE] Generate build ID note
-P AUDITLIB, --depaudit=AUDITLIB
Specify a library to use for auditing dependencies
--disable-new-dtags Disable new dynamic tags
--enable-new-dtags Enable new dynamic tags
--eh-frame-hdr Create .eh_frame_hdr section
--exclude-libs=LIBS Make all symbols in LIBS hidden
--hash-style=STYLE Set hash style to sysv, gnu or both
-z combreloc Merge dynamic relocs into one section and sort
-z common-page-size=SIZE Set common page size to SIZE
-z defs Report unresolved symbols in object files.
-z execstack Mark executable as requiring executable stack
-z global Make symbols in DSO available for subsequently
loaded objects
-z initfirst Mark DSO to be initialized first at runtime
-z interpose Mark object to interpose all DSOs but executable
-z lazy Mark object lazy runtime binding (default)
-z loadfltr Mark object requiring immediate process
-z max-page-size=SIZE Set maximum page size to SIZE
-z muldefs Allow multiple definitions
-z nocombreloc Don't merge dynamic relocs into one section
-z nocopyreloc Don't create copy relocs
-z nodefaultlib Mark object not to use default search paths
-z nodelete Mark DSO non-deletable at runtime
-z nodlopen Mark DSO not available to dlopen
-z nodump Mark DSO not available to dldump
-z noexecstack Mark executable as not requiring executable stack
-z norelro Don't create RELRO program header
-z now Mark object non-lazy runtime binding
-z origin Mark object requiring immediate $ORIGIN
processing at runtime
-z relro Create RELRO program header
-z stacksize=SIZE Set size of stack segment
-z bndplt Always generate BND prefix in PLT entries
--ld-generated-unwind-info Generate exception handling info for PLT.
--no-ld-generated-unwind-info Don't do so.
elf32_x86_64:
--audit=AUDITLIB Specify a library to use for auditing
-Bgroup Selects group name lookup rules for DSO
--build-id[=STYLE] Generate build ID note
-P AUDITLIB, --depaudit=AUDITLIB
Specify a library to use for auditing dependencies
--disable-new-dtags Disable new dynamic tags
--enable-new-dtags Enable new dynamic tags
--eh-frame-hdr Create .eh_frame_hdr section
--exclude-libs=LIBS Make all symbols in LIBS hidden
--hash-style=STYLE Set hash style to sysv, gnu or both
-z combreloc Merge dynamic relocs into one section and sort
-z common-page-size=SIZE Set common page size to SIZE
-z defs Report unresolved symbols in object files.
-z execstack Mark executable as requiring executable stack
-z global Make symbols in DSO available for subsequently
loaded objects
-z initfirst Mark DSO to be initialized first at runtime
-z interpose Mark object to interpose all DSOs but executable
-z lazy Mark object lazy runtime binding (default)
-z loadfltr Mark object requiring immediate process
-z max-page-size=SIZE Set maximum page size to SIZE
-z muldefs Allow multiple definitions
-z nocombreloc Don't merge dynamic relocs into one section
-z nocopyreloc Don't create copy relocs
-z nodefaultlib Mark object not to use default search paths
-z nodelete Mark DSO non-deletable at runtime
-z nodlopen Mark DSO not available to dlopen
-z nodump Mark DSO not available to dldump
-z noexecstack Mark executable as not requiring executable stack
-z norelro Don't create RELRO program header
-z now Mark object non-lazy runtime binding
-z origin Mark object requiring immediate $ORIGIN
processing at runtime
-z relro Create RELRO program header
-z stacksize=SIZE Set size of stack segment
--ld-generated-unwind-info Generate exception handling info for PLT.
--no-ld-generated-unwind-info Don't do so.
elf_i386:
--audit=AUDITLIB Specify a library to use for auditing
-Bgroup Selects group name lookup rules for DSO
--build-id[=STYLE] Generate build ID note
-P AUDITLIB, --depaudit=AUDITLIB
Specify a library to use for auditing dependencies
--disable-new-dtags Disable new dynamic tags
--enable-new-dtags Enable new dynamic tags
--eh-frame-hdr Create .eh_frame_hdr section
--exclude-libs=LIBS Make all symbols in LIBS hidden
--hash-style=STYLE Set hash style to sysv, gnu or both
-z combreloc Merge dynamic relocs into one section and sort
-z common-page-size=SIZE Set common page size to SIZE
-z defs Report unresolved symbols in object files.
-z execstack Mark executable as requiring executable stack
-z global Make symbols in DSO available for subsequently
loaded objects
-z initfirst Mark DSO to be initialized first at runtime
-z interpose Mark object to interpose all DSOs but executable
-z lazy Mark object lazy runtime binding (default)
-z loadfltr Mark object requiring immediate process
-z max-page-size=SIZE Set maximum page size to SIZE
-z muldefs Allow multiple definitions
-z nocombreloc Don't merge dynamic relocs into one section
-z nocopyreloc Don't create copy relocs
-z nodefaultlib Mark object not to use default search paths
-z nodelete Mark DSO non-deletable at runtime
-z nodlopen Mark DSO not available to dlopen
-z nodump Mark DSO not available to dldump
-z noexecstack Mark executable as not requiring executable stack
-z norelro Don't create RELRO program header
-z now Mark object non-lazy runtime binding
-z origin Mark object requiring immediate $ORIGIN
processing at runtime
-z relro Create RELRO program header
-z stacksize=SIZE Set size of stack segment
--ld-generated-unwind-info Generate exception handling info for PLT.
--no-ld-generated-unwind-info Don't do so.
elf_l1om:
--audit=AUDITLIB Specify a library to use for auditing
-Bgroup Selects group name lookup rules for DSO
--build-id[=STYLE] Generate build ID note
-P AUDITLIB, --depaudit=AUDITLIB
Specify a library to use for auditing dependencies
--disable-new-dtags Disable new dynamic tags
--enable-new-dtags Enable new dynamic tags
--eh-frame-hdr Create .eh_frame_hdr section
--exclude-libs=LIBS Make all symbols in LIBS hidden
--hash-style=STYLE Set hash style to sysv, gnu or both
-z combreloc Merge dynamic relocs into one section and sort
-z common-page-size=SIZE Set common page size to SIZE
-z defs Report unresolved symbols in object files.
-z execstack Mark executable as requiring executable stack
-z global Make symbols in DSO available for subsequently
loaded objects
-z initfirst Mark DSO to be initialized first at runtime
-z interpose Mark object to interpose all DSOs but executable
-z lazy Mark object lazy runtime binding (default)
-z loadfltr Mark object requiring immediate process
-z max-page-size=SIZE Set maximum page size to SIZE
-z muldefs Allow multiple definitions
-z nocombreloc Don't merge dynamic relocs into one section
-z nocopyreloc Don't create copy relocs
-z nodefaultlib Mark object not to use default search paths
-z nodelete Mark DSO non-deletable at runtime
-z nodlopen Mark DSO not available to dlopen
-z nodump Mark DSO not available to dldump
-z noexecstack Mark executable as not requiring executable stack
-z norelro Don't create RELRO program header
-z now Mark object non-lazy runtime binding
-z origin Mark object requiring immediate $ORIGIN
processing at runtime
-z relro Create RELRO program header
-z stacksize=SIZE Set size of stack segment
--ld-generated-unwind-info Generate exception handling info for PLT.
--no-ld-generated-unwind-info Don't do so.
elf_k1om:
--audit=AUDITLIB Specify a library to use for auditing
-Bgroup Selects group name lookup rules for DSO
--build-id[=STYLE] Generate build ID note
-P AUDITLIB, --depaudit=AUDITLIB
Specify a library to use for auditing dependencies
--disable-new-dtags Disable new dynamic tags
--enable-new-dtags Enable new dynamic tags
--eh-frame-hdr Create .eh_frame_hdr section
--exclude-libs=LIBS Make all symbols in LIBS hidden
--hash-style=STYLE Set hash style to sysv, gnu or both
-z combreloc Merge dynamic relocs into one section and sort
-z common-page-size=SIZE Set common page size to SIZE
-z defs Report unresolved symbols in object files.
-z execstack Mark executable as requiring executable stack
-z global Make symbols in DSO available for subsequently
loaded objects
-z initfirst Mark DSO to be initialized first at runtime
-z interpose Mark object to interpose all DSOs but executable
-z lazy Mark object lazy runtime binding (default)
-z loadfltr Mark object requiring immediate process
-z max-page-size=SIZE Set maximum page size to SIZE
-z muldefs Allow multiple definitions
-z nocombreloc Don't merge dynamic relocs into one section
-z nocopyreloc Don't create copy relocs
-z nodefaultlib Mark object not to use default search paths
-z nodelete Mark DSO non-deletable at runtime
-z nodlopen Mark DSO not available to dlopen
-z nodump Mark DSO not available to dldump
-z noexecstack Mark executable as not requiring executable stack
-z norelro Don't create RELRO program header
-z now Mark object non-lazy runtime binding
-z origin Mark object requiring immediate $ORIGIN
processing at runtime
-z relro Create RELRO program header
-z stacksize=SIZE Set size of stack segment
--ld-generated-unwind-info Generate exception handling info for PLT.
--no-ld-generated-unwind-info Don't do so.
--help={class|[^]qualifier}[,...]
Print (on the standard output) a description of the command-line options understood by the compiler that fit into all specified classes and qualifiers. These are the supported classes:
optimizers
Display all of the optimization options supported by the compiler.
warnings
Display all of the options controlling warning messages produced by the compiler.
target
Display target-specific options. Unlike the ‘--target-help’ option however, target-specific options of the linker and assembler are not displayed.
params
Display the values recognized by the --param
option.
These are the supported qualifiers:
undocumented
-v
Print (on standard error output) the commands executed to run the stages of compilation. Also print the version number of the compiler driver program and of the preprocessor and the compiler proper.
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)
If you only want some of the stages of compilation, you can use ‘-x’ (or filename suffixes)
to tell gcc where to start, and one of the options -c
, -S
, or -E
to say where gcc is to
stop. Note that some combinations (for example, ‘-x cpp-output -E’) instruct gcc to do
nothing at all.
-c
Compile or assemble the source files, but do not link.
-S
Stop after the stage of compilation proper; do not assemble. The output is in
the form of an assembler code file for each non-assembler input file specified.
By default, the assembler file name for a source file is made by replacing the
suffix ‘.c’, ‘.i’, etc., with .s
.
-E
Stop after the preprocessing stage; do not run the compiler proper.
For any given input file, the file name suffix determines what kind of compilation is done:
file.c
C source code that must be preprocessed.
file.s
Assembler code.
file.i
C source code that should not be preprocessed.
file.ii
C++ source code that should not be preprocessed.
file.S, file.sx
Assembler code that must be preprocessed.
Compilation can involve up to four stages: preprocessing, compilation proper, assembly and linking, always in that order. GCC is capable of preprocessing and compiling several files either into several assembler input files, or into one assembler input file; then each assembler input file produces an object file, and linking combines all the object files (those newly compiled, and those specified as input) into an executable file.