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: C2000 CGT "Use of variable-length arrays is not thread-safe" linker error

Part Number: TI-CGT
Other Parts Discussed in Thread: TMS320F280049C


So I am having an issue with the following error being raised by the linker:

Building target: "f280049c-application.out"
Invoking: C2000 Linker
"C:/ti/ccs1031/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/bin/cl2000" -v28 -ml -mt --cla_support=cla2 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu0 -O2 --opt_for_speed=2 --fp_mode=relaxed --advice:performance=all OMITTED THE REST OF BUILD OPTIONS FOR PRIVACY  
error #10457-D: Use of variable-length arrays is not thread-safe.
error #10010: errors encountered during linking; "f280049c-application.out" not built
remark #10205-D: automatic RTS selection:  linking in "rts2800_fpu32_eabi.lib" in place of index library "libc.a"
FILE: f280049c-application.out
CODE  size (bytes): 79123
CONST size (bytes): 17016
DATA  size (bytes): 20489
>> Compilation failure

This  "error #10457-D: Use of variable-length arrays is not thread-safe." error has no further context that points to where the offending array might be. I have also used the LDRA static analysis tool to try and find it, however I cannot find any errors related to variable length arrays.

I am building with:

C2000 CGT v20.2.5 LTS,
CCS v10.3.1
Building for TMS320F280049C

I have also tried to perform the build with v20.2.7 LTS, 20.12.0 STS, and 22.6.0 LTS. However this error still raised.

So, does anyone know what might be going on here?

1. How might I extract more information out of the linker to tell me what exactly is raised this error?

2. Is this a toolchain bug? I have found the following forum post and bug report for a similar issue:

  • Hello Emily,

    It looks like the issue was marked as fixed, so I'm not sure why you're still seeing the issue. Do you have any arrays that are defined in length by a non-constant value (i.e. a macro or the number itself)? Did you try using the different optimization levels and re-building the project, like in the post you linked?

    Best regards,

    Omer Amir