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.

_Unwind_Backtrace not Available for FreeRTOS using tiarmclang

Toolchain:

  1. We are currently building using the tiarmclang compiler for a TI ARM R5 running FreeRTOS.
  2. We are using the toolset under ti-processor-sdk-rtos-j721-evm-08_05_00_11/ti-cgt-armllvm_1.3.0.LTS.

The issue:

  1. I am trying to use the calls in unwind.h to generate a backtrace. I include unwind.h but get undefined symbol linker errors for:
    1. _Unwind_Backtrace
    2. _Unwind_VRS_Get function calls.

I have tried linking with all the libraries under toolset but to no avail.

Any suggestions ? Do I have to rebuild the toolchain with different settings for these functions to be built ? The toolchain we have was taken straight out of the box and was not built by TI.

  • On a CCS installation with multiple versions of ti-cgt-armllvm just used Notepad++ to search for _Unwind_Backtrace in all files in the ti-cgt-armllvm installations. The results are:

      C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-armllvm_1.3.1.LTS\lib\clang\12.0.1\include\unwind.h (1 hit)
      C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-armllvm_2.0.0.STS\lib\clang\14.0.0\include\unwind.h (1 hit)
      C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-armllvm_2.1.0.LTS\lib\clang\14.0.5\include\unwind.h (1 hit)
      C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-armllvm_3.0.0.STS\lib\armv6m-ti-none-eabi\except\libunwind.a (6 hits)
      C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-armllvm_3.0.0.STS\lib\armv7em-ti-none-eabi\except\libunwind.a (6 hits)
      C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-armllvm_3.0.0.STS\lib\armv7em-ti-none-eabihf\except\libunwind.a (6 hits)
      C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-armllvm_3.0.0.STS\lib\armv7m-ti-none-eabi\except\libunwind.a (6 hits)
      C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-armllvm_3.0.0.STS\lib\armv7r-ti-none-eabi\except\libunwind.a (6 hits)
      C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-armllvm_3.0.0.STS\lib\armv7r-ti-none-eabihf\except\libunwind.a (6 hits)
      C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-armllvm_3.0.0.STS\lib\armv7reb-ti-none-eabi\except\libunwind.a (6 hits)
      C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-armllvm_3.0.0.STS\lib\armv7reb-ti-none-eabihf\except\libunwind.a (6 hits)
      C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-armllvm_3.0.0.STS\lib\armv8m.main-ti-none-eabi\except\libunwind.a (6 hits)
      C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-armllvm_3.0.0.STS\lib\armv8m.main-ti-none-eabihf\except\libunwind.a (6 hits)
      C:\ti\ccs1120\ccs\tools\compiler\ti-cgt-armllvm_3.0.0.STS\lib\clang\15.0.7\include\unwind.h (1 hit)

    This shows that:

    1. In ti-cgt-armllvm_1.3.1.LTS, ti-cgt-armllvm_2.0.0.STS and ii-cgt-armllvm_2.1.0.LTS the only occurrence of _Unwind_Backtrace is in the unwind.h include file
    2. In ti-cgt-armllvm_3.0.0.STS there are libunwind.a libraries which contain _Unwind_Backtrace

    The TI Arm Clang Compiler Tools - 3.0.0.STS Release Notes says " Support for C++ Exceptions (-fexceptions)" is new. I think adding support for C++ Exceptions in ti-cgt-armllvm_3.0.0.STS has also added support for _Unwind_Backtrace, albeit I haven't yet attempted to test this.

  • Many thanks. I will see if we can upgrade to 3.0.0