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/AM3354: Compiler AM3354: GNU and TI compilers

Part Number: AM3354

Tool/software: TI C/C++ Compiler

Good afternoon.

Can I use the library created under the GNU compiler in the project for AM3354, created under the TI compiler?

We use RTOS.

We are going to use the GNU compiler to write only mathematical libraries that will use all the capabilities of NEON. These libraries will be connected to projects created on the basis of the TI compiler, since this compiler does not allow you to implement all the capabilities of NEON. Projects were created long ago, when it was not possible to use the GNU compiler.

hank you.

  • Both the TI and GNU ARM compilers adhere to the EABI standard.  If you have any problems, we would be interested in hearing about it.

    Thanks and regards,

    -George

  • There is a project with such parameters:

    "C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/bin/armcl" -mv7A8 --code_state=32 --float_support=VFPv3 -me -O2 --opt_for_speed=5 --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.1.LTS/include" --include_path="D:/RABOTA/Programs_CCSv7/BEMPRU_DZL_Tiva/Common" -- define=am3354 --define=UIA_DEBUG --define=EXTERNAL_MEMORY --define=_INCLUDE_NIMU_CODE --define=am335x --define=Debug --define=Release --define=_version_rudzl_="001" --diag_suppress=69 --diag_suppress=112 --diag_suppress=548 --diag_suppress=145 --diag_warning=225 --diag_wrap=off --display_error_number --neon --abi=eabi --preproc_with_compile --preproc_dependency="Sources/bios_driver/uartdma/UARTSitara.d" --obj_directory="Sources/bios_driver/uartdma" --cmd_file="configPkg/compiler.opt" "../Sources/bios_driver/uartdma/UARTSitara.c"

    'Finished building: ../Sources/bios_driver/uartdma/UARTSitara.c'

     

    A library with the following parameters was created:

    'Building file: ../Source/main.c'

    'Invoking: GNU Compiler'

    "C:/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=softfp -mfpu=neon-vfpv4 -Dam3354 -I"D:/RABOTA/Programs_CCSv7/test_lib" -I"C:/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include" -O2 -Wall -MMD -MP -MF"Source/main.d"

     

    When I connect the library to the project, I get the following errors:

    <Linking>

    error #16004-D: file "../library/libtest_lib.a<main.o>" has a Tag_ABI_VFP_args attribute value of "0" that is different than one previously seen ("1"); combining incompatible files

    warning #16032-D: object files have incompatible wchar_t types ("../library/libtest_lib.a<main.o>" = --wchar_t=32, "./61850/common/array_list.obj" = --wchar_t=16)

    warning #16016-D: file "../library/libtest_lib.a<main.o>" was built for VFPv4 coprocessor support while a previously seen file was built for VFPv3 coprocessor support

    error #10010: errors encountered during linking; "BEMP_RUDZL_01.01.10.out" not built

     

    >> Compilation failure

    makefile:597: recipe for target 'BEMP_RUDZL_01.01.10.out' failed

    gmake[1]: *** [BEMP_RUDZL_01.01.10.out] Error 1

    makefile:593: recipe for target 'all' failed

    gmake: *** [all] Error 2

    Thanks for the help

    Igor

  • To make it work, change the GCC compiler options like this:

    • Add -fshort-wchar
    • Change -mfpu=neon-vfpv4 to -mfpu=vfpv3

    The first change causes the ARM compiler to match the TI compiler size for type wchar_t.  The size of wchar_t is not specified in EABI.  It can be either 16-bits or 32-bits.  The TI ARM compiler default is 16-bits.  The GCC ARM compiler default is 32-bits.

    The second change uses a different vector floating point option.  I'm not certain this is correct.  According to this page from ARM, Cortex-A8 supports VFPv3.  But the ARM GCC compiler has several -mfpu choices with vfpv3 in them.  While this one probably works, it may not be the best choice.  I'll research a bit more.  If I find a better answer, I'll post it.

    Thanks and regards,

    -George

  • Good afternoon!

    Parameter -fshort-wchar in the settings of the GCC was not found, so I added it manually via Edit Flags.

    Set the parameter vfpv3:

    -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=softfp -mfpu=vfpv3 -Dam3354 -I"${PROJECT_ROOT}" -I"${CG_TOOL_INCLUDE_PATH}" -O2 -Wall -fshort-wchar

    I taught the following errors:

     

    **** Build of configuration Release__GNU for project test_lib ****

     

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

    'Building file: ../Source/main.c'

    'Invoking: GNU Compiler'

    "C:/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=softfp -mfpu=vfpv3 -Dam3354 -I"D:/RABOTA/Programs_CCSv7/test_lib" -I"C:/ti/ccsv7/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include" -O2 -Wall -fshort-wchar -MMD -MP -MF"Source/main.d" -MT"Source/main.o" -o"Source/main.o"  "../Source/main.c"

    Source/subdir_rules.mk:9: recipe for target 'Source/main.o' failed

    In file included from ../Source/main.c:9:0:

    ../Source/..\include\arm_neon.h:31:2: error: #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h

     #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h

      ^

    ../Source/main.c: In function 'lib1':

    ../Source/main.c:21:1: warning: implicit declaration of function 'intrinsics' [-Wimplicit-function-declaration]

     intrinsics(&x, &y, &z, size);

     ^

    ../Source/main.c: At top level:

    ../Source/main.c:26:17: error: unknown type name 'uint32_t'

     void intrinsics(uint32_t *x, uint32_t *y, uint32_t *z, unsigned int l_size)

                     ^

    ../Source/main.c:26:30: error: unknown type name 'uint32_t'

     void intrinsics(uint32_t *x, uint32_t *y, uint32_t *z, unsigned int l_size)

                                  ^

    ../Source/main.c:26:43: error: unknown type name 'uint32_t'

     void intrinsics(uint32_t *x, uint32_t *y, uint32_t *z, unsigned int l_size)

                                               ^

    gmake: *** [Source/main.o] Error 1

    gmake: Target 'all' not remade because of errors.

     

    **** Build Finished ****

     

    The library needs access not only to the VFP, but also to the instructions of the NEON.

     

    Thanks for the help.

    Igor

  • The answer will be or not?

    Thanks for the help.

    Igor