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: About TI Clang 3.2.0LTS

Part Number: CCSTUDIO
Other Parts Discussed in Thread: MSPM0G3507, TEST2

Hi,

I'm currently developing in the following environment, but I have some questions.

Code Composer Studio : 12.5.0.00007
Compiler : ti-cgt-armllvm_3.2.0.LTS
MCU used : MSMPM0G3507, CC234R05

If you build the code ①(NG Case) below in this environment, it will be embedded in the map file like this.
             .rodata 0 000001a8 00000018
              000001a8 00000009 empty.o (.rodata.str1.117413490714450581041)
              000001b1 00000009 empty.o (.rodata.str1.57731210584388587101)

Moreover, if you create the exact same project in different folders, import and build each in a different workspace,

differences will appear, and differences will also appear in the .txt/.hex files.
Is there any solution for this?

By the way, if you use ti-cgt-armllvm_2.1.3.LTS, the difference will not appear.
Or, if you change it like ②(OK Case) in the code below, the difference will disappear,
I am looking for another method because the amount of changes and the visibility of the code are affected.

The project settings (.project) and source code have been slightly modified, so please check the attached zip file.
The source of the change is the sample project (empty_LP_MSPM0G3507_nortos_ticlang) of MSMPM0G3507 (mspm0_sdk_1_20_00_05).
The map file generated by importing and building the project in empty_test1 in workspace1,
If you import the project in empty_test2 in workspace2, build it, and compare the generated map files, you will see a difference.

①NG Case

#define STR     "ABCDEFGH"

int main(void)
{
    char str1[7];
    char str2[7];

    SYSCFG_DL_init();

    strcpy(str1, STR);
    strcpy(str2, "IJKLMNOP");


    while (1) {
    }
}

②OK Case

static const char STR[] = "ABCDEFGH";

int main(void)
{
    char str1[7];
    char str2[7];
    static const char str3[] = "IJKLMNOP";

    SYSCFG_DL_init();

    strcpy(str1, STR);
    strcpy(str2, str3);


    while (1) {
    }
}

7484.Empty.zip

Best Regards,

  • Hello,

    I have brought this thread to the attention of the compiler experts. Please note that many people are away for the holidays so responses may be delayed.

    Thanks

    ki

  • I can reproduce the behavior where the name of  the .rodata sections is different.  But the length and content of those same .rodata sections is the same.  Is that what you see?  Why must the .rodata sections have the same name?

    Thanks and regards,

    -George

  • Hello,

    Because of the difference, the difference will also appear in the .txt/.hex file as shown in the image below.

    Even if I build the same source code in different environments, I want the generated .txt/.hex files to be the same.

    This is because if differences occur even though the same source code is being built, management becomes complicated.

    Is it possible to set it on CCS? Or are there any other solutions?

    Best Regards,

  • I understand the problem now.  I don't know why the compiler does that.  It does not appear there is any method to change this behavior.  I filed the entry EXT_EP-11620 to have this investigated.  You are welcome to follow it with that link.

    Thanks and regards,

    -George

  • To tell the compiler to not add numbers to the .rodata section names like this ...

                  000001a8 00000009 empty.o (.rodata.str1.117413490714450581041)
                  000001b1 00000009 empty.o (.rodata.str1.57731210584388587101)

    ... build with the option -fno-unique-string-section-names.

    Thanks and regards,

    -George