Hi,
I'm trying to build my project using ARMCC and CMake but I'm having difficulties with the linking step.
The project is building fine with ARM-GCC but when I tried to build it with ARMCC the linker complained about the following error:
Fatal error: L3900U: Unrecognized option '-L/(path to my library)/my_library'.
What I understand is that the "-L" option is not a valid option for armlink but I'm not sure how to fix it.
I created the separate toolchain file for ARMCC and I can build the project successfully but can't link it. Any help would be extremely appreciated.
I'm using Ubuntu with CMake version cmake version 3.21.3 and Component: Arm Compiler for Embedded FuSa 6.16.1.0 (dev drop 0).
Thanks in advance
First of all thanks for your reply and I hope this question is right for this forum.
I think I wasn't clear enough in the original question. I'm not trying to invoke compiler/linker directly by command line but with CMake. I already have an entire project with GCC setup that is building and linking correctly and now I'm trying to swap the compiler for the ARMCC. The problem I'm having is that CMake is generating the wrong options when it's time for the linking step.
The armlink is being passed the "-L" flag which is working for GCC linker but not for armlink and that's why the linking step fails.
I saw that the CMake supports compiler id ARMCC so I figured that it shouldn't be that difficult to swap compilers but I'm currently stuck at this step. I thought about skipping the "target_link_libraries" command and doing manual linking but it seems more like a hack rather than a permanent solution.
Do you have some ideas/tips about how I should proceed with using CMake with ARMCC? I know that the ARM has its own IDE but what is the current status of CMake support?
Hi Aleksa,
Sorry, I'm not personally very familiar with constructing cmake projects, however there are many examples that do use cmake with the Arm Compiler (search for Arm Total Solutions or the Ethos-U Evaluation Kit) which may give you a usable example to work from.
I did write this article a while ago on general advise on moving from gcc to the Arm Compiler, but does not address the specific issue raised here.https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/migrate-to-arm-compiler-6-from-gcc
Just a quick update. I think that the problem was that in my case