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.

EK-TM4C1294XL: Using --fpic with the TI arm compiler

Part Number: EK-TM4C1294XL
Other Parts Discussed in Thread: TM4C1294NCPDT

Hello, I'm trying to compile position independent code to flash to the TM4C1294NCPDT microcontroller. I'm not able to set the -fPIC flag under "properties" -> "CCS build" -> "ARM Compiler" as it is automatically interpreted as --cpp_file="IC". Trying to set it with --fPIC is not recognized as a valid flag.  According to https://software-dl.ti.com/codegen/docs/tiarmclang/compiler_tools_user_guide/ I thought it would be possible. Could you help me understand how I can produce pic using CCS?

BR, 

Maja Markusson

  • Maja,

    --fPIC is a valid option when using the TI Arm Clang compiler (tiarmclang).  It is not a valid option when using the legacy Arm Compiler (armcl).  The default compiler for TM4C is armcl.

    If you look at your project options and select CCS General you likely see something like this:

    If using the TI Arm Clang compiler the compiler version would look something like: "TI Clang v1.3.0.LTS"

    I am not sure which specific version of the legacy Arm compiler you are using but here is a link to the users guide for the 20.2.x LTS version:

    https://www.ti.com/lit/pdf/SPNU151V

    I will loop in our compiler expert to comment on PIC with the 20.2.x compiler.

    Regards,

    John

  • Thank you for the quick response John. It appears that I have the default armcl compiler. How can I switch to the tiarmcl? It does not appear as an option inn the fall-down menu where I can choose the compiler version.

  • Maja,

    The latest version of CCS (10.4) comes with both TI Arm Clang and armcl.  You can download TI Arm Clang and use it with older versions of CCS but I would recommend using CCSv10.4 as it has better support for this toolset.

    If you want to download just TI Arm Clang it is available here: https://www.ti.com/tool/ARM-CGT

    If you want the latest CCS it is available here: https://www.ti.com/tool/CCSTUDIO

    Once the compiler is installed CCS will try to discover it.  You can manually tell CCS where to look for it in the preferences dialog here:

    Regards,

    John

  • Unfortunately, despite what the documentation shows, the option -fpic is not supported.  I filed the entry EXT_EP-10458 to have the documentation corrected.  

    No ARM compiler supplied by TI supports a feature for position independent code.

    Thanks and regards,

    -George