GCC ARM 编译器使用多库、其中链接器根据传递给链接器的选项组合选择要链接的库。 例如、对于通过 CCS "安装 GCC ARM 编译器工具"安装的 GNU v6.3.1、可用的库为:
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 thumb/v8-m.main/fpv5/hard;@mthumb@march=armv8-m.main@mfpu=fpv5-d16@mfloat-abi=hard
当设置新项目时、发现 CCS 没有传递链接器的所有编译器运行时选项、这会导致链接器错误。
例如 、在 CCS 10.4.0.00006中使用 GNU v6.3.1作为编译器、为 RM46L850创建一个新项目。
在 Build -> GNU Compiler -> Runtime options 上、为-mCPU、-mfloat-abi 和-mfpu 输入值:
编译失败、链接器出现错误:
**** 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" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -o"source/dabort.o" "../source/dabort.s" Finished building: "../source/dabort.s" Building file: "../source/errata_SSWF021_45.c" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"source/errata_SSWF021_45.d_raw" -MT"source/errata_SSWF021_45.o" -o"source/errata_SSWF021_45.o" "../source/errata_SSWF021_45.c" Finished building: "../source/errata_SSWF021_45.c" Building file: "../source/esm.c" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"source/esm.d_raw" -MT"source/esm.o" -o"source/esm.o" "../source/esm.c" Finished building: "../source/esm.c" Building file: "../source/notification.c" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"source/notification.d_raw" -MT"source/notification.o" -o"source/notification.o" "../source/notification.c" Finished building: "../source/notification.c" Building file: "../source/pinmux.c" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"source/pinmux.d_raw" -MT"source/pinmux.o" -o"source/pinmux.o" "../source/pinmux.c" Finished building: "../source/pinmux.c" Building file: "../source/sci.c" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"source/sci.d_raw" -MT"source/sci.o" -o"source/sci.o" "../source/sci.c" Finished building: "../source/sci.c" Building file: "../source/sys_core.s" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -o"source/sys_core.o" "../source/sys_core.s" Finished building: "../source/sys_core.s" Building file: "../source/cpp_test.cpp" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"source/cpp_test.d_raw" -MT"source/cpp_test.o" -fno-threadsafe-statics -o"source/cpp_test.o" "../source/cpp_test.cpp" Finished building: "../source/cpp_test.cpp" Building file: "../source/sys_intvecs.s" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -o"source/sys_intvecs.o" "../source/sys_intvecs.s" Finished building: "../source/sys_intvecs.s" Building file: "../source/sys_dma.c" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"source/sys_dma.d_raw" -MT"source/sys_dma.o" -o"source/sys_dma.o" "../source/sys_dma.c" Finished building: "../source/sys_dma.c" Building file: "../source/sys_main.c" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"source/sys_main.d_raw" -MT"source/sys_main.o" -o"source/sys_main.o" "../source/sys_main.c" Finished building: "../source/sys_main.c" Building file: "../source/sys_mpu.s" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -o"source/sys_mpu.o" "../source/sys_mpu.s" Finished building: "../source/sys_mpu.s" Building file: "../source/sys_pcr.c" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"source/sys_pcr.d_raw" -MT"source/sys_pcr.o" -o"source/sys_pcr.o" "../source/sys_pcr.c" Finished building: "../source/sys_pcr.c" Building file: "../source/sys_phantom.c" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"source/sys_phantom.d_raw" -MT"source/sys_phantom.o" -o"source/sys_phantom.o" "../source/sys_phantom.c" Finished building: "../source/sys_phantom.c" Building file: "../source/sys_pmu.s" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -o"source/sys_pmu.o" "../source/sys_pmu.s" Finished building: "../source/sys_pmu.s" Building file: "../source/sys_pmm.c" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"source/sys_pmm.d_raw" -MT"source/sys_pmm.o" -o"source/sys_pmm.o" "../source/sys_pmm.c" Finished building: "../source/sys_pmm.c" Building file: "../source/sys_startup.c" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"source/sys_startup.d_raw" -MT"source/sys_startup.o" -o"source/sys_startup.o" "../source/sys_startup.c" Finished building: "../source/sys_startup.c" Building file: "../source/sys_vim.c" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"source/sys_vim.d_raw" -MT"source/sys_vim.o" -o"source/sys_vim.o" "../source/sys_vim.c" Finished building: "../source/sys_vim.c" Building file: "../source/system.c" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"source/system.d_raw" -MT"source/system.o" -o"source/system.o" "../source/system.c" Finished building: "../source/system.c" Building file: "../source/sys_selftest.c" Invoking: GNU Compiler "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -c -mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-d16 -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp" -I"C:/Users/mr_halfword/workspace_v10/RM46L850_GCC_halcogen_cpp/include" -I"C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"source/sys_selftest.d_raw" -MT"source/sys_selftest.o" -o"source/sys_selftest.o" "../source/sys_selftest.c" ../source/sys_selftest.c: In function 'fmcECCcheck': ../source/sys_selftest.c:797:21: warning: variable 'temp' set but not used [-Wunused-but-set-variable] volatile uint32 temp; ^~~~ ../source/sys_selftest.c:796:21: warning: variable 'otpread' set but not used [-Wunused-but-set-variable] volatile uint32 otpread; ^~~~~~~ ../source/sys_selftest.c: In function 'checkB0RAMECC': ../source/sys_selftest.c:853:18: warning: variable 'regread' set but not used [-Wunused-but-set-variable] volatile uint32 regread = 0U; ^~~~~~~ ../source/sys_selftest.c:852:21: warning: variable 'ramread' set but not used [-Wunused-but-set-variable] volatile uint64 ramread = 0U; ^~~~~~~ ../source/sys_selftest.c: In function 'checkB1RAMECC': ../source/sys_selftest.c:951:18: warning: variable 'regread' set but not used [-Wunused-but-set-variable] volatile uint32 regread = 0U; ^~~~~~~ ../source/sys_selftest.c:950:21: warning: variable 'ramread' set but not used [-Wunused-but-set-variable] volatile uint64 ramread = 0U; ^~~~~~~ ../source/sys_selftest.c: In function 'checkFlashECC': ../source/sys_selftest.c:1049:21: warning: variable 'flashread' set but not used [-Wunused-but-set-variable] volatile uint32 flashread = 0U; ^~~~~~~~~ ../source/sys_selftest.c: In function 'vimParityCheck': ../source/sys_selftest.c:1188:21: warning: variable 'vimramread' set but not used [-Wunused-but-set-variable] volatile uint32 vimramread = 0U; ^~~~~~~~~~ ../source/sys_selftest.c: In function 'dmaParityCheck': ../source/sys_selftest.c:1245:21: warning: variable 'dmaread' set but not used [-Wunused-but-set-variable] volatile uint32 dmaread = 0U; ^~~~~~~ ../source/sys_selftest.c: In function 'het1ParityCheck': ../source/sys_selftest.c:1302:21: warning: variable 'nhetread' set but not used [-Wunused-but-set-variable] volatile uint32 nhetread = 0U; ^~~~~~~~ ../source/sys_selftest.c: In function 'htu1ParityCheck': ../source/sys_selftest.c:1356:21: warning: variable 'hturead' set but not used [-Wunused-but-set-variable] volatile uint32 hturead = 0U; ^~~~~~~ ../source/sys_selftest.c: In function 'het2ParityCheck': ../source/sys_selftest.c:1412:21: warning: variable 'nhetread' set but not used [-Wunused-but-set-variable] volatile uint32 nhetread = 0U; ^~~~~~~~ ../source/sys_selftest.c: In function 'htu2ParityCheck': ../source/sys_selftest.c:1472:21: warning: variable 'hturead' set but not used [-Wunused-but-set-variable] volatile uint32 hturead = 0U; ^~~~~~~ ../source/sys_selftest.c: In function 'adc1ParityCheck': ../source/sys_selftest.c:1527:21: warning: variable 'adcramread' set but not used [-Wunused-but-set-variable] volatile uint32 adcramread = 0U; ^~~~~~~~~~ ../source/sys_selftest.c: In function 'adc2ParityCheck': ../source/sys_selftest.c:1581:21: warning: variable 'adcramread' set but not used [-Wunused-but-set-variable] volatile uint32 adcramread = 0U; ^~~~~~~~~~ ../source/sys_selftest.c: In function 'can1ParityCheck': ../source/sys_selftest.c:1634:21: warning: variable 'canread' set but not used [-Wunused-but-set-variable] volatile uint32 canread = 0U; ^~~~~~~ ../source/sys_selftest.c: In function 'can2ParityCheck': ../source/sys_selftest.c:1698:21: warning: variable 'canread' set but not used [-Wunused-but-set-variable] volatile uint32 canread = 0U; ^~~~~~~ ../source/sys_selftest.c: In function 'can3ParityCheck': ../source/sys_selftest.c:1762:21: warning: variable 'canread' set but not used [-Wunused-but-set-variable] volatile uint32 canread = 0U; ^~~~~~~ ../source/sys_selftest.c: In function 'mibspi1ParityCheck': ../source/sys_selftest.c:1826:21: warning: variable 'spiread' set but not used [-Wunused-but-set-variable] volatile uint32 spiread = 0U; ^~~~~~~ ../source/sys_selftest.c: In function 'mibspi3ParityCheck': ../source/sys_selftest.c:1890:21: warning: variable 'spiread' set but not used [-Wunused-but-set-variable] volatile uint32 spiread = 0U; ^~~~~~~ ../source/sys_selftest.c: In function 'mibspi5ParityCheck': ../source/sys_selftest.c:1954:21: warning: variable 'spiread' set but not used [-Wunused-but-set-variable] volatile uint32 spiread = 0U; ^~~~~~~ ../source/sys_selftest.c: In function 'checkRAMECC': ../source/sys_selftest.c:2019:18: warning: variable 'regread' set but not used [-Wunused-but-set-variable] volatile uint32 regread = 0U; ^~~~~~~ ../source/sys_selftest.c:2018:21: warning: variable 'ramread' set but not used [-Wunused-but-set-variable] volatile uint64 ramread = 0U; ^~~~~~~ ../source/sys_selftest.c: In function 'checkFlashEEPROMECC': ../source/sys_selftest.c:2175:21: warning: variable 'regread' set but not used [-Wunused-but-set-variable] volatile uint32 regread; ^~~~~~~ ../source/sys_selftest.c: In function 'checkRAMAddrParity': ../source/sys_selftest.c:2410:18: warning: variable 'regread' set but not used [-Wunused-but-set-variable] volatile uint32 regread; ^~~~~~~ ../source/sys_selftest.c: In function 'fmcBus1ParityCheck': ../source/sys_selftest.c:2534:21: warning: variable 'flashread' set but not used [-Wunused-but-set-variable] volatile uint32 flashread = 0U; ^~~~~~~~~ Finished building: "../source/sys_selftest.c" Building target: "RM46L850_GCC_halcogen_cpp.out" Invoking: GNU Linker "C:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc-6.3.1.exe" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -mfloat-abi=hard -Wl,-Map,"RM46L850_GCC_halcogen_cpp.map" -o"RM46L850_GCC_halcogen_cpp.out" "./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" -Wl,-T"../source/sys_link.ld" -Wl,--start-group -lc -lstdc++ -Wl,--end-group makefile:163: recipe for target 'RM46L850_GCC_halcogen_cpp.out' failed c:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/hard\libstdc++.a(locale_init.o): In function `(anonymous namespace)::get_locale_mutex()': locale_init.cc:(.text._ZN12_GLOBAL__N_116get_locale_mutexEv+0xc): undefined reference to `__sync_synchronize' c:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/hard\libstdc++.a(locale.o): In function `std::locale::_Impl::_M_install_cache(std::locale::facet const*, unsigned int)': locale.cc:(.text._ZNSt6locale5_Impl16_M_install_cacheEPKNS_5facetEj+0x18): undefined reference to `__sync_synchronize' c:/ti/ccs1040/ccs/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/hard\libstdc++.a(future.o): In function `std::future_category()': future.cc:(.text._ZSt15future_categoryv+0xc): undefined reference to `__sync_synchronize' collect2.exe: error: ld returned 1 exit status gmake[1]: *** [RM46L850_GCC_halcogen_cpp.out] Error 1 makefile:159: recipe for target 'all' failed gmake: *** [all] Error 2 **** Build Finished ****
问题是 、虽然已为编译 器设置了-mcpu=cortex-r4 -mfloat-abi=hard -mfpu=vfpv3-D16选项、但 CCS 仅将这些选项中的-mfloat-abi=hard 传递给链接器。 这导致链接器 multi-lib 选择了不兼容的库、从而导致错误。
若要使工程链接到 Build -> GNU Linker -> Miscellaneous 添加 了-mcpu=cortex-R4和 -mfpu=vfpv3-D16选项:
CCS 不会自动将项目中选择的所有编译器运行时选项传递给链接器、这是否是一个错误?