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.

SW-EK-TM4C129EXL: Linking issues with GNU and mfloat-abi=hard

Part Number: SW-EK-TM4C129EXL
Other Parts Discussed in Thread: EK-TM4C129EXL, TM4C129ENCPDT

Hi,
I am trying to use freeRTOS on EK-TM4C129EXL. I have followed this older tutorial and tried to build the project, but I get the following errors:

Building target: "TestCompileGNUMfloatAbiHard.out"

Invoking: GNU Linker

"/Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gcc-9.2.1" -DPART_TM4C129ENCPDT -Og -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -mcpu=cortex-m4 -Wl,-Map,"TestCompileGNUMfloatAbiHard.map" -o"TestCompileGNUMfloatAbiHard.out" "./main.o" "./tm4c129encpdt_startup_ccs_gcc.o" -Wl,-T"../tm4c129encpdt.lds" 

makefile:139: recipe for target 'TestCompileGNUMfloatAbiHard.out' failed

/Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: error: ./main.o uses VFP register arguments, TestCompileGNUMfloatAbiHard.out does not

/Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file ./main.o

/Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: error: ./tm4c129encpdt_startup_ccs_gcc.o uses VFP register arguments, TestCompileGNUMfloatAbiHard.out does not

/Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file ./tm4c129encpdt_startup_ccs_gcc.o

collect2: error: ld returned 1 exit status

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

gmake: *** [all] Error 2

makefile:135: recipe for target 'all' failed

After some research, I realized that the issue is not related to FreeRTOS but that I cannot compile any project using GNU (v9.2.1 Linaro) with the flag -mfloat-abi=hard (everything compiles fine with the flag set for softfp). I do not see why mfloat-abi causes an error when set to "hard." If someone knows how to solve this issue, I would appreciate it!

Pierrick

  • Hi,

      Sorry, I'm not well versed in GNU toolchain. I will move your post to our CCS experts for assistance. I think you may have a mixture of soft (e.g. your library ) and hard (e.g. your application) in your linking but I'm not really sure. 

  • Please rebuild the entire project.  One way to do that is to right-click on the name of the project and select Rebuild Project.  Then save the contents of the Console (not Problems) view to a text file.  Use the icon named Copy Build Log.  When you name the log file, be sure to use the file extension .txt.  Please attach that text file to your next post.

    Thanks and regards,

    -George

  • After some research, I realized that the issue is not related to FreeRTOS but that I cannot compile any project using GNU (v9.2.1 Linaro) with the flag -mfloat-abi=hard (everything compiles fine with the flag set for softfp).

    GCC can generate such linker errors if the compiler and linker have not been passed the same options which select the runtime.

    With GCC projects used in CCS have sometimes seen that CCS isn't passing all the runtime options specified in the Build -> GNU Compiler -> Runtime to the linker which can lead to linker errors. E.g. see CCS 10.4.0.00006 : For the GCC ARM compiler how does CCS determine how many of the Compiler Runtime options to pass to the Linker?

    As a work-around in the CCS project properties under Build -> GNU Linker -> Miscellaneous can you try adding -mfloat-abi=hard to the miscellaneous flags.

  • Hi George,
    Here is the log obtained in the console after rebuilding the project. I am attaching it, and I will try Chester's solution right after.
    Best,
    Pierrick

    buildLogs.txt
    **** Build of configuration Debug for project TestCompileGNUMfloatAbiHard ****
    
    /Applications/ti/ccs1110/ccs/utils/bin/gmake -k -j 7 all -O 
     
    Building file: "../tm4c129encpdt_startup_ccs_gcc.c"
    Invoking: GNU Compiler
    "/Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gcc-9.2.1" -c -mcpu=cortex-m4 -march=armv7e-m -mthumb -mfloat-abi=hard -DPART_TM4C129ENCPDT -I"/Users/pierrickrauby/workspace_v10/TestCompileGNUMfloatAbiHard" -I"/Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi/include" -Og -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"tm4c129encpdt_startup_ccs_gcc.d_raw" -MT"tm4c129encpdt_startup_ccs_gcc.o"   -o"tm4c129encpdt_startup_ccs_gcc.o" "../tm4c129encpdt_startup_ccs_gcc.c"
    Finished building: "../tm4c129encpdt_startup_ccs_gcc.c"
     
    Building file: "../main.c"
    Invoking: GNU Compiler
    "/Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gcc-9.2.1" -c -mcpu=cortex-m4 -march=armv7e-m -mthumb -mfloat-abi=hard -DPART_TM4C129ENCPDT -I"/Users/pierrickrauby/workspace_v10/TestCompileGNUMfloatAbiHard" -I"/Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi/include" -Og -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -MMD -MP -MF"main.d_raw" -MT"main.o"   -o"main.o" "../main.c"
    Finished building: "../main.c"
     
    Building target: "TestCompileGNUMfloatAbiHard.out"
    Invoking: GNU Linker
    "/Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gcc-9.2.1" -DPART_TM4C129ENCPDT -Og -ffunction-sections -fdata-sections -g -gdwarf-3 -gstrict-dwarf -Wall -specs="nosys.specs" -mcpu=cortex-m4 -Wl,-Map,"TestCompileGNUMfloatAbiHard.map" -o"TestCompileGNUMfloatAbiHard.out" "./main.o" "./tm4c129encpdt_startup_ccs_gcc.o" -Wl,-T"../tm4c129encpdt.lds"  
    makefile:139: recipe for target 'TestCompileGNUMfloatAbiHard.out' failed
    /Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: error: ./main.o uses VFP register arguments, TestCompileGNUMfloatAbiHard.out does not
    /Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file ./main.o
    /Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: error: ./tm4c129encpdt_startup_ccs_gcc.o uses VFP register arguments, TestCompileGNUMfloatAbiHard.out does not
    /Applications/ti/ccs1110/ccs/tools/compiler/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file ./tm4c129encpdt_startup_ccs_gcc.o
    collect2: error: ld returned 1 exit status
    gmake[1]: *** [TestCompileGNUMfloatAbiHard.out] Error 1
    gmake: *** [all] Error 2
    makefile:135: recipe for target 'all' failed
    
    **** Build Finished ****
    

  • Hi Chester,
    Thanks! Adding mfloat-abi = hard in the miscellaneous flags of the linker solved my issue. I will mark this topic as solved tomorrow evening in case George has a comment on the BuildLogs that I shared above.
    Thanks again,
    Pierrick