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.

CCSTUDIO: CCS Advanced Options-> Command Files : not passed to linker

Expert 2045 points
Part Number: CCSTUDIO


You can through project settings set --cmd_file with options for compiler  / armcl.  That is set / passed correctly.

But the same file is not correctly passed to linker, or to be more correct : if you want to pass exactly same file  (because you want to pass same set of --defines) to linker, you need to explicitly add it as extra input.

E.g.:

Invoking: Arm Linker
"/opt/ti/ccs1030/ccs/tools/compiler/ti-cgt-arm_20.2.5.LTS/bin/armcl" --cmd_file=<myflie here which workes nicely during linking>

That file, will not then actually gets processed by the linker.   

You can however explicitly change  Arm Linker-> Command-line pattern and add this file at the end, after ${output}  <myfile here .. > Then, same set of --define's can be passed to both.

I'm not sure what's the CCS intended behaviour: because, at the last  - linking -step,  I would think there is nothing else to pass to armcl, and you want to pass that file the linker. However, if you have also only compiler specific commands there then you would need separate command files..  With a shared defines (duh).

  • I found another way to do it that may be a bit more convenient.

    Create a text file that contains the --define options you want to pass to both the compiler and the linker.  Something similar to ...

    /* common_defines.txt */
    --define=LINKER_SYMBOL=15

    Add that file to the CCS project.  Refer to it when compiling by using the option --cmd_file.  Use this screen shot as a guide.  

    Click the Add icon, then use the Workspace button to browse to where the file is in the project.  CCS automatically changes that to use those two build-time variables.  

    I presume your project has a linker command file.  At the beginning of that file put ...

    #include "common_defines.txt"

    Thanks and regards,

    -George

  • That was why I posed, that another way you described is the way it does not work for me.  (ignoring #include in the linker cmd file, which I did not plan / do not want to add to my linker cmd.)

    The defines passed this way in file to the armcl do work, but they do not get passed this way to the linker.  So - see above - putting the command file as I do above, then passed it to the linker correctly.

    And if I have to include common_defines.txt with #include into linker, well, then I don't need that command file. But I do want to have it, not limited to just --defines in it.

    My having command file I can invoke builds with different options.