The attached example project contains two C source files which include <math.h>, but don't actually make use of any definitions from math.h. When compiled with ti-cgt-armllvm_1.3.0.LTS this can cause the linker to report symbol redefined errors for what appears to be inline functions from <math.h>. E.g.:
**** Build of configuration Debug for project TMS570LC4357_TI_CLANG_math_h **** /home/mr_halfword/ti/ccs1030/ccs/utils/bin/gmake -k -j 12 all -O Building file: "../main.c" Invoking: Arm Compiler "/home/mr_halfword/ti/ccs1030/ccs/tools/compiler/ti-cgt-armllvm_1.3.0.LTS/bin/tiarmclang" -c -mcpu=cortex-r5 -mbig-endian -O0 -I"/home/mr_halfword/workspace_v10/TMS570LC4357_TI_CLANG_math_h" -I"/home/mr_halfword/ti/ccs1030/ccs/tools/compiler/ti-cgt-armllvm_1.3.0.LTS/include" -save-temps -gstrict-dwarf -gdwarf-3 -MMD -MP -MF"main.d_raw" -MT"main.o" -std=c89 -o"main.o" "../main.c" Finished building: "../main.c" Building file: "../test_func.c" Invoking: Arm Compiler "/home/mr_halfword/ti/ccs1030/ccs/tools/compiler/ti-cgt-armllvm_1.3.0.LTS/bin/tiarmclang" -c -mcpu=cortex-r5 -mbig-endian -O0 -I"/home/mr_halfword/workspace_v10/TMS570LC4357_TI_CLANG_math_h" -I"/home/mr_halfword/ti/ccs1030/ccs/tools/compiler/ti-cgt-armllvm_1.3.0.LTS/include" -save-temps -gstrict-dwarf -gdwarf-3 -MMD -MP -MF"test_func.d_raw" -MT"test_func.o" -std=c89 -o"test_func.o" "../test_func.c" Finished building: "../test_func.c" Building target: "TMS570LC4357_TI_CLANG_math_h.out" Invoking: Arm Linker "/home/mr_halfword/ti/ccs1030/ccs/tools/compiler/ti-cgt-armllvm_1.3.0.LTS/bin/tiarmclang" -mcpu=cortex-r5 -mbig-endian -O0 -save-temps -gstrict-dwarf -gdwarf-3 -Wl,-m"TMS570LC4357_TI_CLANG_math_h.map" -Wl,-i"/home/mr_halfword/ti/ccs1030/ccs/tools/compiler/ti-cgt-armllvm_1.3.0.LTS/lib" -Wl,--reread_libs -Wl,--diag_wrap=off -Wl,--display_error_number -Wl,--warn_sections -Wl,--xml_link_info="TMS570LC4357_TI_CLANG_math_h_linkInfo.xml" -Wl,--rom_model -Wl,--be32 -o "TMS570LC4357_TI_CLANG_math_h.out" "./main.o" "./test_func.o" makefile:138: recipe for target 'TMS570LC4357_TI_CLANG_math_h.out' failed error #10056: symbol "__fpclassify" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__fpclassifyf" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__fpclassifyl" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__isfinite" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__isfinitef" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__isfinitel" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__isinf" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__isinff" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__isinfl" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__isnan" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__isnanf" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__isnanl" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__isnormal" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__isnormalf" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__isnormall" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__signbit" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__signbitf" redefined: first defined in "./main.o"; redefined in "./test_func.o" error #10056: symbol "__signbitl" redefined: first defined in "./main.o"; redefined in "./test_func.o" warning #10247-D: creating output section ".text" without a SECTIONS specification warning #10247-D: creating output section ".stack" without a SECTIONS specification warning #10210-D: creating ".stack" section with default size of 0x800; use the -stack option to change the default size error #10010: errors encountered during linking; "TMS570LC4357_TI_CLANG_math_h.out" not built tiarmclang: error: tiarmlnk command failed with exit code 1 (use -v to see invocation) gmake[1]: *** [TMS570LC4357_TI_CLANG_math_h.out] Error 1 gmake: *** [all] Error 2 makefile:134: recipe for target 'all' failed **** Build Finished ****
On investigation the error is sensitive to the "Select assumed C language standard (-std)" option used.
The following values for -std cause the symbol redefined errors:
- c89
- c90
- gnu90
The following values for -std allow the example to link without error:
- c99
- c9x
- c11
- c1x
- c17
- c18
- c2x
- gnu9x
- gnu11
- gnu17
- gnu18
- gnu2x
Is this a bug in the run time library for ti-cgt-armllvm_1.3.0.LTS?