GCC 5.x libgcov: gcov_exit() and .gcda-writeout-code removed?

Asked by Lothar Stolz on 2016-02-22

Hi!

We previously used arm-none-eabi 4.9 and, for convenient debugging and code quality assurance during development, used libgcov together with ARM semihosting enabled (with librdimon/full newlib).

However, after doing the upgrade to GCC 5.x we observed that lots of features have been removed from libgcov (size now 20k instead of 40k) The well-known entry-point gcov_exit() as well as code for writing out the coverage-dump seem to have been removed (as there are no more references to any external file IO functions from newlib in the "libgcov.a"-file).

What's the reason behind stripping down libgcov this way, is there another proposed mechanism for using this very important gcov-feature now with GCC 5.x?

Best regards,
Lothar Stolz (WITTENSTEIN electronics)

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
Tejas Belagod
Solved:
2016-04-14
Last query:
2016-04-14
Last reply:
2016-04-11
Tejas Belagod (belagod-tejas) said : #1

Thanks for reporting this. We are looking into this and will get back with an answer soon.

Tejas Belagod (belagod-tejas) said : #2

This patch here https://gcc.gnu.org/ml/gcc-patches/2014-08/msg00739.html seems to have retired gcov_exit() public interface. I will have a more comprehensive answer for you soon.

Lothar Stolz (lothar-stolz) said : #3

Hi and thanks a lot for your answers!

In the meantime, are there any new information on this topic? I'm asking again because we probably will have to start soon to do a custom dirty hack to make the gcov work again, and I'd like to prevent such a hack from happening in favour of a clean, officially supported solution. Or, maybe then, is there a way of contributing for reestablishing gcov-support?

Hi Lothar,

For some reason https://gcc.gnu.org/ml/gcc-patches/2015-10/msg02424.html never made it into trunk. I have tested this patch on top of embedded-5-branch and it seems to populate libgcov again.

We will be chasing this upstream and in the meantime we committed this patch to the embedded-5-branch which will thus be included in our next release.

Cheers,
Andre

Best Tejas Belagod (belagod-tejas) said : #5

Hi Lothar,

This should be fixed in https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q1-update.

Thanks,
Tejas.

Lothar Stolz (lothar-stolz) said : #6

Hi Tejas,

Thanks very much! Tested it and all seems to work fine again :-) Since gcov_exit() isn't exported, for triggering off the coverage Information dump, legacy applications now seem to have to be slightly modified to do a call to __gcov_flush() instead.

Thanks again & best regards,
Lothar

Lothar Stolz (lothar-stolz) said : #7

Thanks Tejas Belagod, that solved my question.