1.3.9. Passing Options to Other Tools from tiarmclang

This section of the tiarmclang Compiler User Manual describes how the tiarmclang’s -W<x>, and -X<y> options can be used to pass options from tiarmclang to other tools in the compiler toolchain.

1.3.9.1. Passing Linker Options - -Wl, and -Xlinker

1.3.9.1.1. -Wl, Usage

The tiarmclang -Wl, option can be used to identify one or more linker command line options that are to be forwarded from tiarmclang to the linker when the linker is invoked from the tiarmclang command line.

tiarmclang [options] [filenames] -Wl,*<opt-list>*

  • -Wl, - is the tiarmclang option that prefixes a list of linker options

  • <opt-list> - is a comma-separated list of one or more linker options

1.3.9.1.2. -Xlinker Usage

Alternatively, you can use the tiarmclang -Xlinker option to identify a linker command line option that is to be forwarded from tiarmclang to the linker when the linker is invoked from the tiarmclang command line.

tiarmclang [options] [filenames] -Xlinker <option>

  • -Xlinker - is the tiarmclang option that prefixes a single linker option

  • <option> - is the linker option that will be passed to the linker

1.3.9.1.3. Examples

While the -Wl, option allows you to pass multiple linker options from tiarmclang to the linker in a single instance, the -Xlinker alternative may be useful in some instances where you want to explicitly control each particular linker option in a tiarmclang command line.

In the following example, the -Wl, option is used to pass both the --rom_model linker option and the lnkme.cmd linker command file directly to the linker:

tiarmclang -mcpu=cortex-m0 hello.c -o a.out -Wl,--rom_model,lnkme.cmd

The above command could also be written using the -Xlinker option as follows:

tiarmclang -mcpu=cortex-m0 hello.c -o a.out -Xlinker --rom_model -Xlinker lnkme.cmd

You can find more information about linker options in the Linker Options section.

1.3.9.2. Passing TI-Syntax Arm Assembler Options - -Wti-a, and -Xti-assembler

1.3.9.2.1. -Wti-a, Usage

The tiarmclang -Wti-a, option can be used to identify one or more legacy TI-syntax Arm assembler command line options that are to be forwarded from tiarmclang to the TI-syntax Arm assembler when it is invoked from the tiarmclang command line.

tiarmclang -x ti-asm <ti_asm_file> [options] [filenames] -Wti-a, <opt-list>

  • -Wti-a, - is the tiarmclang option that prefixes a list of legacy TI-syntax Ar assembler options

  • <opt-list> - is a comma-separated list of one or more TI-syntax Arm assembler options

1.3.9.2.2. -Xti-assembler Usage

Alternatively, you can use the tiarmclang -Xti-assembler option to identify a legacy TI-syntax Arm assembler command line option that is to be forwarded from tiarmclang to the TI-syntax assembler when it is invoked from the tiarmclang command line.

tiarmclang -x ti-asm <ti)asm_file> [options] [filenames] -Xti-assembler <option>

  • -Xti-assembler - is the tiarmclang option that prefixes a single legacy TI-syntax Arm assembler option

  • <option> - is the option that will be passed to the TI-syntax Arm assembler

1.3.9.2.3. Examples

While the -Wti-a, option allows you to pass multiple options from tiarmclang to the legacy TI-syntax Arm assembler in a single instance, the -Xti-assembler alternative may be useful in some instances where you want to explicitly control each particular TI-syntax Arm assembler option in a tiarmclang command line.

In the following example, the -Wti-a, option is used to pass both a -d and a --include_file option directly to the legacy TI-syntax Arm assembler:

tiarmclang -mcpu=cortex-m0 -c -x ti-asm ti_src.asm -Wti-a,-d=__ti__=1,--include_file=ti.inc

The above command could also be written using the -Xti-assembler option as follows:

tiarmclang -mcpu=cortex-m0 -c -x ti-asm ti_src.asm -Xti-assembler -d=__ti__=1 -Xti-assembler --include_file=ti.inc

You can find more information about TI-syntax Arm assembler options in the TI-Syntax Arm Assembler section or in the Arm Assembly Language Tools User’s Guide.