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.

TM4C129EKCPDT: Code Composer compiler link options

Part Number: TM4C129EKCPDT

Hi,

I am trying to include Mongoose Web Service open source code into my project. The source code is a monolithic .c file and is using macros for build options. The code will not be linked into the final binary if not specified by the build option. This requires the compiler to support a link option to do this. For GCC compiler, --gc-sections link option is the one to use.

Does TI's Code Composer ARM compiler supports the similar option or this feature is enabled by default? 

  • I don't think I understand the question.  You make it sound as if you do not want the tools to automatically remove code and data related to the Mongoose Web Service.  But the gcc linker option --gc-sections does exactly that.  

    The linker in the TI Arm toolchain, by default, removes functions never called or data never used.  To disable this behavior for a specific function or data variable, use the option --retain=name_of_function_or_variable

    Thanks and regards,

    -George

  • Thanks George!

    "The linker in the TI Arm toolchain, by default, removes functions never called or data never used." - this is exactly what I wanted to clarify.  I do want the tools to remove the unused code and data if the related feature is not selected.


    I have a further question:

    While playing with mongoose, I found TI's tool does not provide the following header files, and this is preventing the compilation when I include mongoose source code into the project.

    #include <sys/stat.h>
    #include <sys/time.h>
    #include <unistd.h>

    Can I simply copy these files from GCC environment?

  • Can I simply copy these files from GCC environment?

    No.  I presume this is a GCC toolchain for a hosted system such as a Linux box.  In that case, the contents of those header files are specific to that system.  They do not apply to an embedded Arm system. 

    Unfortunately, I lack the expertise needed to suggest an alternative.  I'll notify the device experts about this thread.

    Thanks and regards,

    -George

  • Hi Tianlei,

      Your question is transferred to MCU support team. As noted by George, you cannot just copy as-is the header files (.e.g. sys/stat.h) to embedded Arm system.  I don't have any knowledge about Mongoose Web Service. I will suggest you contact the vendor how to port these files to Arm system. 

  • Hi George, just a bit information for your experts: the mongoose project works in bare-metal. I guess those header files are just for data types. I already made it work with my Soucery CodeBench IDE, but I would like to switch to TI's Code Composer Studio.

    Charles, I would like to keep this thread open to see if I can get more information.