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: Linaro Tools - FPU library & CCS

Tool/software: TI C/C++ Compiler

Hello,

Using Linaro tools for the A15 on TDA2xx.

I would like your help in understanding the Linaro tools folder tree, specifically, how do i choose the proper FPU library.

on version 4_9_2015q3 there are several FPU folders containing FPU libraries (i.e. one under the gcc folder, one under lib, and under some architecture folders) - it is very confusing as to why all of these exist and how to know which is the correct one to choose (if need to choose at all - could it be it is internally being defined to be taken according to other configurations?)

In addition on a newer Linaro tools version, the FPU under the gcc folder no longer exist and in general the folder tree was changes so this adds up to the confusion of how to properly know what should be used and how.

Another issue is, i have tried installing the new CCS 9, on CCS 8 there was an automatic variable definition for CG_GCC_SEARCH_PATH , but on the new CCS 9 this does no longer exists. can you explain the difference ?

Thanks

Guy

  • Guy Mardiks said:
    In addition on a newer Linaro tools version, the FPU under the gcc folder no longer exist and in general the folder tree was changes so this adds up to the confusion of how to properly know what should be used and how.

    The GCC multilib is used to select the library to link, based upon the command line parameters. Using the -print-multi-lib option on different GCC ARM versions installed by CCS shows the following:

    ~/ti/ccs830/ccsv8/tools/compiler/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc -print-multi-lib
    .;
    thumb;@mthumb
    fpu;@mfloat-abi=hard
    armv6-m;@mthumb@march=armv6s-m
    armv7-m;@mthumb@march=armv7-m
    armv7e-m;@mthumb@march=armv7e-m
    armv7-ar/thumb;@mthumb@march=armv7
    cortex-m7;@mthumb@mcpu=cortex-m7
    armv7e-m/softfp;@mthumb@march=armv7e-m@mfloat-abi=softfp@mfpu=fpv4-sp-d16
    armv7e-m/fpu;@mthumb@march=armv7e-m@mfloat-abi=hard@mfpu=fpv4-sp-d16
    armv7-ar/thumb/softfp;@mthumb@march=armv7@mfloat-abi=softfp@mfpu=vfpv3-d16
    armv7-ar/thumb/fpu;@mthumb@march=armv7@mfloat-abi=hard@mfpu=vfpv3-d16
    cortex-m7/softfp/fpv5-sp-d16;@mthumb@mcpu=cortex-m7@mfloat-abi=softfp@mfpu=fpv5-sp-d16
    cortex-m7/softfp/fpv5-d16;@mthumb@mcpu=cortex-m7@mfloat-abi=softfp@mfpu=fpv5-d16
    cortex-m7/fpu/fpv5-sp-d16;@mthumb@mcpu=cortex-m7@mfloat-abi=hard@mfpu=fpv5-sp-d16
    cortex-m7/fpu/fpv5-d16;@mthumb@mcpu=cortex-m7@mfloat-abi=hard@mfpu=fpv5-d16
    ~/ti/ccs830/ccsv8/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc -print-multi-lib
    .;
    thumb;@mthumb
    hard;@mfloat-abi=hard
    thumb/v6-m;@mthumb@march=armv6s-m
    thumb/v7-m;@mthumb@march=armv7-m
    thumb/v7e-m;@mthumb@march=armv7e-m
    thumb/v7-ar;@mthumb@march=armv7
    thumb/v8-m.base;@mthumb@march=armv8-m.base
    thumb/v8-m.main;@mthumb@march=armv8-m.main
    thumb/v7e-m/fpv4-sp/softfp;@mthumb@march=armv7e-m@mfpu=fpv4-sp-d16@mfloat-abi=softfp
    thumb/v7e-m/fpv4-sp/hard;@mthumb@march=armv7e-m@mfpu=fpv4-sp-d16@mfloat-abi=hard
    thumb/v7e-m/fpv5-sp/softfp;@mthumb@march=armv7e-m@mfpu=fpv5-sp-d16@mfloat-abi=softfp
    thumb/v7e-m/fpv5-sp/hard;@mthumb@march=armv7e-m@mfpu=fpv5-sp-d16@mfloat-abi=hard
    thumb/v7e-m/fpv5/softfp;@mthumb@march=armv7e-m@mfpu=fpv5-d16@mfloat-abi=softfp
    thumb/v7e-m/fpv5/hard;@mthumb@march=armv7e-m@mfpu=fpv5-d16@mfloat-abi=hard
    thumb/v7-ar/fpv3/softfp;@mthumb@march=armv7@mfpu=vfpv3-d16@mfloat-abi=softfp
    thumb/v7-ar/fpv3/hard;@mthumb@march=armv7@mfpu=vfpv3-d16@mfloat-abi=hard
    thumb/v8-m.main/fpv5-sp/softfp;@mthumb@march=armv8-m.main@mfpu=fpv5-sp-d16@mfloat-abi=softfp
    thumb/v8-m.main/fpv5-sp/hard;@mthumb@march=armv8-m.main@mfpu=fpv5-sp-d16@mfloat-abi=hard
    thumb/v8-m.main/fpv5/softfp;@mthumb@march=armv8-m.main@mfpu=fpv5-d16@mfloat-abi=softfp
    thumb/v8-m.main/fpv5/hard;@mthumb@march=armv8-m.main@mfpu=fpv5-d16@mfloat-abi=hard
    ~/ti/ccs830/ccsv8/tools/compiler/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc -print-multi-lib
    .;
    thumb;@mthumb
    hard;@mfloat-abi=hard
    thumb/v6-m;@mthumb@march=armv6s-m
    thumb/v7-m;@mthumb@march=armv7-m
    thumb/v7e-m;@mthumb@march=armv7e-m
    thumb/v7-ar;@mthumb@march=armv7
    thumb/v8-m.base;@mthumb@march=armv8-m.base
    thumb/v8-m.main;@mthumb@march=armv8-m.main
    thumb/v7e-m/fpv4-sp/softfp;@mthumb@march=armv7e-m@mfpu=fpv4-sp-d16@mfloat-abi=softfp
    thumb/v7e-m/fpv4-sp/hard;@mthumb@march=armv7e-m@mfpu=fpv4-sp-d16@mfloat-abi=hard
    thumb/v7e-m/fpv5/softfp;@mthumb@march=armv7e-m@mfpu=fpv5-d16@mfloat-abi=softfp
    thumb/v7e-m/fpv5/hard;@mthumb@march=armv7e-m@mfpu=fpv5-d16@mfloat-abi=hard
    thumb/v7-ar/fpv3/softfp;@mthumb@march=armv7@mfpu=vfpv3-d16@mfloat-abi=softfp
    thumb/v7-ar/fpv3/hard;@mthumb@march=armv7@mfpu=vfpv3-d16@mfloat-abi=hard
    thumb/v8-m.main/fpv5-sp/softfp;@mthumb@march=armv8-m.main@mfpu=fpv5-sp-d16@mfloat-abi=softfp
    thumb/v8-m.main/fpv5-sp/hard;@mthumb@march=armv8-m.main@mfpu=fpv5-sp-d16@mfloat-abi=hard
    thumb/v8-m.main/fpv5/softfp;@mthumb@march=armv8-m.main@mfpu=fpv5-d16@mfloat-abi=softfp
    thumb/v8-m.main/fpv5/hard;@mthumb@march=armv8-m.main@mfpu=fpv5-d16@mfloat-abi=hard

    So while the folder tree for the libraries has changed between between versions, a project should select the appropriate library based upon the compiler options without having to add a specific compiler library directory to the search path.

    E.g. for a project for a Cortex-A15 which used the options -marm -mfloat-abi=hard then:

    a. When compiled with v4.9.3 the linker map file showed the library in the fpu directory was linked

    b. When compiled with v7.2.1 the linker map file showed the library in the hard directory was linked.

  • Hi, Thank you for your answer.
    I am still a bit unsure - for example regarding the fpu directory taken in the v4.9.3 - which fpu directory is it (as i mentioned, there are several folders named fpu under different folder tree branches)?

    Thanks
    Guy
  • Guy Mardiks said:
    for example regarding the fpu directory taken in the v4.9.3 - which fpu directory is it (as i mentioned, there are several folders named fpu under different folder tree branches)?

    It is the options passed to the linker which select which directory the run-time libraries are linked from, where the output of -print-multi-lib show which options are used used to select the libraries.

    With -marm -mfloat-abi=hard -mfpu=neon-vfpv4 used to target a Cortex-A15 for ARM mode then:

    v4.9.3 links the libraries in gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/lib/fpu

    v7.2.1 links the libraries in gcc-arm-none-eabi-7-2017-q4-major-win32/arm-none-eabi/lib/hard

    While there are several directories in the v4.9.3 installation named fpu, the arm-none-eabi/lib/fpu is used for ARM mode while the others are used when THUMB mode is selected when linking.

    Looking at the multilib march and mfpu options for the fpu libraries compiled for THUMB, those libraries are either for Cortex-M or for a previous generation FPU than for the VFPv4-D32 in the Cortex-A15. Therefore, recommend leaving -marm as the option passed to the linker to select the ARM mode libraries with -mfloat-abi=hard hardware floating point support (inter-working means the program can contain a mix of ARM and THUMB mode functions).

    While looking into this, found Demystifying ARM Floating Point Compiler Options which contains a useful overview of the -mfpu and -mfloat-abi options.

  • Thanks a lot for your answer.

    Regards
    Guy