SPRU514Z July 2001 – October 2023 SM320F28335-EP
Options control the operation of the compiler. This section provides a description of option conventions and an option summary table. It also provides detailed descriptions of the most frequently used options, including options used for type-checking and assembling.
For a help screen summary of the options, enter cl2000 with no parameters on the command line.
The following apply to the compiler options:
You can define default options for the compiler by using the C2000_C_OPTION environment variable. For a detailed description of the environment variable, see Section 2.4.1.
Table 2-1 through Table 2-28 summarize all options (including link options). Use the references in the tables for more complete descriptions of the options.
Option | Alias | Effect | Section |
---|---|---|---|
--silicon_version=28 | -v28 | Specifies TMS320C28x architecture. The default (and only value accepted) is 28. This option is no longer required. | Section 2.3.4 |
--abi={coffabi|eabi} | Selects application binary interface. Default is coffabi. Support is also provided for eabi. | Section 2.3.4 | |
--cla_support[=cla0|cla1|cla2] | Specifies TMS320C28x CLA accelerator support for Type 0, Type 1, or Type 2. Default is cla0. Use this option only if the target hardware provides this functionality. | Section 2.3.4 | |
--float_support={ fpu32 | fpu64 | softlib } | Specifies use of TMS320C28x 32-bit or 64-bit hardware floating-point support. The default is softlib. Use this option only if the target hardware provides this functionality. | Section 2.3.4 | |
--idiv_support={none | idiv0} | Enables support for fast integer division using hardware extensions to provide a set of instructions to accelerate integral division for 16-, 32-, and 64-bit values. If this hardware is available, use --idiv_support=idiv0 to cause these instructions to be used. Use this option only if the target hardware provides this functionality. The default is none. (EABI only) | Section 2.3.4 | |
--lfu_reference_elf=path | -lfu=path | In order to create a Live Firmware Update (LFU) compatible executable binary, specify the path to a previous ELF executable binary to use as a reference from which to obtain a list of the memory addresses of global and static symbols. This previous binary may be an LFU-compatible binary, but this is not required. (LFU is supported for EABI only) | Section 2.15 |
-lfu_default[=none | preserve] | Specify the default treatment of global and static symbol addresses
found in the reference ELF executable if they do not have the update
or preserve attribute in the new executable. These treatments are
used during a live firmware upate ("warm start"). If --lfu_default=preserve (the default), the compiler preserves all global and static symbol addresses found in the reference ELF executable unless __attribute__((update)) is specified for a symbol. If --lfu_default=none, the compiler preserves only the addresses of symbols that have __attribute__((preserve)) specified. It re-initializes symbols that have __attribute__((update)) specified. All other global and static symbols can be allocated to any memory address by the linker, but are not re-initialized when a warm start occurs. (LFU is supported for EABI only) |
Section 2.15 | |
--silicon_errata_fpu1_workaround =on|off |
Enabling this option prevents FPU register write conflicts that can occur during certain instructions. The compiler adds NOP instructions before such instructions to prevent conflicts. Use this option only if the target hardware provides FPU functionality. | Section 2.3.4 | |
--tmu_support[=tmu0 | tmu1] | Enables support for the Trigonometric Math Unit (TMU). Using this option also enables FPU32 support (as with --float_support=fpu32). If this option is used but no value is specified, the default is tmu0. The tmu1 option enables support for all tmu0 functionality plus the LOG2F32 and IEXP2F32 instructions. Use this option only if the target hardware provides this functionality. (TMU1 is supported for EABI only.) | Section 2.3.4 | |
--vcu_support[=vcu0|vcu2|vcrc] | Specifies C28x VCU coprocessor support Type 0, Type 2, or VCRC. Use this option only if the target hardware provides this functionality. Default is vcu0. | Section 2.3.4 | |
--unified_memory | -mt | Generates code for the unified memory model. | Section 2.3.4 |
Option | Alias | Effect | Section |
---|---|---|---|
--opt_level=off | Disables all optimization (default). | Section 3.1 | |
--opt_level=n | -On | Level 0 (-O0) optimizes
register usage only. Level 1 (-O1) uses Level 0 optimizations and optimizes locally. Level 2 (-O2) uses Level 1 optimizations and optimizes globally. Level 3 (-O3) uses Level 2 optimizations and optimizes the file. Level 4 (-O4) uses Level 3 optimizations and performs link-time optimization. |
Section 3.1, Section 3.3, Section 3.6 |
--opt_for_space=n | -ms | Controls code size on four levels (0, 1, 2, and 3). | Section 3.13 |
--opt_for_speed[=n] | -mf | Controls the tradeoff between size and speed (0-5 range). If this option is specified without n, the default value is 4. If this option is not specified, the default setting is 2. | Section 3.2 |
Option | Alias | Effect | Section |
---|---|---|---|
--auto_inline=[size] | -oi | Sets automatic inlining size (--opt_level=3 only). If size is not specified, the default is 1. | Section 3.5 |
--call_assumptions=n | -opn | Level 0 (-op0) specifies
that the module contains functions and variables that are called or
modified from outside the source code provided to the compiler. Level 1 (-op1) specifies that the module contains variables modified from outside the source code provided to the compiler but does not use functions called from outside the source code. Level 2 (-op2) specifies that the module contains no functions or variables that are called or modified from outside the source code provided to the compiler (default). Level 3 (-op3) specifies that the module contains functions that are called from outside the source code provided to the compiler but does not use variables modified from outside the source code. |
Section 3.4.1 |
--disable_inlining | Prevents any inlining from occurring. | Section 2.11 | |
--fp_mode={relaxed|strict} | Enables or disables relaxed floating-point mode. | Section 2.3.3 | |
--fp_reassoc={on|off} | Enables or disables the reassociation of floating-point arithmetic. | Section 2.3.3 | |
--fp_single_precision_constant | Causes all unsuffixed floating-point constants to be treated as single precision values instead of as double-precision constants. | Section 2.3.3 | |
--gen_opt_info=n | -onn | Level 0 (-on0) disables the
optimization information file. Level 1 (-on2) produces an optimization information file. Level 2 (-on2) produces a verbose optimization information file. |
Section 3.3.1 |
--isr_save_vcu_regs={on|off} | Generates VCU register save/restore to stack for interrupt routines so that VCU code can be re-entrant. | Section 3.14 | |
--optimizer_interlist | -os | Interlists optimizer comments with assembly statements. | Section 3.10 |
--program_level_compile | -pm | Combines source files to perform program-level optimization. | Section 3.4 |
--sat_reassoc={on|off} | Enables or disables the reassociation of saturating arithmetic. Default is --sat_reassoc=off. | Section 2.3.3 | |
--aliased_variables | -ma | Notifies the compiler that addresses passed to functions may be modified by an alias in the called function. | Section 3.9.2.2 |
Option | Alias | Effect | Section |
---|---|---|---|
--symdebug:dwarf | -g | Default behavior. Enables symbolic debugging. The generation of debug information does not impact optimization. Therefore, generating debug information is enabled by default. | Section 2.3.5
Section 3.12 |
--symdebug:dwarf_version=2|3|4 | Specifies the DWARF format version. The default version is 3 for the COFF ABI and 4 for EABI. | Section 2.3.5 | |
--symdebug:none | Disables all symbolic debugging. | Section 2.3.5 Section 3.12 |
|
--symdebug:profile_coff | Enables profiling using the alternate STABS debugging format. STABS is supported only for the COFF ABI. | Section 2.3.5 | |
--symdebug:skeletal | (Deprecated; has no effect.) |
Option | Alias | Effect | Section |
---|---|---|---|
--include_path=directory | -I |
Adds the specified directory to the #include search path. | Section 2.5.2.1 |
--preinclude=filename | Includes filename at the beginning of compilation. | Section 2.3.3 |
Option | Alias | Effect | Section |
---|---|---|---|
--compile_only | -c | Disables linking (negates --run_linker). | Section 4.1.3 |
--help | -h | Prints (on the standard output device) a description of the options understood by the compiler. | Section 2.3.2 |
--run_linker | -z | Causes the linker to be invoked from the compiler command line. | Section 2.3.2 |
--skip_assembler | -n | Compiles C/C++ source file , producing an assembly language output file. The assembler is not run and no object file is produced. | Section 2.3.2 |
Option | Alias | Effect | Section |
---|---|---|---|
--c89 | Processes C files according to the ISO C89 standard. | Section 6.14 | |
--c99 | Processes C files according to the ISO C99 standard. | Section 6.14 | |
--c11 | Processes C files according to the ISO C11 standard. | Section 6.14 | |
--c++03 | Processes C++ files according to the ISO C++03 standard. | Section 6.14 | |
--cla_background_task ={on|off} | Enables or disables CLA background tasks. | Section 10.1.1 | |
--cla_default | Processes both .c and .cla files as CLA files. | Section 10.1.1 | |
--cla_signed_compare_workaround ={on|off} | Enables automatic use of floating-point comparisons when compiling CLA comparisons that may result in incorrect answers if integer comparison is used. Off by default. | Section 10.1.1 | |
--cpp_default | -fg | Processes all source files with a C extension as C++ source files. | Section 2.3.7 |
--exceptions | Enables C++ exception handling. | Section 6.6 | |
--extern_c_can_throw | Allow extern C functions to propagate exceptions. (EABI only) | -- | |
--float_operations_allowed ={none|all|32|64} |
Restricts the types of floating point operations allowed. | Section 2.3.3 | |
--gen_cross_reference_listing | -px | Generates a cross-reference listing file (.crl). | Section 2.9 |
--pending_instantiations=# | Specify the number of template instantiations that may be in progress at any given time. Use 0 to specify an unlimited number. | Section 2.3.4 | |
--printf_support={nofloat|full| minimal} |
Enables support for smaller, limited versions of the printf function family (sprintf, fprintf, etc.) and the scanf function family (sscanf, fscanf, etc.) run-time-support functions. | Section 2.3.3 | |
--relaxed_ansi | -pr | Enables relaxed mode; ignores strict ISO violations. This is on by default. To disable this mode, use the --strict_ansi option. | Section 6.14.3 |
--rtti | -rtti | Enables C++ run-time type information (RTTI). | –- |
--strict_ansi | -ps | Enables strict ANSI/ISO mode (for C/C++, not for K&R C). In this mode, language extensions that conflict with ANSI/ISO C/C++ are disabled. In strict ANSI/ISO mode, most ANSI/ISO violations are reported as errors. Violations that are considered discretionary may be reported as warnings instead. | Section 6.14.3 |
Option | Alias | Effect | Section |
---|---|---|---|
--preproc_dependency[=filename] | -ppd | Performs preprocessing only, but instead of writing preprocessed output, writes a list of dependency lines suitable for input to a standard make utility. | Section 2.5.8 |
--preproc_includes[=filename] | -ppi | Performs preprocessing only, but instead of writing preprocessed output, writes a list of files included with the #include directive. | Section 2.5.9 |
--preproc_macros[=filename] | -ppm | Performs preprocessing only. Writes list of predefined and user-defined macros to a file with the same name as the input but with a .pp extension. | Section 2.5.10 |
--preproc_only | -ppo | Performs preprocessing only. Writes preprocessed output to a file with the same name as the input but with a .pp extension. | Section 2.5.4 |
--preproc_with_comment | -ppc | Performs preprocessing only. Writes preprocessed output, keeping the comments, to a file with the same name as the input but with a .pp extension. | Section 2.5.6 |
--preproc_with_compile | -ppa | Continues compilation after preprocessing with any of the -pp<x> options that normally disable compilation. | Section 2.5.5 |
--preproc_with_line | -ppl | Performs preprocessing only. Writes preprocessed output with line-control information (#line directives) to a file with the same name as the input but with a .pp extension. | Section 2.5.7 |
Option | Alias | Effect | Section |
---|---|---|---|
--define=name[=def] | -D | Predefines name. | Section 2.3.2 |
--undefine=name | -U | Undefines name. | Section 2.3.2 |
Option | Alias | Effect | Section |
---|---|---|---|
--advice:performance[=all,none] | Provides advice on ways to improve performance. Default is all. | Section 2.3.3 | |
--compiler_revision | Prints out the compiler release revision and exits. | -- | |
--diag_error=num | -pdse | Categorizes the diagnostic identified by num as an error. | Section 2.7.1 |
--diag_remark=num | -pdsr | Categorizes the diagnostic identified by num as a remark. | Section 2.7.1 |
--diag_suppress=num | -pds | Suppresses the diagnostic identified by num. | Section 2.7.1 |
--diag_warning=num | -pdsw | Categorizes the diagnostic identified by num as a warning. | Section 2.7.1 |
--diag_wrap={on|off} | Wrap diagnostic messages (default is on). Note that this command-line option cannot be used within the Code Composer Studio IDE. | ||
--display_error_number | -pden | Displays a diagnostic's identifiers along with its text. Note that this command-line option cannot be used within the Code Composer Studio IDE. | Section 2.7.1 |
--emit_warnings_as_errors | -pdew | Treat warnings as errors. | Section 2.7.1 |
--issue_remarks | -pdr | Issues remarks (non-serious warnings). | Section 2.7.1 |
--no_warnings | -pdw | Suppresses diagnostic warnings (errors are still issued). | Section 2.7.1 |
--quiet | -q | Suppresses progress messages (quiet). | -- |
--set_error_limit=num | -pdel | Sets the error limit to num. The compiler abandons compiling after this number of errors. (The default is 100.) | Section 2.7.1 |
--super_quiet | Super quiet mode. | -- | |
--tool_version | -version | Displays version number for each tool. | -- |
--verbose | Display banner and function progress information. | -- | |
--verbose_diagnostics | -pdv | Provides verbose diagnostic messages that display the original source with line-wrap. Note that this command-line option cannot be used within the Code Composer Studio IDE. | Section 2.7.1 |
--write_diagnostics_file | Generates a diagnostic message information file. Compiler only option. Note that this command-line option cannot be used within the Code Composer Studio IDE. | Section 2.7.1 |
Option | Alias | Effect | Section |
---|---|---|---|
--gen_preprocessor_listing | -pl | Generates a raw listing file (.rl). | Section 2.10 |
Option | Alias | Effect | Section |
---|---|---|---|
--gen_data_subsections={on|off} | Place all aggregate data (arrays, structs, and unions) into subsections. This gives the linker more control over removing unused data during the final link step. See the link to the right for details about the default setting. | Section 4.2.2 | |
--gen_func_subsections={on|off} | -mo | Puts each function in a separate subsection in the object file. If this option is not used, the default is off. See the link to the right for details about the default setting. | Section 4.2.1 |
--no_rpt | -mi | Disables generation of RPT instructions. | Section 2.3.4 |
--protect_volatile | -mv | Enables volatile reference protection. | Section 2.3.4 |
--ramfunc={on|off} | If set to on, specifies that all functions should be placed in the .TI.ramfunc section, which is placed in RAM. | Section 2.3.4 | |
--rpt_threshold=k | Generates RPT loops that iterate k times or less. (k is a constant between 0 and 256.) | Section 2.3.4 |
Option | Alias | Effect | Section |
---|---|---|---|
--entry_hook[=name] | Enables entry hooks. | Section 2.14 | |
--entry_parm={none|name| address} |
Specifies the parameters to the function to the --entry_hook option. | Section 2.14 | |
--exit_hook[=name] | Enables exit hooks. | Section 2.14 | |
--exit_parm={none|name|address} | Specifies the parameters to the function to the --exit_hook option. | Section 2.14 | |
--remove_hooks_when_inlining | Removes entry/exit hooks for auto-inlined functions. | Section 2.14 |
Option | Alias | Effect | Section |
---|---|---|---|
--analyze=codecov | Generate analysis info from profile data. | Section 3.8.2.2 | |
--analyze_only | Only generate analysis. | Section 3.8.2.2 | |
--gen_profile_info | Generates instrumentation code to collect profile information. | Section 3.7.1.3 | |
--use_profile_info=file1[, file2,...] | Specifies the profile information file(s). | Section 3.7.1.3 |
Option | Alias | Effect | Section |
---|---|---|---|
--keep_asm | -k | Keeps the assembly language (.asm) file. | Section 2.3.11 |
--asm_listing | -al | Generates an assembly listing file. | Section 2.3.11 |
--c_src_interlist | -ss | Interlists C source and assembly statements. | Section 2.12
Section 3.10 |
--src_interlist | -s | Interlists optimizer comments (if available) and assembly source statements; otherwise interlists C and assembly source statements. | Section 2.3.2 |
--absolute_listing | -aa | Enables absolute listing. | Section 2.3.11 |
--asm_cross_reference_listing | -ax | Generates the cross-reference file. | Section 2.3.11 |
--asm_define=name[=def] | -ad | Sets the name symbol. | Section 2.3.11 |
--asm_dependency | -apd | Performs preprocessing; lists only assembly dependencies. | Section 2.3.11 |
--asm_includes | -api | Performs preprocessing; lists only included #include files. | Section 2.3.11 |
--issue_remarks | Issues remarks (non-serious warnings), which include additional assembly-time checking. | Section 2.3.11 | |
--asm_undefine=name | -au | Undefines the predefined constant name. | Section 2.3.11 |
--flash_prefetch_warn | Assembler warnings for F281X BF flash prefetch issue. | Section 2.3.11 | |
--include_file=filename | -ahi | Includes the specified file for the assembly module. | Section 2.3.11 |
--preproc_asm | -mx | Preprocesses assembly source, expands assembly macros. | Section 2.3.11 |
Option | Alias | Effect | Section |
---|---|---|---|
--asm_file=filename | -fa | Identifies filename as an assembly source file regardless of its extension. By default, the compiler and assembler treat .asm files as assembly source files. | Section 2.3.7 |
--c_file=filename | -fc | Identifies filename as a C source file regardless of its extension. By default, the compiler treats .c files as C source files. | Section 2.3.7 |
--cpp_file=filename | -fp | Identifies filename as a C++ file, regardless of its extension. By default, the compiler treats .C, .cpp, .cc and .cxx files as a C++ files. | Section 2.3.7 |
--obj_file=filename | -fo | Identifies filename as an object code file regardless of its extension. By default, the compiler and linker treat .obj files as object code files, including both *.c.obj and *.cpp.obj files. | Section 2.3.7 |
Option | Alias | Effect | Section |
---|---|---|---|
--abs_directory=directory | -fb | Specifies an absolute listing file directory. By default, the compiler uses the object file directory. | Section 2.3.10 |
--asm_directory=directory | -fs | Specifies an assembly file directory. By default, the compiler uses the current directory. | Section 2.3.10 |
--list_directory=directory | -ff | Specifies an assembly listing file and cross-reference listing file directory By default, the compiler uses the object file directory. | Section 2.3.10 |
--obj_directory=directory | -fr | Specifies an object file directory. By default, the compiler uses the current directory. | Section 2.3.10 |
--output_file=filename | -fe | Specifies a compilation output file name; can override --obj_directory. | Section 2.3.10 |
--pp_directory=dir | Specifies a preprocessor file directory. By default, the compiler uses the current directory. | Section 2.3.10 | |
--temp_directory=directory | -ft | Specifies a temporary file directory. By default, the compiler uses the current directory. | Section 2.3.10 |
Option | Alias | Effect | Section |
---|---|---|---|
--asm_extension=[.]extension | -ea | Sets a default extension for assembly source files. | Section 2.3.9 |
--c_extension=[.]extension | -ec | Sets a default extension for C source files. | Section 2.3.9 |
--cpp_extension=[.]extension | -ep | Sets a default extension for C++ source files. | Section 2.3.9 |
--listing_extension=[.]extension | -es | Sets a default extension for listing files. | Section 2.3.9 |
--obj_extension=[.]extension | -eo | Sets a default extension for object files. | Section 2.3.9 |
Option | Alias | Effect | Section |
---|---|---|---|
--cmd_file=filename | -@ | Interprets contents of a file as an extension to the command line. Multiple -@ instances can be used. | Section 2.3.2 |