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 use GCOV for test coverage in project. I am following instructions for freestanding environment (https://gcc.gnu.org/onlinedocs/gcc/Freestanding-Environments.html).
Below are the flags i use.
CFLAGS += -O0 -fprofile-arcs -ftest-coverage -fprofile-info-section
LFLAGS += -lgcov --coverage
With these flags, thigs works fine with toolchain version 12.3 (arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi) but i am facing below error if i upgrade to toolchain version 14.2 (arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi).
/opt/new/SM/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld: /opt/new/SM/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/14.2.1/thumb/v8-m.main+fp/softfp/libgcov.a(_gcov.o): in function `gcov_read_bytes':libgcov-driver.c:(.text.gcov_read_bytes+0x10): undefined reference to `fread'
After a bit google, i found that if i pass '-lgcov --coverage' before '-lc' in linking, then my problem is fixed.
Need help to understand why such changes are not required for toolchain version 12.3 ?