List of GCC build and link options?
Rayman
Posts: 14,665
I'd like to see a list of command line build and link options...
Couldn't find one, so I've tried to make one for myself, but I'm not 100% what some of these options do:
Does a list like this exist somewhere in the documentation?
Note: The GCC manual includes many, many options... Do they all have an affect?
PS: The manual does not yet include some of the newer Propeller options (like -cmm)...
Couldn't find one, so I've tried to make one for myself, but I'm not 100% what some of these options do:
These are options for the propeller-elf-gcc.exe command line Propeller Mode Options -mcog (runs with program and memory in cog) -mlmm (runs with program and memory in HUB) -mcmm (runs with compact program and memory in HUB) -mxmm (runs with program in external memory and memory in HUB) -mxmmc (?) -mxmm-single (?) -mxmm-split (?) Propeller Cache Options -mfcache (small routines may be cached in cog for faster performance) -mno-fcache (no cache) Propeller Floating Point Options -m32bit-doubles (can make faster by defining double as 32-bit) -m64bit-doubles (regular 64 bit doubles) Propeller Other Options -mpasm (?) -mspin (?) GCC Optimization Options -O0 (none) -O1 (mixed) -O2 (speed) -Os (size) GCC Compiler Options -o a.out (output is a.out) -I . (include current file folder) -Wall (show all warnings) -fexceptions (enable C++ exception handling) -fno-exceptions (no C++ exception handling) -Dprintf=__simple_printf (use smaller printf) GCC Linker Options -lm (include floating point math library) -ltiny (inlude smaller floating point math library) -lpthread (multithreading?)
Does a list like this exist somewhere in the documentation?
Note: The GCC manual includes many, many options... Do they all have an affect?
PS: The manual does not yet include some of the newer Propeller options (like -cmm)...
Comments
-mpasm outputs PASM syntax assembly language from the compiler instead of GAS, and -mspin adds a simple Spin wrapper. Both are very old options added when we first started to develop GCC, and probably do not work correctly any more.
All of the platform independent options in the GCC manual have an effect, so the complete list of options for GCC is extremely long. Hence the very long manual :-) which is the only definitive documentation of GCC options. You've provided a nice summary of the more commonly used ones for the Propeller though. Thanks!
Eric
C:\propgcc>propeller-elf-gcc --target-help
The following options are target specific:
-m32bit-doubles Store doubles in 32 bits for faster and smaller
code.
-m64bit-doubles Store doubles in 64 bits. This is the default.
-mcmm Generate for compressed memory model (CMM) (code
and data in hub)
-mcog Generate code to run in internal cog space.
-mexperimental Enable experimental optimizations which may or
may not work correctly.
-mfcache Enable support for loading external code into the
cog memory fcache. This is enabled by default in
optimization levels -O2 and higher, but may be
disabled with an explicit -mno-fcache.
-mlmm Generate for large memory model (LMM) (code and
data in hub)
-mp2 Select Propeller 2 code generation.
-mpasm Generate assembler output that is compatible with
the PASM assembler. The default is to generate
GAS compatible syntax, unless -mspin is given.
-mspin Output spin wrapper code for the assembly
language.
-mxmm Generate code to run in external flash/rom, with
data in external ram.
-mxmm-single Generate code to run in external memory, with
data in external memory as well.
-mxmm-split Generate code to run in external flash/rom, with
data in external ram.
-mxmmc Generate code to run in external memory (XMM);
data is in hub. Implies -mlmm too.
Assembler options
=================
Use "-Wa,OPTION" to pass "OPTION" to the assembler.
Propeller options
--lmm Enable LMM instructions.
--cmm Enable compressed instructions.
--p2 Enable Propeller 2 instructions.
Linker options
==============
That is: all heavy lifting in a program could be in HUB RAM and other less used functions could be in XMM.
Thanks for the syntax reminder Reinhard
still not sure about -lpthread
Also, there's a note about a new -e option, but not sure it applies here...
I'll not repeat the eye-word here
I see in there:
--p2 Enable Propeller 2 instructions.
Is this automatically enabled by the -mp2 option?
Do you need it for inline GAS assembly?
Or, just pure GAS source files?