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.

Compiler/TM4C1290NCPDT: GCC - ASM to TI - CCS

Part Number: TM4C1290NCPDT

Tool/software: TI C/C++ Compiler

Hi, 

I made now a deeper test encountering a problem. The Compiler works, but when linking its says:

error #16004-D: file "/share/opt/ti/tm4c129/curve25519/libCurve25519.a<x25519-cortex-m4-gcc.o>" has a Tag_ABI_VFP_args attribute value of "0" that is different than one previously seen ("1"); combining incompatible files
error #16012-D: file "/share/opt/ti/tm4c129/curve25519/libCurve25519.a<x25519-cortex-m4-gcc.o>" does not preserve 8-byte alignment of 8-byte data, but other input files require this; incompatible files

I set for gcc the options -mfloat-abi=hard -mfpu=fpv4-sp-d16

in my TI Compiler compile with --float_support=FPv4SPD16  

which should be the same here. Actually flloating point is not used at all. 

Anyway this doesnot help. Any Ideas?

Regards

Micky

  • Hello Michael,

    I cannot figure out where the libCurve25519.a comes from, can you elaborate on that? I am not sure which team to involve in helping you solve this issue.

    Any documentation about how it is built would be helpful.

  • Hi Ralph,
    see the history of this in e2e.ti.com/.../684421
    libCurve25519 is built from a gcc asm source and I want this to use with TI Compiler.

    Thanks & Regards
    Micky
  • To understand how this occurred, we need more information.  I presume you build the libCurve25519 library.  Please indicate the version of the GCC ARM compiler and the TI ARM compiler you use.  Show exactly how you build the library, how you build one of your main source files, and how you link.  I need to see all of the compiler options, and all the resulting diagnostics.  Provide all of that by copy-n-paste.

    It may be easier to supply the entire build log.  In the CCS Console view, use the Copy Build Log icon to save the contents of the view to a file. Be sure to use the file extension .txt.  Attach it to your next post.

    Thanks and regards,

    -George

  • 
    

    Hi George, 

    Here is the compiler envoking (TI Compiler for my project is with a makefile) :

    /share/opt/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/bin/armcl -me -g --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --ual  -DDEBUG -al  -mv7M4  --code_state=16 --float_support=FPv4SPD16   -i="/share/opt/ti/tm4c129"  -i="/share/opt/ti/tm4c129/inc" -i="/share/opt/ti/tm4c129/curve25519" -i"/share/opt/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/include" -i"./" -i"lwip-1.4.1/apps"  -i"lwip/src/include"  -i"lwip/src/include/ipv4" -i"lwip/ports/tiva-tm4c129/include" --advice:power="all" --define=ccs="ccs" --define=PART_TM4C129EKCPDT --gcc --diag_warning=225 --define=TARGET_IS_TM4C129_RA2 --diag_suppress=1527,2623,1542,1534,16004 -DKNXNETIP_DEVICE=1164 -DVERSION=\"devel\" -DROUTER=1164 -DINTERFACE=1150 -DMANUFACTURER=166 -DENERTEX=166 -DJUNG=4 -DMEMORY_SIZE=262144 

    Linking in with 

    /share/opt/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/bin/armcl obj/knxdev.odebug  obj/startup.odebug  obj/uartstdio.odebug  obj/ustdlib.odebug  obj/pbkdf2.odebug   --advice:power=all -g --gcc --define=ccs="ccs" --define=PART_TM4C129ENCPDT --define=TARGET_IS_TM4C129_RA1 --diag_wrap=off --diag_warning=225 --display_error_number --gen_func_subsections=on --ual -z -m"testprogg.map" --heap_size=8196 --stack_size=8196 -I="/share/opt/ti/tm4c129/driverlib/lib" -I"/share/opt/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/lib" -I="/share/opt/ti/tm4c129/curve25519"  --reread_libs --display_error_number --diag_wrap=off --warn_sections --xml_link_info="testprog.xml" --rom_model  -o testprogg.out lnkg.cmd -llibc.a -ldriverlibg.lib -llibCurve25519.a

    Here the Lib compiler /GNU v6.3.1.(Linaro) 

    **** Build of configuration Release__GNU for project Curve25519 ****
    
    /share/opt/ti/ccs740/ccsv7/utils/bin/gmake -k -j 8 all -O 
     
    Building file: "../x25519-cortex-m4-gcc.s"
    Invoking: GNU Compiler
    "/share/opt/ti/ccs740/ccsv7/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc" -c -mcpu=cortex-m4 -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DPART_TM4C1292NCPDT -I"/home/michi/workspace_v74/Curve25519" -I"/share/opt/ti/ccs740/ccsv7/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -O2 -ffunction-sections -fdata-sections -Wall -MMD -MP -MF"x25519-cortex-m4-gcc.d" -MT"x25519-cortex-m4-gcc.o" -x assembler-with-cpp  -o"x25519-cortex-m4-gcc.o" "../x25519-cortex-m4-gcc.s"
    gmake: Warning: File 'objects.mk' has modification time 0,61 s in the future
    Finished building: "../x25519-cortex-m4-gcc.s"
     
    Building target: "libCurve25519.a"
    Invoking: GNU Librarian
    "/share/opt/ti/ccs740/ccsv7/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-ar" -r "libCurve25519.a" "./x25519-cortex-m4-gcc.o"  
    /share/opt/ti/ccs740/ccsv7/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-ar: creating libCurve25519.a
    gmake: warning:  Clock skew detected.  Your build may be incomplete.
    Finished building target: "libCurve25519.a"
     
    
    **** Build Finished ****
    

  • I have a good idea of what is wrong.  I can point you in the right direction to fix it.  But the final specifics of the fix I have to leave to you.

    It turns out that build options alone are not enough to establish whether two object files are compatible.  To decide whether two object files are compatible, the linker inspects the build attributes from each file.  To see the build attributes for one object file, use the utility armofd ...

    % armofd --obj_display=none,battrs file.obj
    <... snip ...>
                 Tag_CPU_arch                13  (ARM v7E-M)
                 Tag_CPU_arch_profile        77  (Microcontroller profile)
                 Tag_THUMB_ISA_use           2   (Some Thumb2 instructions used)
    <... and so on ...>

    The utility armofd comes with the TI ARM compiler installation.  It is documented in the ARM assembly tools manual.  That use of --obj_display limits the output to the build attributes.  Change file.obj to the name of the file you want to inspect.  You can use armofd on object files produced by GCC ARM tools.

    You will see there are about 30 build attributes.  Not all of them are derived from the command line options.  For attributes that are never specified, a default is used.  And those defaults may not match those used in another build.  In your case, some of the defaults chosen by the GCC ARM assembler do not match those required by the TI ARM compiler build.

    In the GCC assembler, the method for indicating the value of a build attribute is the directive .eabi_attribute.  It is documented in the GCC assembler manual.  That manual is the file as.pdf in a location similar to ...

    C:\ti\ccsv7\tools\compiler\gcc-arm-none-eabi-6-2017-q1-update\share\doc\gcc-arm-none-eabi\pdf

    Unfortunately, that documentation only shows the bare syntax, and lists the available attribute names.  More information is needed.  The build attributes are specified by the ARM EABI standard, maintained by ARM Ltd.  That link is to the root of the entire document set.  Navigate to the Addenda to, and Errata in, the ABI for the ARM Architecture Documentation.  Search that document for the name of the attribute of interest, such as Tag_ABI_VFP_args.

    This is the point where I show you some specifics, but I cannot be certain the details are exactly right for your circumstances.  You may have to tweak things a bit.

    Michael Schuster said:
    error #16004-D: file "/share/opt/ti/tm4c129/curve25519/libCurve25519.a<x25519-cortex-m4-gcc.o>" has a Tag_ABI_VFP_args attribute value of "0" that is different than one previously seen ("1"); combining incompatible files

    The problem here is the attribute Tag_ABI_VFP_args  (easy enough).  To address this, add this directive to your GCC ARM assembly source ...

    	.eabi_attribute Tag_ABI_VFP_args, 3
    

    I'm not certain about the value of this attribute.  The value used, 3, does not match either of the values shown in the error diagnostic.  However, that is the value I see when I inspect a simple C file I built using your TI ARM build options.  

    Michael Schuster said:
    error #16012-D: file "/share/opt/ti/tm4c129/curve25519/libCurve25519.a<x25519-cortex-m4-gcc.o>" does not preserve 8-byte alignment of 8-byte data, but other input files require this; incompatible files

    The problem here is the attribute Tag_ABI_align_preserved.  I found it by experimenting with the build attributes related to alignment.  Sorry, but the documentation is not that clear to me.  To address this, add this directive to your GCC ARM assembly source ...

    	.eabi_attribute Tag_ABI_align_preserved, 1

    WARNING: By adding a build attribute to your assembly code, you guarantee to the linker (whether the TI linker or the GCC linker) that all the code in this file adheres to the specifications of that build attribute.  If a build attribute does not match how the code actually works, then silent failures will occur at run time that are very hard to diagnose.

    Thanks and regards,

    -George

  • Hi George,
    thanks a lot for your support. This solved my problem, the lib does link now and seems to work properly.

    Regards
    Micky