Failed to compile RF3.4
-
@dc42
Thank you very much for your reply。
I checked the compiled output of RRFLibraries and our compiled configuration is the same.
arm-none-eabi-g++ -std=gnu++17 -D__SAME70Q21__ -DRTOS -I"D:\ZQY\YIZHI\Eclipse\Firmware\FreeRTOS\src\include" -I"D:\ZQY\YIZHI\Eclipse\Firmware\FreeRTOS\src\portable\GCC\ARM_CM7\r0p1" -O2 -Wall -c -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -mfp16-format=ieee -mno-unaligned-access -ffunction-sections -fdata-sections -fno-threadsafe-statics -fno-rtti -fno-exceptions -nostdlib -Wundef -Wdouble-promotion -fsingle-precision-constant "-Wa,-ahl=StringFunctions.s" -MMD -MP -MF"src/General/StringFunctions.d" -MT"src/General/StringFunctions.o" -o "src/General/StringFunctions.o" "../src/General/StringFunctions.cpp" -
@kmarkstte this is where the linker finds those functions on my system:
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+dp/hard\libm.a(lib_a-pow.o)
c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+dp/hard\libm.a(lib_a-s_llrint.o) -
-
@Kmarkstte : I have exactly the issue, did you find a solution?
@dc42 : I don't see any libm.a under "C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\lib\gcc\arm-none-eabi\10.3.1\thumb\v7e-m+dp\hard"Thanks
Giuliano -
This post is deleted! -
@giuliano you are looking at the wrong location because you haven't taken account of some occurrences of ..\ in the path that I quoted. The correct location on my machine is C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\arm-none-eabi\lib\thumb\v7e-m+dp\hard.
-
@dc42 : you're right, it's there. Don't know how I could miss it
Any Idea what I could try to solve that undefined reference to `pow' and 'llrint' ?
Do I need to add a reference to libm.a somewhere?Thanks
Giuliano -
@giuliano I don't know why you are getting those errors and I am not, however I do know that sometimes the Gnu linker can fail to pick up a library function because it scanned the libraries in the wrong order. If that's the case then adding libm at the end of the library list might help.
-
@giuliano PS there is also a --verbose switch that you could add to the linker command, in case the output gives a hint about what is failing. See https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_3.html.
-
-
I copied libm from the GNU Arm Embedded Toolchain to one of the projects build folder (C:\Eclipse\Firmware\RRFLibraries\SAME70_RTOS) and added libm to the library list again as you suggersted and it works this way.
Not sure why the build process wasn't reading it from the original folder, although in the log i saw the entry:
attempt to open c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+dp/hard\libm.a succeededYou can close this thread i think.
Thanks a lot for your help
-
@giuliano @dc42 I have encountered the same errors. I am very new to this entire process and I am confused by what you mean by adding libm to the "library list". What / where is this list you are adding it to? I have the libm file and I have moved it to the RRFLibraries folder, so it is just the library list I need guidance to.
-
@gingergradstudent I mean add it to the list of libraries in the linker settings, after supc++. It probably isn't necessary to copy it anywhere.
-
Further to my previous reply, this linker error only occurs when using Eclipse 2022-06, whereas I have been building with Eclipse 2022-03. A fix is to add "m" (not "libm" as I suggested previously) without quotes to the linker library list. I will add this to the project configuration.
-
@dc42 I installed Eclipse 2022-03 instead of Eclipse 2022-06 and that fixed everything. Thanks!
-
@gingergradstudent @dc42
Thank you very much, I also managed to compile it