This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS 10.4.0.00006 : For the GCC ARM compiler how does CCS determine how many of the Compiler Runtime options to pass to the Linker?

Other Parts Discussed in Thread: RM46L850, HALCOGEN

The GCC ARM compiler uses multi-lib where the linker selects the library to link according to combination of options passed to the linker. E.g. for the GNU v6.3.1 installed via the CCS "Install GCC ARM Compiler Tools" the available libraries are:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
C:\ti\ccs1040\ccs\tools\compiler\gcc-arm-none-eabi-6-2017-q1-update\bin>arm-none-eabi-gcc.exe --print-multi-lib
.;
thumb;@mthumb
hard;@mfloat-abi=hard
thumb/v6-m;@mthumb@march=armv6s-m
thumb/v7-m;@mthumb@march=armv7-m
thumb/v7e-m;@mthumb@march=armv7e-m
thumb/v7-ar;@mthumb@march=armv7
thumb/v8-m.base;@mthumb@march=armv8-m.base
thumb/v8-m.main;@mthumb@march=armv8-m.main
thumb/v7e-m/fpv4-sp/softfp;@mthumb@march=armv7e-m@mfpu=fpv4-sp-d16@mfloat-abi=softfp
thumb/v7e-m/fpv4-sp/hard;@mthumb@march=armv7e-m@mfpu=fpv4-sp-d16@mfloat-abi=hard
thumb/v7e-m/fpv5-sp/softfp;@mthumb@march=armv7e-m@mfpu=fpv5-sp-d16@mfloat-abi=softfp
thumb/v7e-m/fpv5-sp/hard;@mthumb@march=armv7e-m@mfpu=fpv5-sp-d16@mfloat-abi=hard
thumb/v7e-m/fpv5/softfp;@mthumb@march=armv7e-m@mfpu=fpv5-d16@mfloat-abi=softfp
thumb/v7e-m/fpv5/hard;@mthumb@march=armv7e-m@mfpu=fpv5-d16@mfloat-abi=hard
thumb/v7-ar/fpv3/softfp;@mthumb@march=armv7@mfpu=vfpv3-d16@mfloat-abi=softfp
thumb/v7-ar/fpv3/hard;@mthumb@march=armv7@mfpu=vfpv3-d16@mfloat-abi=hard
thumb/v8-m.main/fpv5-sp/softfp;@mthumb@march=armv8-m.main@mfpu=fpv5-sp-d16@mfloat-abi=softfp
thumb/v8-m.main/fpv5-sp/hard;@mthumb@march=armv8-m.main@mfpu=fpv5-sp-d16@mfloat-abi=hard
thumb/v8-m.main/fpv5/softfp;@mthumb@march=armv8-m.main@mfpu=fpv5-d16@mfloat-abi=softfp
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

When setting up a new project have found that CCS doesn't pass all of the Compiler Runtime options the the Linker which can cause linker errors.

E.g. create a new project for a RM46L850 in CCS 10.4.0.00006 using GNU v6.3.1 as the compiler.

On the Build -> GNU Compiler -> Runtime options entered values for -mcpu, -mfloat-abi and -mfpu:

A build failed with errors from the linker:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
**** Clean-only build of configuration Debug for project RM46L850_GCC_halcogen_cpp ****
"C:\\ti\\ccs1040\\ccs\\utils\\bin\\gmake" -k -j 4 clean -O
DEL /F "RM46L850_GCC_halcogen_cpp.hex" "RM46L850_GCC_halcogen_cpp.out"
DEL /F "source\cpp_test.o" "source\dabort.o" "source\errata_SSWF021_45.o" "source\esm.o" "source\notification.o" "source\pinmux.o" "source\sci.o" "source\sys_core.o" "source\sys_dma.o" "source\sys_intvecs.o" "source\sys_main.o" "source\sys_mpu.o" "source\sys_pcr.o" "source\sys_phantom.o" "source\sys_pmm.o" "source\sys_pmu.o" "source\sys_selftest.o" "source\sys_startup.o" "source\sys_vim.o" "source\system.o"
DEL /F "source\errata_SSWF021_45.d" "source\esm.d" "source\notification.d" "source\pinmux.d" "source\sci.d" "source\sys_dma.d" "source\sys_main.d" "source\sys_pcr.d" "source\sys_phantom.d" "source\sys_pmm.d" "source\sys_selftest.d" "source\sys_startup.d" "source\sys_vim.d" "source\system.d"
DEL /F "source\cpp_test.d"
DEL /F "source\dabort.d" "source\sys_core.d" "source\sys_intvecs.d" "source\sys_mpu.d" "source\sys_pmu.d"
Could Not Find C:\Users\mr_halfword\workspace_v10\RM46L850_GCC_halcogen_cpp\Debug\RM46L850_GCC_halcogen_cpp.hex
Could Not Find C:\Users\mr_halfword\workspace_v10\RM46L850_GCC_halcogen_cpp\Debug\source\dabort.d
Finished clean
**** Build Finished ****
**** Build of configuration Debug for project RM46L850_GCC_halcogen_cpp ****
"C:\\ti\\ccs1040\\ccs\\utils\\bin\\gmake" -k -j 4 all -O
Building file: "../source/dabort.s"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The problem is that while the -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 options had been set for the compiler, of those options only -mfloat-abi=hard had been passed to the linker by CCS. This caused the linker multi-lib to select an incompatible library resulting in errors.

To get the project to link under Build -> GNU Linker -> Miscellaneous added the -mcpu=cortex-r4 and -mfpu=vfpv3-d16 options:

Is it a bug that CCS doesn't automatically pass all of the Compiler Runtime options selected in the project to the Linker?