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.

CCS/TMS320F280049C: Link Order in ProjectSpec

Part Number: TMS320F280049C
Other Parts Discussed in Thread: SFRA, C2000WARE

Tool/software: Code Composer Studio

How do i specify link order in projectSpec ? 

I cannot seem to get the fastRTS to link by simply importing the projectspec,

I have to go in and click on the imported project and then make a selection in the link order?? 

  • Manish,

    I don't see anything in the schema for projectspecs that allows for this. I am going to have to dig into this and get back to you.

    Regards,
    John
  • Manish,

    How are you specifying the libraries today? Are they in the linker command file or as part of -l/--library options in the build settings?

    Regards,
    John
  • linkerBuildOptions="--stack_size=0x400
    --heap_size=0x200
    --define RAM
    -i${PROJECT_ROOT}/libraries/sfra
    -i${PROJECT_ROOT}/libraries/FPUfastRTS
    -i${PROJECT_ROOT}/device/driverlib/ccs/Release
    -l driverlib_eabi.lib
    -l sfra_f32_eabi.lib
    -l rts2800_fpu32_fast_supplement_eabi.lib
    -l rts2800_fpu32_eabi.lib " />

    I specify the above, is it sufficient to do this ?
  • Manish,

    You could also add --priority.

    -l driverlib_eabi.lib
    -l sfra_f32_eabi.lib
    -l rts2800_fpu32_fast_supplement_eabi.lib
    -l rts2800_fpu32_eabi.lib
    --priority

    Regards,
    John
  • There is a little more info on the --priority option here

    4.3.1.3 Library Order for Searching for Symbols

    Generally, you should specify the run-time-support library as the last name on the command line because the linker searches libraries for unresolved references in the order that files are specified on the command line. If any object files follow a library, references from those object files to that library are not resolved. You can use the --reread_libs option to force the linker to reread all libraries until references are resolved. Whenever you specify a library as linker input, the linker includes and links only those library members that resolve undefined references.

    By default, if a library introduces an unresolved reference and multiple libraries have a definition for it, then the definition from the same library that introduced the unresolved reference is used. Use the --priority option if you want the linker to use the definition from the first library on the command line that contains the definition.

  • John,

    Thanks for your reply, 

    One issue I have is that the command line option get changes by CCS depending on where the .lib is , for example in my case when i import the project we copy the .lib as well to give customers a standalone project which they always ask for.

    Now inside this imported project, we see that some additional items are added to the command line as the project builds.

    I can confirm that by doing the -l route only, the linker is behaving properly. So, for now, I will keep that in the projects. I started looking into it because of an adjacent issue. 

    Thanks for your prompt clarification and information on the priority option.  

    Regards

    Manish

  • Manish,

    If the library is physically in the CCS project folder then CCS is going to add that as an input to the linker just like the .obj files generated from the source files.

    Using a C2000Ware project as an example I removed the link order settings and then built the project once with the fast supplement library specified with -l and then again with it added to the project directly.

    Specified with -l

    --priority 

    Obj files from .c files

    -lrts2800_fpu32.lib 

    -lIQmath_fpu32.lib 

    -lrts2800_fpu32_fast_supplement.lib 

    fast_supplement as a source file in project

    --priority 

    Obj files from .c files

    "../rts2800_fpu32_fast_supplement.lib"  

    -lrts2800_fpu32.lib 

    -lIQmath_fpu32.lib

    So basically you can see that the generated .obj files get passed to the linker before the libraries specific on the command line.  In the case where the library is a source file in the project it gets passed with the obj files.

    Regards,

    John

  • Thanks John, i

    Also, If I exclude them from build in projectspec option, the additional item is not added to the command line as well.

    Thanks for your inputs.