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.

symbol already defined error when optimization on

Hi,

I am using CCS6 with FreeRTOS8.1 if it matters.

 

I have a project that builds fine with optimization off.  However, if I turn optimization on whole program optimizationl  I get the errors below (note all other optimization levels work fine).  I have two projects that show this behavior.

 

<Linking>

error: symbol "mainLoopTimerHandle" has already been defined

error: symbol "mainLoopTimerHandle" has already been defined

error: symbol "mainLoopTimerHandle" has already been defined

error: symbol "mainLoopTimerHandle" has already been defined

error: symbol "mainLoopTimerHandle" has already been defined

>> Compilation failure

fatal error #10192: Failed linktime optimization

  • Hello David,

    We are currently looking into this matter.   


    Regards,

    Sem Amesawu

  • David Sabol said:

    error: symbol "mainLoopTimerHandle" has already been defined

    error: symbol "mainLoopTimerHandle" has already been defined

    error: symbol "mainLoopTimerHandle" has already been defined

    error: symbol "mainLoopTimerHandle" has already been defined

    error: symbol "mainLoopTimerHandle" has already been defined

    It is likely (though not guaranteed) you have violated the rule allowing only one definition of the variable mainLoopTimerHandle.  See this FAQ entry for details.  Pay particular attention to the bit about the "common model" used by Unix compilers and linkers.  I presume you are using the newer EABI, and not the older COFF ABI.  Under that EABI, TI compilers also adhere to the common model of handling multiple global variable definitions.  That is, until you build with --opt_level=4.  Then, the fact that you broke the one definition rule is exposed.  

    The solution to change all those definitions into declarations, except for one.  

    The TI compilers are in for some criticism here.  The tools should be consistent about this.  I filed SDSCM00051031 in the SDOWP system to have this addressed.  Feel free to follow it with the SDOWP link below in my signature.  I filed it against the TI ARM compiler.  That's just an educated guess.  If I'm wrong, it doesn't matter much.  This part of the TI toolset is shared among all the compilers we currently support.

    Thanks and regards,

    -George

  • Thank you so much.  Yes, I missed it, and have it fixed now.

    You are correct I am using the TI ARM compiler.

    [Edit] Not that it is very important, but the record SDSCM00051031 in the SDOWP system is not found.