We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi. I want to set up code coverage for my ARM gcc project.
I am using the gcc toolchain that is being installed from this location:
https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2017q4/gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2
in a Docker container. I am using this to compile for an arm based microcontroller. The project uses arm-none-eabi-gcc as the compiler and arm-none-eabi-gcc-ar as the linker.
I tried adding -fprofile-arcs and -ftest-coverage to the CC Flags and -fprofile-arcs to the AR_FLAGS in my Makefile. When I try to run make, the linker produces this error: "arm-none-eabi-ar: two different operation options specified".
It is worth noting that the compilation of the individual files succeeds.
I next tried just invoking the following linker command by itself inside the Docker container:
arm-none-eabi-ar -fprofile-arcs
and I get that same error: "arm-none-eabi-ar: two different operation options specified".
How can I compile for code coverage testing with this toolchain? Is there a different set of flags that I should use to invoke arm-none-eabi-ar?
Thank you.