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.

ti-cgt-armllvm_1.3.0.LTS can report report symbol redefined errors if math.h included in multiple source files, depending on -std option

Other Parts Discussed in Thread: TMS570LC4357

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.:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
**** 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"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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?

TMS570LC4357_TI_CLANG_math_h.zip

  • Thank you for notifying us of this problem, and supplying a concise test case.  I can reproduce the same behavior.  I filed the entry EXT_EP-10367 to have this investigated.  You are welcome to follow it with that link.

    Thanks and regards,

    -George