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 6.1.0 and CCS 5.5.0 lead to different generated out files using same project and compiler

Using the same CCS project and the same Compiler version CGT6000 TI v7.4.4 lead to different output on CCS 6.1.0 and CCS 5.5.0. The project generated by CCS 6.1.0 is about 60% larger.

I checked the compiler and linker flags and they are identical with respect of the library paths (ccsv6 instead of ccsv5). From my point of view the output should be the same using the same CGT version... I am wondering what else can be different?


Some additional information on the project:

- Using DSP/BIOS support version 5.42.1.09

- Output format: legacy COFF

- Project uses templates

Regards Tobias

  • tobias.heiss said:
    The project generated by CCS 6.1.0 is about 60% larger.

    This difference might be due to additional functions being included in the build.  Run the names utility nm6x over the final executable from each build and compare the output.  The names utility is described in the C6000 assembly tools manual.  That will show you the functions which are added in the larger build, and you can investigate to see how that happened.

    Thanks and regards,

    -George

  • Hello George,

    Thank you for the reply. I started to investigate that issue deeper.

    Using nm6x was not helpful cause the symbols in the .out files were already removed using strip6x -p utility.

    I tried to clean and build the same selected file on both environments. The corresponding *.obj file has the same size. Afterwards calling a build all will increase the size of these object files but in a different way depending on the environment. So I guess it is a linker issue. I checked the CDT Build Console and found out that invoking the linker the list of the object files are in a different order.

    Why are the object files in a different order and why is the result different?

  • tobias.heiss said:
    calling a build all will increase the size of these object files

    That's because of late template instantiation.  This wiki article describes late template instantiation as part of a larger article about problems with it.  Ignore the part of the article that details those problems.

    tobias.heiss said:
    Why are the object files in a different order

    I don't know.  From a correctness of execution point of view, it doesn't matter.

    tobias.heiss said:
    why is the result different?

    The order in which functions are laid out in memory varies with several factors.  One of those factors is the order in which the linker sees the object files.  Even if only two functions change places, that one difference causes all sorts of other differences in the executable image.

    Thanks and regards,

    -George

  • tobias.heiss said:
    I checked the CDT Build Console and found out that invoking the linker the list of the object files are in a different order.

    I have seen build problems before where CCS installations on different machines passed the list of object files to the linker in a different order.

    Didn't investigate the underlying reason, but found that under CCS Project Properties -> CCS Build -> Link Order you can specify the order objects are passed to the linker. Maybe you can try fixing the Link Order to see if that generates a repeatable build between CCS 6.1.0 and CCS 5.5.0.

    [https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/390552 is an example of where specifying the Link Order in the CCS project was able to to avoid a linker error]

  • Thank you for the hints.

    I add "Generated Linker Command files" to the Link Order and now I get a similar result on both environments.

    Is there a rule of thumb how should be the preferred order (regarding: Generated Linker Command files, Runtime support libraries, 3rd party libraries, c files, c++ files, cmd files) to optimize output file size and compile time?