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.

ti-cgt-arm_18.12.2.LTS/bin/armasm experienced a segmentation fault while processing section .text

Hello,

I am using TI 18.12.2.LTS C/C++ compiler to build the .asm file, which has mixed assembly and C/C++ environments to share C headers containing declarations and prototypes between the C and assembly code.

I found .cdecls directive and the sample example for the usage of mixed assembly and C/C++ environments inside .asm file on below document and having code as : 

line 1. .cdecls C,NOLIST

line 2. %{

line 3. #define ASMTEST 1

line 4. %}

line 5. .cdecls C,NOLIST

line 6. %{

line 7. #ifndef ASMTEST

line 8. #warn "ASMTEST not defined!" /* will be issued */

line 9. #endif

line 10. %}

https://downloads.ti.com/docs/esd/SPNU118W/index.html##viewer?document=%257B%2522href%2522%253A%2522%252Fdocs%252Fesd%252FSPNU118W%2522%257D&url=pragmas-spru1869005.html%23SPRU1869005.

When I am trying to build above code received segmentation fault with below message : 

(ASM) src/os/threadx/tx_thread_schedule.asm

INTERNAL ERROR: /build_server/compiler/ti-cgt-arm_18.12.2.LTS/bin/armasm experienced a segmentation fault
while processing section .text file src/os/threadx/tx_thread_schedule.asm line 4

This is caused by a defect in the TI Assembler.
TI Customer Support may be able to suggest a workaround to avoid this.

Upgrading to the newest version of the compiler may fix this problem.

Contact TI in the E2E support forums at http://e2e.ti.com under
"Development Tools", "TI C/C++ Compiler". See the link titled
"Submitting an issue".

We need to see this ENTIRE error message and a complete, reproducible
test case including ALL of the command-line options.
>> Compilation failure

Request you to provide some solution on usage of mixed assembly and C/C++ environments to share C headers containing declarations and prototypes between the C and assembly code.

Regards,

Salim Mulla

  • Unfortunately, I am unable to reproduce the same result.  Here is what I tried ...

    C:\examples>type file.asm
            .cdecls C,NOLIST
            %{
                #define ASMTEST 1
            %}
    
            .cdecls C,NOLIST
            %{
                #ifndef ASMTEST
                    #warn "ASMTEST not defined!" /* will be issued */
                #endif
            %}
    
    C:\examples>armcl file.asm
    "file.asm", line 9: warning: #warning directive: "ASMTEST not defined!" /* will be issued */

    Note every line in file.asm begins with a tab, and perhaps a few more spaces.  Please demonstrate your problem in a similar manner.  Please copy-and-paste the text, and do not use a screen shot.

    Request you to provide some solution on usage of mixed assembly and C/C++ environments to share C headers containing declarations and prototypes between the C and assembly code.

    The .cdecls directive has been supported in the TI ARM toolchain for a long time, over 10 years.  Many customers have used it with no problems.  Whatever is wrong in this case is likely to be some unusual detail that is easily corrected.

    Thanks and regards,

    -George

  • Dear George,

    I am able to build standalone file with the code you pasted and below code also.

        .cdecls C,NOLIST
        %{
            #define ASMTEST 1
        %}
    
        .cdecls C,NOLIST
        %{
            #ifndef TX_ENABLE_EXECUTION_CHANGE_NOTIFY
                #define ASMTEST1 2
            #endif
        %}

    But when I am adding above code file to the CMake build structure (which have more than 30-40 files)then getting the above mentioned error.

    Request you to provide some solution for using #if #define inside .asm file.

    Regards,
    Salim Mulla

  • Until I reproduce this behavior ...

    INTERNAL ERROR: /build_server/compiler/ti-cgt-arm_18.12.2.LTS/bin/armasm experienced a segmentation fault

    ... I am unable to advance this issue.

    Please try to create a cut-down test case based on the source file ...

    src/os/threadx/tx_thread_schedule.asm

    Try to get the same behavior while building an assembly file that includes no other files.  Then zip that file up and attach it to your next post.  Also show the exact options used when building the file.  Please copy-and-paste the text, and do not use a screen shot.

    Thanks and regards,

    -George

  • The issue is because of compiler options. Thank you so much for the support.

  • The issue is because of compiler options

    Please post those compiler options.  Please copy-and-paste the text, and do not use a screen shot.

    Thanks and regards,

    -George

  • Dear George,

    We observed that there were few MCAL specific inclusion (C header) files given to assembler for compilation. 

    And that was causing the issue.