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/TMS570LS3137: fatal error #10178: attempt to link an object file that is not built for Advanced RISC Machines ARM

Part Number: TMS570LS3137

Tool/software: Code Composer Studio

Hi,

We are porting our current project on the TMS570LS3137 microcontroller.

We built one library which we called as "FWK" on the TMS570LS3137. This FWK is a separate CCS project to create a library file for TMS570LS3137 microcontroller. While creating library it is not giving any error.

We are linking this FWK library to another TMS570LS3137 based CCS project. Let's call it master project.

When we build this master project with "FWK" library linked, it gives following error.

"C:\\ti\\ccsv6\\utils\\bin\\gmake" -j 4 all -O

'Building target: CBK_LAD01_ARM.out'

'Invoking: ARM Linker'

'Flags: -mv7R4 --code_state=32 --float_support=VFPv3D16 -g --gcc --define=__TMS570__ --diag_wrap=off --diag_warning=225 --display_error_number --abi=eabi --enum_type=packed --align_structs=4 --printf_support=full -z -m"CBK_LAD01_ARM.map" --stack_size=0x800 --heap_size=0x800 -i"C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/include" -i"C:/KBData/BhushanP/REPO_NYAB_CCBIII_TMS570/Code/branches/Bhushan/CCA_TMS570/Trunk_Work_ECAL/TMS570_Workspace/CBK_LAD01_ARM/FWK/_Deployment/LAD" -i"C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/lib" --reread_libs --diag_wrap=off --warn_sections --display_error_number --xml_link_info="CBK_LAD01_ARM_linkInfo.xml" --rom_model --be32'

"C:/ti/ccsv6/tools/compiler/arm_15.12.3.LTS/bin/armcl" -@"ccsLinker.opt" -o "CBK_LAD01_ARM.out"

<Linking>

fatal error #10178: attempt to link an object file that is not built for Advanced RISC Machines ARM ("../FWK/_Deployment/LAD/FWKTMS570xx.lib<comcancrc.o>" = Siemens TriCore embedded processor)

gmake[1]: *** [CBK_LAD01_ARM.out] Error 1

>> Compilation failure

makefile:399: recipe for target 'CBK_LAD01_ARM.out' failed

gmake: *** [all] Error 2

makefile:395: recipe for target 'all' failed

It looks like that it is giving an error for FWK library for specific "comcancrc.o" which is not built for ARM for. But when we are creating a separate FWK library for TMS570LS3137 it is not giving any error.

Could you please help us to resolve this issue.

I have attached project properties of FWK and Master Project.

FWK Library Properties:

Master Project Properties:

Both projects using same following CCS version.

Code Composer Studio

Version: 6.2.0.00050

(c) Copyright Texas Instruments, 2014. All rights reserved.

Visit http://www.ti.com

  • Bhusahan,

    Could you please rebuild both the FWK and Master projects, save off the build log for each project and attach them here? 

    Also would be helpful if you can attach the source and object file for the specific file it is reporting an error on (comcancrc.c and comcancrc.o).

  • Hi Arati,

    Thanks for the reply.
    Please find the above requested log files for FWK and Master project, source and object file for (comcancrc.c and comcancrc.o).
    Please let me know if you need additional data.
  • Bhushan Patil42 said:
    Please find the above requested log files for FWK and Master project, source and object file for (comcancrc.c and comcancrc.o).

    I used the armofd.exe program that is part of the TI ARM toolchain to look at the header information in your comcancrc.o object file. The object file was correctly reported as for an "Advanced RISC Machines ARM" machine:

    C:\Users\Mr_Halfword>\ti_ccs7_1_0\ccsv7\tools\compiler\arm_15.12.3.LTS\bin\armofd.exe C:\Users\Mr_Halfword\workspace_v7\TMS570LS3137_object_format\ComCanCrc.obj
    
    OBJECT FILE:  C:\Users\Mr_Halfword\workspace_v7\TMS570LS3137_object_format\ComCanCrc.obj
    
     Object File Information
    
        File Name:           C:\Users\Mr_Halfword\workspace_v7\TMS570LS3137_object_format\ComCanCrc.obj
        Format:              ELF Version 1
        File Type:           relocatable file
        Machine:             Advanced RISC Machines ARM
        Machine Endian:      big endian
        Entry Point:         0x00000000
        Vendor:              Texas Instruments, Inc.
        Producer:            Assembler
        Assembler Version:   15.12.3
        Number of Sections:  62
        File Length:         15384
        ELF Class:           32-bit objects
        ELF e_flags:         0x05000000
    
    <snip>
    
     Build Attributes in ".ARM.attributes"
    
        Format Version:  'A'
    
        <0>  Vendor Name:  "TI" (Texas Instruments, Inc.)
    
             Tag_File:
                Attributes:
                 Tag_Producer_Name     Assembler
                 Tag_Producer_VMajor   16         (Producer Major Version + 1)
                 Tag_Producer_VMinor   13         (Producer Minor Version + 1)
                 Tag_Producer_VPatch   4          (Producer Patch Version + 1)
                 Tag_ABI               3          (ARM EABI)
                 Tag_ISA               10         (ARM v7)
                 Tag_VFP_arch          4          (Some VFPv3-D16 instructions used)
                 Tag_CPU_arch_profile  82         (Real-time profile)
                 Tag_Bitfield_layout   2          (Compatible with any Bitfield Layout)
                 Tag_FP_interface      1
                 Tag_ARM_Mode          1          (# input files built in this mode)
                 Tag_DATA_syms_exist   1          (Data mapping symbols are present)
    
        <1>  Vendor Name:  "aeabi" (ABI for the ARM Architecture)
    
             Tag_File:
                Attributes:
                 Tag_CPU_arch                10  (ARM v7)
                 Tag_CPU_arch_profile        82  (Real-time profile)
                 Tag_ARM_ISA_use             1   (Some ARM instructions used)
                 Tag_VFP_arch                4   (Some VFPv3-D16 instructions used)
                 Tag_PCS_config              1   (Bare platform config)
                 Tag_ABI_PCS_wchar_t         2   (Size of wchar_t is 2)
                 Tag_ABI_FP_number_model     1   (Only IEEE 754 format FP numbers used)
                 Tag_ABI_align_needed        1   (8-byte alignment of 8-byte data required)
                 Tag_ABI_align_preserved     1   (All required 8-byte alignments are preserved, except for SP in leaf function)
                 Tag_ABI_enum_size           1   (Enum values occupy the smallest container big enough to hold all values)
                 Tag_ABI_HardFP_use          3   (SP and DP operations use VFP instructions)
                 Tag_ABI_VFP_args            1   (FP arguments are passed using the VFP register argument variant of the AAPCS)
                 Tag_ABI_optimization_goals  5   (Optimized for good debugging, but speed and small size preserved)
                 Tag_CPU_unaligned_access    1   (Unaligned data accesses were permitted)
    

    I also tried linking your comcancrc.o object file using the TI ARM v15.12.3.LTS linker, which is the same version as you are using. The linker reported undefined symbol errors which is to be expected as I was only trying the link the one object file rather than the entire library:

    'Invoking: ARM Linker'
    "C:/ti_ccs7_1_0/ccsv7/tools/compiler/arm_15.12.3.LTS/bin/armcl" -mv7R4 --code_state=32 --float_support=VFPv3D16 -g --diag_wrap=off --diag_warning=225 --display_error_number --abi=eabi --enum_type=packed -z -m"TMS570LS3137_object_format.map" --stack_size=0x800 --heap_size=0x800 -i"C:/ti_ccs7_1_0/ccsv7/tools/compiler/arm_15.12.3.LTS/lib" -i"C:/ti_ccs7_1_0/ccsv7/tools/compiler/arm_15.12.3.LTS/include" --reread_libs --diag_wrap=off --warn_sections --display_error_number --xml_link_info="TMS570LS3137_object_format_linkInfo.xml" --rom_model --be32 -o "TMS570LS3137_object_format.out" "../ComCanCrc.obj" "./main.obj"  -lrtsv7R4_T_be_v3D16_eabi.lib 
    <Linking>
    warning #10247-D: creating output section ".text" without a SECTIONS specification
    
    warning #10247-D: creating output section ".data" without a SECTIONS specification
    >> Compilation failure
    makefile:141: recipe for target 'TMS570LS3137_object_format.out' failed
    warning #10247-D: creating output section ".cinit" without a SECTIONS specification
    
     undefined             first referenced
      symbol                   in file     
     ---------             ----------------
     s16CoError_MostSevere ../ComCanCrc.obj
     s16ComUtilCrc8_Calc   ../ComCanCrc.obj
     s16ComUtilCrc8_Check  ../ComCanCrc.obj

    Therefore, with the supplied ComCanCrc.obj object file are unable to repeat the linker error that the object file was compiled for a "Siemens TriCore embedded processor" machine.

    Can you try running the armofd program on the FWKTMS570xx.lib library file, and check what "Machine" is reported as part of the Object File Information for the ComCanCrc.obj object file?

    I suspect you have found a bug in the TI ARM linker and/or librarian.

  • Bhushan,

    As pointed out by Chester, the ComCanCrc.obj file that you attached checks out correctly as an ARM object file. I agree with Chester that you should try running the armofd program on the FWKTMS570xx.lib file and see what it reports for that object file. You can simply run the command as: armofd -g FWKTMS570xx.lib > FWKTMS570xx.ofd and look at the contents of the output file. 

    I also observed in the FWK build log that a batch file is being invoked as a post-build step, so please verify that the correct/expected library file is getting pulled into the link step of the Master build.

  • Hi Both,

    I run command armofd on the FWK library and it has generated attached result "FWKTMS570xx.txt". I have to renamed file extension to .txt from .ofd since forum doesn't allow to attached .ofd files.

    It is correctly generating Comcan.obj for "Advanced RISC Machines ARM" same as you generated.

    OBJECT FILE:  ComCanCrc.obj

     Object File Information

        File Name:               ComCanCrc.obj            
        Format:                  ELF Version 1            
        File Type:               relocatable file         
        Machine:                 Advanced RISC Machines ARM
        Machine Endian:          big endian               
        Entry Point:             0x00000000               
        Vendor:                  Texas Instruments, Inc.  
        Producer:                Assembler                
        Assembler Version:       15.12.3                  
        Number of Sections:      62                       
        File Length:             15384                    
        File Offset in Archive:  0x7220c                  
        ELF Class:               32-bit objects           
        ELF e_flags:             0x05000000               

    Then I searched keyword "Tricore" in the entire file and I found many object files are generated with the "Siemens TriCore embedded processor". Please search with this keyword.

    OBJECT FILE:  bt.o

     Object File Information

        File Name:               bt.o                             
        Format:                  ELF Version 1                    
        File Type:               relocatable file                 
        Machine:                 Siemens TriCore embedded processor
        Machine Endian:          little endian                    
        Entry Point:             0x00000000                       
        Tool Version:            0.0.0                            
        Number of Sections:      244                              
        File Length:             51268                            
        File Offset in Archive:  0x3f77e6                         
        ELF Class:               32-bit objects                   
        ELF e_flags:             0x00200000  

    I have TASKING IDE installed on my system.

    I am surprized because I have selected TMS570LS3137 option in CCS and it has nothing to do with Tricore series. I am running my project from CCS.

    Could you please let us know what we are missing? Is it a bug of CCS Linker?

    FWKTMS570xx.zip

  • Bhushan,

    It appears that the library file contains some .o object files (that are for Siemens TriCore) in addition to the TI generated .obj files. Is it possible that the directory that contains the .obj files also contains these .o files? If so, when the archiver creates the library it will pull in all the object files in that directory - that is the expected behavior.  You could probably check the ccsArchiver.opt file to see the list of object files that are being pulled into the library. If this is what is happening, you would need to move the non-TI object files to a different directory.